New elements panel : fix crash at drag and drop due to a wrong use of QAbstractItemModel

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4353 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-02-24 10:43:40 +00:00
parent 014f3c8f13
commit a35ce68d7a
5 changed files with 31 additions and 12 deletions

View File

@@ -31,8 +31,10 @@ class QList<ElementCollectionItem>;
* This class must be herited for specialisation.
* This item is used by ElementsCollectionModel for manage the elements collection
*/
class ElementCollectionItem
class ElementCollectionItem : public QObject
{
Q_OBJECT
public:
ElementCollectionItem(ElementCollectionItem *parent = nullptr);
virtual ~ElementCollectionItem();
@@ -72,6 +74,12 @@ class ElementCollectionItem
virtual bool canRemoveContent();
virtual bool removeContent();
signals:
void beginInsertRows(ElementCollectionItem *parent, int first, int last);
void endInsertRows();
void beginRemoveRows(ElementCollectionItem *parent, int first, int last);
void endRemoveRows();
protected:
ElementCollectionItem *m_parent_item;
QList <ElementCollectionItem *> m_child_items;