class QTreeWidget;
class QTreeWidgetItem;
class ParametersPlugin_ItemDelegate;
+class QPushButton;
+class QToolButton;
/*!
* \ingroup GUI
protected:
/// Saves the internal parameters to the given feature
/// \return True in success
- virtual bool storeValueCustom() const;
+ virtual bool storeValueCustom();
/// Restore value from attribute data to the widget's control
virtual bool restoreValueCustom();
virtual void activateCustom();
private slots:
- void onDoubleClick(const QModelIndex&);
+ /// Slot for reaction on double click in the table (start editing)
+ /// \param theIndex the clicked index
+ void onDoubleClick(const QModelIndex& theIndex);
+
+ /// Slot for reaction on end of cell editing
+ /// \param theEditor the editor widget
+ /// \param theHint end of edit type
void onCloseEditor(QWidget* theEditor, QAbstractItemDelegate::EndEditHint theHint);
+ /// Slot for reaction on add parameter
+ void onAdd();
+
+ /// Slot for reaction on insert parameter
+ void onInsert();
+
+ /// Slot for reaction on remove parameter
+ void onRemove();
+
+ /// Slot for reaction on shift up
+ void onUp();
+
+ /// Slot for reaction on shift down
+ void onDown();
+
+ /// Slot to show message on closing of editor
+ void sendWarning();
+
+ /// Slot for reaction on selection in the table
+ void onSelectionChanged();
+
private:
+ /// Creates a new parameter feature
+ FeaturePtr createParameter() const;
+
+ /// Creates a new item
+ QTreeWidgetItem* createNewItem() const;
+
+ /// Returns currently selected item
+ QTreeWidgetItem* selectedItem() const;
+
+ /// Select the given Item and scroll the table to make it visible
+ void selectItemScroll(QTreeWidgetItem* aItem);
+
+ /// Update values in features part
+ void updateFeaturesPart();
+
+ /// Returns true if parameter with the given name already exists
+ bool hasName(const QString& theName) const;
+
+ QList<QStringList> featuresItems(const QList<FeaturePtr>& theFeatures) const;
QTreeWidget* myTable;
QTreeWidgetItem* myFeatures;
ParametersPlugin_ItemDelegate* myDelegate;
QModelIndex myEditingIndex;
- QList<FeaturePtr> myFeatureList;
+ QList<FeaturePtr> myParametersList;
+
+ QString myMessage;
+
+ QPushButton* myAddBtn;
+ QPushButton* myInsertBtn;
+ QPushButton* myRemoveBtn;
+ QToolButton* myUpBtn;
+ QToolButton* myDownBtn;
};