Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef XMLEDITOR_H
00029 #define XMLEDITOR_H
00030
00031 #include <QtGui>
00032 #include "QGpGuiToolsDLLExport.h"
00033 #include "XMLItem.h"
00034
00035 namespace QGpGuiTools {
00036
00037 class XMLEditorDelegate : public QItemDelegate
00038 {
00039 Q_OBJECT
00040 public:
00041 XMLEditorDelegate(QObject *parent=0) : QItemDelegate(parent) {}
00042
00043 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00044 const QModelIndex &index) const;
00045 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00046 void setModelData(QWidget *editor, QAbstractItemModel *model,
00047 const QModelIndex &index) const;
00048 };
00049
00050 class QGPGUITOOLS_EXPORT XMLEditor : public QTreeView
00051 {
00052 Q_OBJECT
00053 public:
00054 XMLEditor(QWidget * parent=0);
00055 ~XMLEditor();
00056
00057 XMLItem * model() const;
00058 private slots:
00059 virtual void contextMenuEvent(QContextMenuEvent * e);
00060 void excludeSelectedItems();
00061 void includeSelectedItems();
00062 void includeChanged(const QModelIndex& index);
00063 protected:
00064 void setEnabled(bool e, QList<XMLGenericItem *> itemList);
00065 private:
00066 QMenu * _menu;
00067 };
00068
00069 }
00070
00071 #endif // XMLEDITOR_H