void KnobGuiButton::createWidget(QHBoxLayout* layout) { KnobGuiPtr knobUI = getKnobGui(); KnobButtonPtr knob = _knob.lock(); _button = new Button( layout->parentWidget() ); if (knobUI->getLayoutType() == KnobGui::eKnobLayoutTypeTableItemWidget) { _button->setIconSize( QSize(TO_DPIX(NATRON_SMALL_BUTTON_ICON_SIZE), TO_DPIY(NATRON_SMALL_BUTTON_ICON_SIZE)) ); } else { _button->setIconSize( QSize(TO_DPIX(NATRON_MEDIUM_BUTTON_ICON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_ICON_SIZE)) ); } loadPixmaps(false, QColor()); if (!_button->icon().isNull()) { _button->setFixedSize(TO_DPIX(NATRON_MEDIUM_BUTTON_SIZE), TO_DPIY(NATRON_MEDIUM_BUTTON_SIZE)); } bool checkable = knob->getIsCheckable(); if (checkable) { _button->setCheckable(true); bool checked = knob->getValue(); _button->setChecked(checked); _button->setDown(checked); } QObject::connect( _button, SIGNAL(clicked(bool)), this, SLOT(emitValueChanged(bool)) ); if ( knobUI->hasToolTip() ) { knobUI->toolTip(_button, getView()); } layout->addWidget(_button); } // KnobGuiButton::createWidget
void KnobGuiBool::updateToolTip() { KnobGuiPtr knob = getKnobGui(); if ( knob->hasToolTip() ) { for (int i = 0; i < _knob.lock()->getNDimensions(); ++i) { knob->toolTip(_checkBox, getView()); } } }
void KnobGuiBool::updateToolTip() { KnobGuiPtr knobgui = getKnobGui(); if ( knobgui->hasToolTip() ) { KnobBoolPtr knob = _knob.lock(); if (!knob) { return; } knobgui->toolTip(_checkBox, getView()); } }
void KnobGuiGroup::createWidget(QHBoxLayout* layout) { _button = new GroupBoxLabel( layout->parentWidget() ); KnobGuiPtr knobUI = getKnobGui(); if ( knobUI->hasToolTip() ) { knobUI->toolTip(_button, getView()); } _checked = _knob.lock()->getValue(DimIdx(0), getView()); _button->setFixedSize(NATRON_MEDIUM_BUTTON_SIZE, NATRON_MEDIUM_BUTTON_SIZE); _button->setChecked(_checked); QObject::connect( _button, SIGNAL(checked(bool)), this, SLOT(onCheckboxChecked(bool)) ); layout->addWidget(_button); }