50 #ifndef HELPERCLASSES_HH_INCLUDED
51 #define HELPERCLASSES_HH_INCLUDED
56 #include <QPushButton>
57 #include <QGridLayout>
64 QAction(_icon, _description, _parent),
66 objectTypeRestriction_(_objectTypeRestriction) {}
73 QString selectionEnvironmentHandle() {
return selectionEnvHandle_; }
77 QString selectionModeHandle() {
return selectionModeHandle_; }
80 void addAssociatedType(
unsigned int _associatedType) { associatedTypes_ |= _associatedType; }
81 void removeAssociatedType(
unsigned int _associatedType) { associatedTypes_ &= ~_associatedType; }
82 bool isAssociated(
unsigned int _type,
bool _associatedWithAll =
false) {
84 if(_associatedWithAll && _type != 0u)
85 return ((associatedTypes_ | _type) == associatedTypes_);
87 return ((associatedTypes_ & _type) != 0);
90 void objectTypeRestriction(
const DataType& _type) {
91 objectTypeRestriction_ = _type;
94 const DataType& objectTypeRestriction()
const {
95 return objectTypeRestriction_;
99 QString selectionEnvHandle_;
100 QString selectionModeHandle_;
102 unsigned int associatedTypes_;
112 QAction(_icon, _description, _parent),
114 selectionEnvironmentHandle_(
"")
122 unsigned int primitiveType() {
return primitiveType_; }
126 selectionEnvironmentHandle_ = _handle;
128 QString selectionEnvironmentHandle()
const {
129 return selectionEnvironmentHandle_;
133 unsigned int primitiveType_;
134 QString selectionEnvironmentHandle_;
143 QPushButton(_parent), action_(_action) {
146 setIcon(action_->icon());
147 setIconSize(QSize(48,48));
148 setToolTip(action_->text());
150 connect(action_, SIGNAL(toggled(
bool)),
this, SLOT(setChecked(
bool)));
151 connect(
this, SIGNAL(toggled(
bool)), action_, SLOT(setChecked(
bool)));
160 void setChecked(
bool _checked) {
162 QPushButton::setChecked(_checked);
166 void changeRegistered() {
167 setChecked(action_->isChecked());
181 numColumns_(_numColumns) {};
183 void addWidget(QWidget* _widget) {
185 QGridLayout::addWidget(_widget, currentRow_, currentColumn_);
188 if(currentColumn_ == numColumns_) {
195 unsigned int currentRow_;
196 unsigned int currentColumn_;
197 unsigned int numColumns_;
200 #endif // HELPERCLASSES_HH_INCLUDED
~PrimitiveAction()
Default destructor.
void selectionEnvironmentHandle(QString _handle)
Get/Set selection environment handle name.
void addAssociatedType(unsigned int _associatedType)
Get/Set associated primitive types.
~HandleAction()
Default destructor.
ActionButton(QAction *_action, QWidget *_parent=0)
Default constructor.
void selectionEnvironmentHandle(const QString _handle)
Get/Set associated selection environment handle.
PrimitiveAction(QIcon _icon, QString _description, QObject *_parent=0)
Default constructor.
void selectionModeHandle(QString _handle)
Get/Set selection mode handle name.
HandleAction(QIcon _icon, QString _description, QObject *_parent=0, DataType _objectTypeRestriction=DATA_ALL)
Default constructor.
const DataType DATA_ALL(UINT_MAX)
Identifier for all available objects.
~ActionButton()
Default destructor.
void primitiveType(unsigned int _type)
Get/Set primitive type.
FillingLayout(int _numColumns)
Default Constructor.