Base class for a group of check boxes. More...
#include <exporter.h>
Public Member Functions | |
ComboBoxGroup (const QString &title, QWidget *parent=0) | |
CheckBox * | addComboBox (const QString &title, const QVariant &data=QVariant()) |
void | setAutoExclusive (bool exclude) |
CheckBox * | currentChecked () |
virtual void | setStandardDelimiters () |
Protected Slots | |
void | onDelimiterClick () |
Base class for a group of check boxes.
: QGroupBox(title, parent), autoExclude(false), lastChecked(0) { QVBoxLayout *dLayout = new QVBoxLayout; setLayout(dLayout); }
Referenced by DelimiterGroup::setStandardDelimiters(), and SplitOnGroup::setStandardDelimiters().
CheckBox * ComboBoxGroup::currentChecked | ( | ) |
{ Q_ASSERT(autoExclude); // Seek foreach(CheckBox *box, boxContainer) if (box->isChecked()) return box; // Default return 0; }
void ComboBoxGroup::onDelimiterClick | ( | ) | [protected, slot] |
Referenced by addComboBox().
{ // update lastChecked CheckBox *box = dynamic_cast<CheckBox*>(sender()); if (box) lastChecked = box; // Dit is de autoExclusive implementatie. Men kon het ook anders doen door op // alle checkboxen setAutoExclusive() te zetten, maar probleem dan is dat eens één // checkbox checked is, er minstens een checked moet (!) blijven. Volgens deze // implementatie is dit niet het geval. if (box && autoExclude) foreach(CheckBox *box, boxContainer) if (box != sender()) box->setChecked(false); }
void ComboBoxGroup::setAutoExclusive | ( | bool | exclude | ) |
Referenced by Exporter::Exporter().
{ autoExclude = exclude; }
void ComboBoxGroup::setStandardDelimiters | ( | ) | [virtual] |
Reimplemented in SplitOnGroup, and DelimiterGroup.
{};