forked from qt-creator/qt-creator
QmlDesigner: Remove itemLibId in ItemLibraryItem
Change-Id: I0b7fc69b405f59b5f20fb453556eab0a1881f9eb Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
@@ -31,9 +31,8 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
ItemLibraryItem::ItemLibraryItem(int itemLibId, QObject *parent)
|
ItemLibraryItem::ItemLibraryItem(QObject *parent)
|
||||||
: QObject(parent),
|
: QObject(parent)
|
||||||
m_libId(itemLibId)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,12 +40,6 @@ ItemLibraryItem::~ItemLibraryItem()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int ItemLibraryItem::itemLibId() const
|
|
||||||
{
|
|
||||||
return m_libId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString ItemLibraryItem::itemName() const
|
QString ItemLibraryItem::itemName() const
|
||||||
{
|
{
|
||||||
return m_itemLibraryEntry.name();
|
return m_itemLibraryEntry.name();
|
||||||
|
@@ -43,17 +43,15 @@ class ItemLibraryItem: public QObject {
|
|||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(int itemLibId READ itemLibId FINAL)
|
|
||||||
Q_PROPERTY(QVariant itemLibraryEntry READ itemLibraryEntry FINAL)
|
Q_PROPERTY(QVariant itemLibraryEntry READ itemLibraryEntry FINAL)
|
||||||
Q_PROPERTY(QString itemName READ itemName FINAL)
|
Q_PROPERTY(QString itemName READ itemName FINAL)
|
||||||
Q_PROPERTY(QString itemLibraryIconPath READ itemLibraryIconPath FINAL)
|
Q_PROPERTY(QString itemLibraryIconPath READ itemLibraryIconPath FINAL)
|
||||||
Q_PROPERTY(QVariant sortingRole READ sortingRole FINAL)
|
Q_PROPERTY(QVariant sortingRole READ sortingRole FINAL)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ItemLibraryItem(int itemLibId, QObject *parent);
|
ItemLibraryItem(QObject *parent);
|
||||||
~ItemLibraryItem();
|
~ItemLibraryItem();
|
||||||
|
|
||||||
int itemLibId() const;
|
|
||||||
QString itemName() const;
|
QString itemName() const;
|
||||||
QString itemLibraryIconPath() const;
|
QString itemLibraryIconPath() const;
|
||||||
QVariant sortingRole() const;
|
QVariant sortingRole() const;
|
||||||
@@ -66,7 +64,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
ItemLibraryEntry m_itemLibraryEntry;
|
ItemLibraryEntry m_itemLibraryEntry;
|
||||||
int m_libId;
|
|
||||||
bool m_isVisible;
|
bool m_isVisible;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -179,7 +179,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
|
|||||||
|
|
||||||
m_itemInfos.insert(itemId, entry);
|
m_itemInfos.insert(itemId, entry);
|
||||||
|
|
||||||
itemModel = new ItemLibraryItem(itemId, sectionModel);
|
itemModel = new ItemLibraryItem(sectionModel);
|
||||||
itemModel->setItemLibraryEntry(entry);
|
itemModel->setItemLibraryEntry(entry);
|
||||||
sectionModel->addSectionEntry(itemModel);
|
sectionModel->addSectionEntry(itemModel);
|
||||||
m_sections.insert(itemId, sectionId);
|
m_sections.insert(itemId, sectionId);
|
||||||
|
Reference in New Issue
Block a user