Commit 878abe61 authored by Marco Bubke's avatar Marco Bubke
Browse files

QmlDesigner: Add ItemLibraryEntry to ItemLibraryItem



Change-Id: I896e54fada0368fb548b39b9aff9cd19953c8ab3
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent 0f61929c
......@@ -90,4 +90,14 @@ bool ItemLibraryItem::isVisible() const
{
return m_isVisible;
}
void ItemLibraryItem::setItemLibraryEntry(const ItemLibraryEntry &itemLibraryEntry)
{
m_itemLibraryEntry = itemLibraryEntry;
}
ItemLibraryEntry ItemLibraryItem::itemLibraryEntry() const
{
return m_itemLibraryEntry;
}
} // namespace QmlDesigner
......@@ -35,6 +35,8 @@
#include <QSize>
#include <QVariant>
#include "itemlibraryinfo.h"
namespace QmlDesigner {
class ItemLibraryItem: public QObject {
......@@ -42,6 +44,7 @@ class ItemLibraryItem: public QObject {
Q_OBJECT
Q_PROPERTY(int itemLibId READ itemLibId FINAL)
Q_PROPERTY(ItemLibraryEntry itemLibraryEntry READ itemLibraryEntry FINAL)
Q_PROPERTY(QString itemName READ itemName FINAL)
Q_PROPERTY(QString itemLibraryIconPath READ itemLibraryIconPath FINAL)
Q_PROPERTY(QVariant sortingRole READ sortingRole FINAL)
......@@ -61,7 +64,11 @@ public:
bool setVisible(bool isVisible);
bool isVisible() const;
void setItemLibraryEntry(const ItemLibraryEntry &itemLibraryEntry);
ItemLibraryEntry itemLibraryEntry() const;
private:
ItemLibraryEntry m_itemLibraryEntry;
int m_libId;
bool m_isVisible;
QString m_name;
......
......@@ -194,6 +194,7 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
itemModel->setItemIconPath(entry.libraryEntryIconPath());
itemModel->setItemIconSize(m_itemIconSize);
itemModel->setItemLibraryEntry(entry);
sectionModel->addSectionEntry(itemModel);
m_sections.insert(itemId, sectionId);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment