OpticDisc::OpticDisc(const Coordinate<int> &coordinate, int diameter) { if (coordinate.isValid()) { setCoordinate(coordinate); setDiameter(diameter); } else { std::cout << "Cannot set invalid coordinates to optic disc!" << std::endl; } }
LED::LED(QWidget* parent) : QWidget(parent), diameter_(5), color_(QColor("red")), alignment_(Qt::AlignCenter), initialState_(true), state_(true), flashRate_(200), flashing_(false) { timer_ = new QTimer(this); connect(timer_, SIGNAL(timeout()), this, SLOT(toggleState())); setDiameter(diameter_); }
int VSSpherePhantom::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = VSSubphantom::qt_metacall(_c, _id, _a); if (_id < 0) return _id; #ifndef QT_NO_PROPERTIES if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = diameter(); break; case 1: *reinterpret_cast< float*>(_v) = apodization(); break; } _id -= 2; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setDiameter(*reinterpret_cast< QString*>(_v)); break; case 1: setApodization(*reinterpret_cast< float*>(_v)); break; } _id -= 2; } else if (_c == QMetaObject::ResetProperty) { _id -= 2; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 2; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 2; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 2; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 2; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 2; } #endif // QT_NO_PROPERTIES return _id; }