unsigned char st_run(void){ if (timerCountDownActivated == POWER_SUPPLY) { if (isPowerLED_ON()== OFF) { timerCountDownActivated = NOT_ACTIVATED; setTracking(OFF); setHeartBeat(OFF); setActivityDetected(FALSE); return POWEROFF; } return RUN; } else if (timerCountDownActivated == SUSPEND_ACK_WAITING) { if (timerExpired()) { //Computer might hangs //Heartbeat = TRUE but never ACK SUSPEND timerCountDownActivated = NOT_ACTIVATED; }else if (getSuspendAcknowledge()) { timerCountDownActivated = NOT_ACTIVATED; setTimerIn100ms(ZERO); setTracking(OFF); setHeartBeat(OFF); setActivityDetected(FALSE); return SUSPEND; } return RUN; } if (getHeartBeatInactiveTimeInS() > HEARTBEAT_THRESOLD_SEC) { //Ubuntu hangs -> Turn it off powerSupplyON(OFF); timerCountDownActivated = POWER_SUPPLY; }else if (getTracking()==OFF) { //Ubuntu not tracking -> Suspend sendSuspendRequest(); timerCountDownActivated = SUSPEND_ACK_WAITING; setTimerIn100ms(SUSPENSION_WAIT); } return RUN; }
void Slider::reloadSlider() { slider->hide(); if (orientation == 0) { slider->setOrientation(Qt::Horizontal); slider->setGeometry(x()+10, height()/2-10, width()-20, 20); } else if (orientation == 1) { slider->setOrientation(Qt::Vertical); slider->setGeometry(width()/2-10, 10, 20, height()-20); } slider->setMinValue(-32768); slider->show(); setTickmarks (tickmarks); setTickInterval (tickInterval); setTracking (tracking); setPageStep(pageStep); setMainColor(mainColor); setTickmarksColor(tickmarksColor); setMinValue(minValue); setMaxValue(maxValue); if (direction == 0) slider->setValue((int)(-32768 + (value-minValue)/lineStep)); else if (direction == 1) slider->setValue((int)(-32768 + (maxValue-value)/lineStep)); setNewMask(); }
//------------------------------------------------------------------------------ Qdslider::Qdslider( QWidget *parent = 0 ) : QSlider(parent) { m_dvalue= (double)value(); setTracking(true); connect(this, SIGNAL(valueChanged(int)), this, SLOT(toDouble(int))); }
void DynamicObjectModel::setSliderEditor(Node& node, float min, float max, float step) { auto value = node.m_getter().toFloat(); node.onCreateEditor = [&node, value, min, max, step](QWidget* parent, const QStyleOptionViewItem&) -> QWidget* { QWidget* widget = new QWidget(parent); QHBoxLayout* layout = new QHBoxLayout(widget); layout->setContentsMargins(0, 0, 0, 0); auto slider = new QSlider(Qt::Orientation::Horizontal, widget); slider->setRange(min * 100, max * 100); slider->setSingleStep(step * 100); slider->setPageStep(step * 100); slider->setValue(value * 100); slider->setTracking(true); auto input = new QDoubleSpinBox(widget); input->setRange(min, max); input->setValue(value); input->setDecimals(2); input->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); connect(slider, &QSlider::valueChanged, [&node, input](int value){ node.m_setter(value * 0.01f); input->setValue(value * 0.01f); }); connect(input, (void (QDoubleSpinBox::*)(double))&QDoubleSpinBox::valueChanged, [slider, node](double value){ node.m_setter(value); slider->setValue((int)(value * 100)); }); layout->addWidget(input); layout->addWidget(slider); return widget; }; }
void ValControlSegment::MouseUp(BPoint point) { if (isTracking()) { setTracking(false); mouseReleased(); } }
/*! \fn QChannelDial() */ QChannelDial::QChannelDial(QWidget* parent, int ch, int fxid) : QDial(parent) { setTracking(true); channel = ch; sendfxid = fxid; connect(this, SIGNAL(sliderReleased()), SLOT(forwardSliderMoved())); }
// init mouse tracking void ValControlSegment::trackMouse(BPoint point, track_flags flags) { fTrackFlags = flags; fPrevPoint = point; setTracking(true); SetMouseEventMask(B_POINTER_EVENTS, B_LOCK_WINDOW_FOCUS | B_NO_POINTER_HISTORY); }
int QwtAbstractSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QwtAbstractScale::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 5) qt_static_metacall(this, _c, _id, _a); _id -= 5; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< double*>(_v) = value(); break; case 1: *reinterpret_cast< uint*>(_v) = totalSteps(); break; case 2: *reinterpret_cast< uint*>(_v) = singleSteps(); break; case 3: *reinterpret_cast< uint*>(_v) = pageSteps(); break; case 4: *reinterpret_cast< bool*>(_v) = stepAlignment(); break; case 5: *reinterpret_cast< bool*>(_v) = isReadOnly(); break; case 6: *reinterpret_cast< bool*>(_v) = isTracking(); break; case 7: *reinterpret_cast< bool*>(_v) = wrapping(); break; case 8: *reinterpret_cast< bool*>(_v) = invertedControls(); break; } _id -= 9; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setValue(*reinterpret_cast< double*>(_v)); break; case 1: setTotalSteps(*reinterpret_cast< uint*>(_v)); break; case 2: setSingleSteps(*reinterpret_cast< uint*>(_v)); break; case 3: setPageSteps(*reinterpret_cast< uint*>(_v)); break; case 4: setStepAlignment(*reinterpret_cast< bool*>(_v)); break; case 5: setReadOnly(*reinterpret_cast< bool*>(_v)); break; case 6: setTracking(*reinterpret_cast< bool*>(_v)); break; case 7: setWrapping(*reinterpret_cast< bool*>(_v)); break; case 8: setInvertedControls(*reinterpret_cast< bool*>(_v)); break; } _id -= 9; } else if (_c == QMetaObject::ResetProperty) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 9; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 9; } #endif // QT_NO_PROPERTIES return _id; }
DoubleSlider::DoubleSlider(QWidget *parent) : QSlider(parent) { min = 0; max = 100; v1 = 0; v2 = 100; QStyleOptionSlider option; setTracking(true); setMinimum(0); setMaximum(100); }
unsigned char st_booting(void){ if (getHeartBeat()) { //Need to reset the tracking timer setTracking(ON); setHeartBeat(ON); return RUN; } else { return BOOTING; } }
Projectile::Projectile(b2Body* body, const ProjectileDef& def, ForceFunc& forceCallback) : Entity(body), forceCallback_(forceCallback), fired_(false), oneHit_(def.oneHit), origin_(def.origin), heading_(def.heading), lastPen_(0, 0, 0), maxHP_(def.hpMAX), hp_(def.hpMAX), damage_(def.damage), size_(def.width, def.height), lifeTime_(def.lifeTime), lifeTimeMAX_(def.lifeTime), owner_(def.owner), tracking_(def.tracking), penetration_(def.penetration), bounce_(def.bounce) { if (def.height > 0) { setAsRect(size_, bounce_, penetration_); } else { setAsCircle(size_, bounce_, penetration_); } //Faction faction_ = def.faction; //Explosive properties force_ = def.detonation; shrapnel_ = def.shrapnel; //Tracking if (tracking_.radius > 0 && tracking_.speed > 0) { setTracking(tracking_.radius); } //Do maths to orient body body_->SetTransform(origin_, atan2f(-heading_.x, heading_.y)); body_->SetLinearVelocity(def.inVelocity); //Set up colours colPrim_ = def.colPrim; colSecn_ = def.colSecn; colTert_ = def.colTert; fire(def.velScale); }
int Q3Header::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 10) qt_static_metacall(this, _c, _id, _a); _id -= 10; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break; case 1: *reinterpret_cast< bool*>(_v) = tracking(); break; case 2: *reinterpret_cast< int*>(_v) = count(); break; case 3: *reinterpret_cast< int*>(_v) = offset(); break; case 4: *reinterpret_cast< bool*>(_v) = isMovingEnabled(); break; case 5: *reinterpret_cast< bool*>(_v) = isStretchEnabled(); break; } _id -= 6; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break; case 1: setTracking(*reinterpret_cast< bool*>(_v)); break; case 3: setOffset(*reinterpret_cast< int*>(_v)); break; case 4: setMovingEnabled(*reinterpret_cast< bool*>(_v)); break; case 5: setStretchEnabled(*reinterpret_cast< bool*>(_v)); break; } _id -= 6; } else if (_c == QMetaObject::ResetProperty) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 6; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 6; } #endif // QT_NO_PROPERTIES return _id; }
bool QDial::qt_invoke( int _id, QUObject* _o ) { switch ( _id - staticMetaObject()->slotOffset() ) { case 0: setValue((int)static_QUType_int.get(_o+1)); break; case 1: addLine(); break; case 2: subtractLine(); break; case 3: addPage(); break; case 4: subtractPage(); break; case 5: setNotchesVisible((bool)static_QUType_bool.get(_o+1)); break; case 6: setWrapping((bool)static_QUType_bool.get(_o+1)); break; case 7: setTracking((bool)static_QUType_bool.get(_o+1)); break; default: return QWidget::qt_invoke( _id, _o ); } return TRUE; }
// =========================================================================== // member method definitions // =========================================================================== GUIGlChildWindow::GUIGlChildWindow(FXMDIClient* p, FXMDIMenu *mdimenu, const FXString& name, FXIcon* ic, FXuint opts,FXint x, FXint y, FXint w, FXint h) : FXMDIChild(p, name, ic, mdimenu, opts, x, y, w, h), myView(0) { // Make MDI Window Menu setTracking(); myContentFrame = new FXVerticalFrame(this, FRAME_SUNKEN|LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y, 0,0,0,0,0,0,0,0); // build the tool bar buildNavigationToolBar(); // always there (recenter) buildColoringToolBar(); // always there (coloring) buildScreenshotToolBar(); // always there (screen shot) }
void ValControlSegment::MouseDown(BPoint point) { if (!parent()->IsEnabled()) return; parent()->MakeFocus(); // not left button? uint32 nButton; GetMouse(&point, &nButton); if (!(nButton & B_PRIMARY_MOUSE_BUTTON)) return; // double click? bigtime_t doubleClickInterval; if (get_click_speed(&doubleClickInterval) < B_OK) { PRINT(("* ValControlSegment::MouseDown():\n" " get_click_speed() failed.")); return; } bigtime_t now = system_time(); if (now - fLastClickTime < doubleClickInterval) { if(isTracking()) { setTracking(false); mouseReleased(); } // hand off to parent control parent()->showEditField(); fLastClickTime = 0LL; return; } else fLastClickTime = now; // engage tracking trackMouse(point, TRACK_VERTICAL); }
Slider::Slider( QWidget *parent, const char *name,Qt::WFlags flag) :VtlWidget( parent, name, flag) { resize(100,40); slider = new QSlider(this); slider->setOrientation(Qt::Horizontal); slider->setGeometry(10,10,80,20); slider->setMinValue(-32768); slider->show(); orientation = Qt::Horizontal; direction = LeftToRight; minValue = 0; maxValue = 100; value = 0; tracking = Disabled; tickmarks = 0; tickInterval = 10; lineStep = 10; pageStep = 10; mainColor = Qt::white; tickmarksColor = Qt::black; precision = 1; setTickmarks (tickmarks); setTickInterval (tickInterval); setTracking (tracking); setDirection(direction); setLineStep(lineStep); setPageStep(pageStep); setMainColor(mainColor); setTickmarksColor(tickmarksColor); setNewMask(); MDIRef = NULL; connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged(int))); connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(setNewMask())); }
Coord::Coord() { setX(0); setY(0); setTracking(false); }
void PlaneState::updateState(const Basic::Component* const actor) { const Simulation::AirVehicle* airVehicle = dynamic_cast<const Simulation::AirVehicle*>(actor); setAlive(false); if (airVehicle != nullptr && airVehicle->isActive()) { setAltitude(airVehicle->getAltitude()); setAlive(airVehicle->getMode() == Simulation::Player::ACTIVE); setHeading(airVehicle->getHeading()); setPitch(airVehicle->getPitch()); setRoll(airVehicle->getRoll()); osg::Vec3d angularVels = airVehicle->getAngularVelocities(); setRollRate(angularVels.x()); setPitchRate(angularVels.y()); setYawRate(angularVels.z()); setTracking(false); setTargetTrack(MAX_TRACKS); // 0 is a valid target track, use MAX_TRACKS to // signal "no tgt track" setSpeed(airVehicle->getCalibratedAirspeed()); setNumEngines(airVehicle->getNumberOfEngines()); setIncomingMissile(false); setMissileFired(false); // determine if we have a missile to fire #if 1 const Simulation::StoresMgr* stores = airVehicle->getStoresManagement(); if (stores == nullptr || stores->getNextMissile() == nullptr) { // either we have no SMS, or we have no more missile setMissileFired(true); } else { // we have an sms, and we have a missile available // loop through player list and attempt to find out if one of our missiles is active // if there is an active missile, then for the time being, we do not have a missile to fire const Simulation::Simulation* sim = airVehicle->getSimulation(); const Basic::PairStream* players = sim->getPlayers(); bool finished = false; for (const Basic::List::Item* item = players->getFirstItem(); item != nullptr && !finished; item = item->getNext()) { // Get the pointer to the target player const Basic::Pair* pair = static_cast<const Basic::Pair*>(item->getValue()); const Simulation::Player* player = static_cast<const Simulation::Player*>(pair->object()); if (player->isMajorType(Simulation::Player::WEAPON) && (player->isActive() || player->isMode(Simulation::Player::PRE_RELEASE)) && (player->getSide() == airVehicle->getSide())) { // our side has a weapon on-the-way/in-the-air; setMissileFired(true); finished=true; } } } #else // this state class has no way to determine whether we've fired a missile other than checking to see if sms is out of missiles to fire. // which means, it will fire all its missiles at first target. const Simulation::StoresMgr* stores = airVehicle->getStoresManagement(); if (stores != 0) { const Simulation::Missile* wpn = stores->getNextMissile(); if (!wpn) setMissileFired(true); } else { // we have no SMS, we can't fire a missile; setMissileFired(true); } #endif //const Basic::String* playerName = airVehicle->getName(); // DH - DOES NOT COMPILE WITH CONST -- ???? Simulation::AirVehicle* airVehicleX = const_cast<Simulation::AirVehicle*>(airVehicle); const Basic::Pair* sensorPair = airVehicleX->getSensorByType(typeid(Simulation::Radar)); if (sensorPair != nullptr) { const Simulation::Radar* radar = static_cast<const Simulation::Radar*>(sensorPair->object()); if (radar != nullptr) { const Simulation::TrackManager* trackManager = radar->getTrackManager(); Basic::safe_ptr<Simulation::Track> trackList[50]; unsigned int nTracks = trackManager->getTrackList(trackList, 50); for (int trackIndex = nTracks -1; trackIndex >= 0; trackIndex--) { setHeadingToTracked(trackIndex, trackList[trackIndex]->getRelAzimuth()); setPitchToTracked(trackIndex, trackList[trackIndex]->getElevation()); setDistanceToTracked(trackIndex, trackList[trackIndex]->getRange()); // do we have a live "target track"? (shootlist is 1-based) if (getTargetTrack()==MAX_TRACKS && (trackList[trackIndex]->getShootListIndex() == 1) && trackList[trackIndex]->getTarget()->isActive() ) { setTargetTrack(trackIndex); } setTracking(true); setNumTracks(nTracks); // hack to implement "missile warning" if (isIncomingMissile() == false) { // is this track a weapon, and if so, is it targeting me? Simulation::Player* target = trackList[trackIndex]->getTarget(); Simulation::Weapon* weapon = dynamic_cast<Simulation::Weapon*> (target); if (weapon!=nullptr && !weapon->isDead()) { Simulation::Player* wpntgt = weapon->getTargetPlayer(); if (wpntgt == airVehicle) { setIncomingMissile(true); } } } } } } const Simulation::OnboardComputer* oc = airVehicle->getOnboardComputer(); if (oc != nullptr) { const Simulation::TrackManager* rtm = oc->getTrackManagerByType(typeid(Simulation::RwrTrkMgr)); if(rtm !=nullptr) { Basic::safe_ptr<Simulation::Track> trackList[50]; unsigned int nTracks = rtm->getTrackList(trackList, 50); int newTracks = 0; for (unsigned int trackIndex = 0; trackIndex < nTracks; trackIndex++) { Simulation::Player* target = trackList[trackIndex]->getTarget(); bool alreadyTracked = false; for (unsigned int currTracks = 0; currTracks>getNumTracks(); currTracks++) { // tracks are the same if the associated players are the same if(trackList[currTracks]->getTarget()==target) { alreadyTracked = true; break; } } if (!alreadyTracked && (getNumTracks() + newTracks) < MAX_TRACKS) { int newTrackIndex = getNumTracks() + newTracks; newTracks++; setHeadingToTracked(newTrackIndex, trackList[trackIndex]->getRelAzimuth()); setPitchToTracked(newTrackIndex, trackList[trackIndex]->getElevation()); setDistanceToTracked(newTrackIndex, trackList[trackIndex]->getRange()); setTracking(true); // update numTracks to new sum of radar + rwr tracks setNumTracks(getNumTracks()+newTracks); } // do we have a live "target track"? (shootlist is 1-based) if (getTargetTrack()==MAX_TRACKS && (trackList[trackIndex]->getShootListIndex() == 1) && trackList[trackIndex]->getTarget()->isActive() ) { setTargetTrack(trackIndex); } // hack to implement "missile warning" if (isIncomingMissile() == false) { // is this track a weapon, and if so, is it targeting me? Simulation::Weapon* weapon = dynamic_cast<Simulation::Weapon*> (target); if (weapon!=nullptr && !weapon->isDead()) { Simulation::Player* wpntgt = weapon->getTargetPlayer(); if (wpntgt == airVehicle) { setIncomingMissile(true); } } } } } } } BaseClass::updateState(actor); }
SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static ) : QSlider( q, _parent ), b_classic( _static ) { isSliding = false; f_buffering = 1.0; mHandleOpacity = 1.0; chapters = NULL; mHandleLength = -1; // prepare some static colors QPalette p = palette(); QColor background = p.color( QPalette::Active, QPalette::Background ); tickpointForeground = p.color( QPalette::Active, QPalette::WindowText ); tickpointForeground.setHsv( tickpointForeground.hue(), ( background.saturation() + tickpointForeground.saturation() ) / 2, ( background.value() + tickpointForeground.value() ) / 2 ); // set the background color and gradient QColor backgroundBase( p.window().color() ); backgroundGradient.setColorAt( 0.0, backgroundBase.darker( 140 ) ); backgroundGradient.setColorAt( 1.0, backgroundBase ); // set the foreground color and gradient QColor foregroundBase( 50, 156, 255 ); foregroundGradient.setColorAt( 0.0, foregroundBase ); foregroundGradient.setColorAt( 1.0, foregroundBase.darker( 140 ) ); // prepare the handle's gradient handleGradient.setColorAt( 0.0, p.window().color().lighter( 120 ) ); handleGradient.setColorAt( 0.9, p.window().color().darker( 120 ) ); // prepare the handle's shadow gradient QColor shadowBase = p.shadow().color(); if( shadowBase.lightness() > 100 ) shadowBase = QColor( 60, 60, 60 ); // Palette's shadow is too bright shadowDark = shadowBase.darker( 150 ); shadowLight = shadowBase.lighter( 180 ); shadowLight.setAlpha( 50 ); /* Timer used to fire intermediate updatePos() when sliding */ seekLimitTimer = new QTimer( this ); seekLimitTimer->setSingleShot( true ); /* Tooltip bubble */ mTimeTooltip = new TimeTooltip( this ); mTimeTooltip->setMouseTracking( true ); /* Properties */ setRange( MINIMUM, MAXIMUM ); setSingleStep( 2 ); setPageStep( 10 ); setMouseTracking( true ); setTracking( true ); setFocusPolicy( Qt::NoFocus ); /* Use the new/classic style */ if( !b_classic ) setStyle( new SeekStyle ); /* Init to 0 */ setPosition( -1.0, 0, 0 ); secstotimestr( psz_length, 0 ); animHandle = new QPropertyAnimation( this, "handleOpacity", this ); animHandle->setDuration( FADEDURATION ); animHandle->setStartValue( 0.0 ); animHandle->setEndValue( 1.0 ); hideHandleTimer = new QTimer( this ); hideHandleTimer->setSingleShot( true ); hideHandleTimer->setInterval( FADEOUTDELAY ); CONNECT( this, sliderMoved( int ), this, startSeekTimer() ); CONNECT( seekLimitTimer, timeout(), this, updatePos() ); CONNECT( hideHandleTimer, timeout(), this, hideHandle() ); mTimeTooltip->installEventFilter( this ); }
int QAbstractSlider::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: valueChanged((*reinterpret_cast< int(*)>(_a[1]))); break; case 1: sliderPressed(); break; case 2: sliderMoved((*reinterpret_cast< int(*)>(_a[1]))); break; case 3: sliderReleased(); break; case 4: rangeChanged((*reinterpret_cast< int(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2]))); break; case 5: actionTriggered((*reinterpret_cast< int(*)>(_a[1]))); break; case 6: setValue((*reinterpret_cast< int(*)>(_a[1]))); break; case 7: setOrientation((*reinterpret_cast< Qt::Orientation(*)>(_a[1]))); break; } _id -= 8; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< int*>(_v) = minimum(); break; case 1: *reinterpret_cast< int*>(_v) = maximum(); break; case 2: *reinterpret_cast< int*>(_v) = singleStep(); break; case 3: *reinterpret_cast< int*>(_v) = pageStep(); break; case 4: *reinterpret_cast< int*>(_v) = value(); break; case 5: *reinterpret_cast< int*>(_v) = sliderPosition(); break; case 6: *reinterpret_cast< bool*>(_v) = hasTracking(); break; case 7: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break; case 8: *reinterpret_cast< bool*>(_v) = invertedAppearance(); break; case 9: *reinterpret_cast< bool*>(_v) = invertedControls(); break; case 10: *reinterpret_cast< bool*>(_v) = isSliderDown(); break; } _id -= 11; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setMinimum(*reinterpret_cast< int*>(_v)); break; case 1: setMaximum(*reinterpret_cast< int*>(_v)); break; case 2: setSingleStep(*reinterpret_cast< int*>(_v)); break; case 3: setPageStep(*reinterpret_cast< int*>(_v)); break; case 4: setValue(*reinterpret_cast< int*>(_v)); break; case 5: setSliderPosition(*reinterpret_cast< int*>(_v)); break; case 6: setTracking(*reinterpret_cast< bool*>(_v)); break; case 7: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break; case 8: setInvertedAppearance(*reinterpret_cast< bool*>(_v)); break; case 9: setInvertedControls(*reinterpret_cast< bool*>(_v)); break; case 10: setSliderDown(*reinterpret_cast< bool*>(_v)); break; } _id -= 11; } else if (_c == QMetaObject::ResetProperty) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 11; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 11; } #endif // QT_NO_PROPERTIES return _id; }
bool QDial::qt_property( int id, int f, QVariant* v) { switch ( id - staticMetaObject()->propertyOffset() ) { case 0: switch( f ) { case 0: setTracking(v->asBool()); break; case 1: *v = QVariant( this->tracking(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 1: switch( f ) { case 0: setWrapping(v->asBool()); break; case 1: *v = QVariant( this->wrapping(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 2: switch( f ) { case 1: *v = QVariant( this->notchSize() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 3: switch( f ) { case 0: setNotchTarget(v->asDouble()); break; case 1: *v = QVariant( this->notchTarget() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 4: switch( f ) { case 0: setNotchesVisible(v->asBool()); break; case 1: *v = QVariant( this->notchesVisible(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 5: switch( f ) { case 0: setMinValue(v->asInt()); break; case 1: *v = QVariant( this->minValue() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 6: switch( f ) { case 0: setMaxValue(v->asInt()); break; case 1: *v = QVariant( this->maxValue() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 7: switch( f ) { case 0: setLineStep(v->asInt()); break; case 1: *v = QVariant( this->lineStep() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 8: switch( f ) { case 0: setPageStep(v->asInt()); break; case 1: *v = QVariant( this->pageStep() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 9: switch( f ) { case 0: setValue(v->asInt()); break; case 1: *v = QVariant( this->value() ); break; case 3: case 4: case 5: break; default: return FALSE; } break; default: return QWidget::qt_property( id, f, v ); } return TRUE; }
bool Slider::onPropertyChanged(const QString& name, const QVariant& val) { if ( VtlWidget::onPropertyChanged(name, val) ) return TRUE; VtlActionHandler* actHandler = ((VtlWindow*)this->parentWidget())->actionHandler(); if (name == (QString) "PROCNAME") { processName = val.toString(); } else if (name == (QString) "ORIENTATION") { actHandler->setProperty(this, name, QVariant(orientation), val); setOrientation(val.toInt()); } else if (name == (QString) "MINVALUE") { actHandler->setProperty(this, name, QVariant(minValue), val); setMinValue(val.toDouble()); } else if (name == (QString) "MAXVALUE") { actHandler->setProperty(this, name, QVariant(maxValue), val); setMaxValue(val.toDouble()); } else if (name == (QString) "DIRECTION") { actHandler->setProperty(this, name, QVariant(direction), val); setDirection(val.toInt()); } else if (name == (QString )"SOURCER") { if ( val.toString() != "None" ) { _sourcer = SourcerConnector<VtlWidget>::change (this, _sourcer, val.toString() ); } else _sourcer = 0; } else if (name == (QString) "TRACKING") { actHandler->setProperty(this, name, QVariant(tracking), val); setTracking(val.toInt()); } else if (name == (QString) "TICKMARKS") { actHandler->setProperty(this, name, QVariant(tickmarks), val); setTickmarks(val.toInt()); } else if (name == (QString) "TICKINTERVAL") { actHandler->setProperty(this, name, QVariant(tickInterval), val); setTickInterval(val.toInt()); } else if (name == (QString) "LINESTEP") { actHandler->setProperty(this, name, QVariant(lineStep), val); setLineStep(val.toDouble()); } else if (name == (QString) "PAGESTEP") { actHandler->setProperty(this, name, QVariant(pageStep), val); setPageStep(val.toInt()); } else if (name == (QString) "MAIN_COLOR") { actHandler->setProperty(this, name, QVariant(mainColor), val); setMainColor(val.toColor()); } else if (name == (QString) "TICKMARKS_COLOR") { actHandler->setProperty(this, name, QVariant(tickmarksColor), val); setTickmarksColor(val.toColor()); } else if (name == (QString) "PRECISION") { actHandler->setProperty(this, name, QVariant(precision), val); setPrecision(val.toInt()); } repaint(); return TRUE; }