51#include "objectSelectionWidget.hh"
52#include "objectPickDialog.hh"
70 QHBoxLayout *hL =
new QHBoxLayout;
72 combo_ =
new QComboBox ();
73 pickButton_ =
new QPushButton (tr(
"Pick Object"));
75 hL->addWidget (combo_);
76 hL->setStretchFactor (combo_, 1);
77 hL->addWidget (pickButton_);
79 if (_hints.contains (
"flags"))
80 flags_ = _hints[
"flags"].split(
',');
82 if (_hints.contains (
"types"))
83 types_ = _hints[
"types"].split(
',');
85 if (flags_.contains(
"all", Qt::CaseInsensitive))
88 withGroups_ = types_.contains(
"Group");
90 if (types_.contains(
"All"))
95 connect (pickButton_, SIGNAL (pressed()),
this, SLOT (showPickDialog ()));
100 if (!flags_.empty ())
103 foreach (QString flag, flags_)
104 if (o_it->flag (flag))
114 if (!types_.empty ())
116 if (!types_.contains (
typeName (o_it->dataType())))
120 if (o_it->isGroup() && !withGroups_)
125 combo_->addItem (o_it->name() +
" (" + QString::number (o_it->id ()) +
")", QVariant (o_it->id()));
132 pickButton_->setEnabled (
false);
133 combo_->setEnabled (
false);
138ObjectSelectionWidget::~ ObjectSelectionWidget()
141 o_it->setFlag(
"vsi_objectId_selected",
false);
147void ObjectSelectionWidget::showPickDialog()
150 d.selectedId (combo_->itemData (combo_->currentIndex()).toInt ());
152 if (d.exec () == QDialog::Accepted)
153 combo_->setCurrentIndex (combo_->findData (QVariant (d.selectedId())));
DLLEXPORT QString typeName(DataType _id)
Get the name of a type with given id.
Core Data Iterator used to iterate over all objects (Including groups)
DLLEXPORT BaseObjectIterator baseObjectsEnd()
Return Iterator to Object End.