Originally Posted by
YuriyRusinov
Hello !
I subclassed QItemDelegate, QAbstractItemModel in order to build tree model and see data in QTreeView. Now I need to modify model data, do I have to subclass QTreeView or I can achive it using QTreeView ?
I tested to subclass the item :-( is not easy!
I found a way to make a xml file tree unlimited .... and on a simple class i manage
the domelement & QTreeWidgetItem & the level of tree....
each new Item i add on aa QList<OneTree*> niagaratree; xxx.additem(**) an so i can interact on 2 class... on add item remove rename ecc... on QDomElement you can save all data image html page e other ..on.. QDomElement like a oracle DB :-)....
to delete on item i save the Nr of tree ... and fast save the file xml + reload the GUI whitout the delete nr..item ...
Is moore simple way... and fast....
QList<OneTree*> niagaratree;
typedef QMap<QString, QString> Treevar;
class OneTree
: public QObject,
public Base_Function
{
Q_OBJECT
public:
...............
private:
.....
signals:
void SendtonewDom(int);
public slots:
void MoveToNewDest()
{
/////qDebug() << "### ONLISTER emit start " << ONLISTER;
emit SendtonewDom(ONLISTER);
}
};
QList<OneTree*> niagaratree;
typedef QMap<QString, QString> Treevar;
class QTreeWidget;
class QTreeWidgetItem;
class OneTree : public QObject, public Base_Function
{
Q_OBJECT
public:
OneTree( QDomElement d , QTreeWidgetItem * top , int lev );
...............
private:
.....
signals:
void SendtonewDom(int);
void SendtoParent(QString);
public slots:
void MoveToNewDest()
{
/////qDebug() << "### ONLISTER emit start " << ONLISTER;
emit SendtonewDom(ONLISTER);
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks