void CheckBox::setUndefined(bool tristate = true) { this->blockSignals(true); if (tristate) { itsPreviousCheckState = checkState(); setTristate(true); } else { setTristate(false); setChecked(itsPreviousCheckState); } this->blockSignals(false); }
void CheckBox::setChecked(bool checked) { this->blockSignals(true); setTristate(false); QCheckBox::setChecked(checked); itsPreviousCheckState = checkState(); this->blockSignals(false); }
bool QCheckBox::qt_property( int id, int f, QVariant* v) { switch ( id - staticMetaObject()->propertyOffset() ) { case 0: switch( f ) { case 0: setChecked(v->asBool()); break; case 1: *v = QVariant( this->isChecked(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 1: switch( f ) { case 0: setTristate(v->asBool()); break; case 1: *v = QVariant( this->isTristate(), 0 ); break; case 3: case 4: case 5: break; default: return FALSE; } break; case 2: switch( f ) { case 0: case 1: case 5: goto resolve; case 3: case 4: break; default: return FALSE; } break; default: return QButton::qt_property( id, f, v ); } return TRUE; resolve: return QButton::qt_property( staticMetaObject()->resolveProperty(id), f, v ); }
void QmitkBoolPropertyWidget::SetProperty(mitk::BoolProperty *property) { if (m_PropEditorImpl) { delete m_PropEditorImpl; m_PropEditorImpl = nullptr; } if (!property) { setTristate(true); setCheckState(Qt::PartiallyChecked); setEnabled(false); return; } setEnabled(true); m_PropEditorImpl = new _BoolPropertyWidgetImpl(property, this); m_PropEditorImpl->PropertyChanged(); }
caToggleButton::caToggleButton(QWidget *parent) : QCheckBox(parent), FontScalingWidget(this) { setCheckable(true); setTristate(true); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); thisPalette = palette(); thisBackColor = defaultBackColor = QColor(200,200,200,0); thisForeColor = defaultForeColor = Qt::black; thisColorMode=Static; setBackground(defaultBackColor); setForeground(defaultForeColor); installEventFilter(this); connect(this, SIGNAL(clicked()), this, SLOT(buttonToggled()) ); setTrueValue("1"); setFalseValue("0"); setAccessW(true); setFontScaleMode(WidthAndHeight); }
MenuCheckBox::MenuCheckBox(const QString& name, QWidget *parent) : QCheckBox(name, parent) { setTristate(1); }