mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-02 00:16:04 +00:00
some optimizations
This commit is contained in:
@ -50,7 +50,15 @@ public:
|
||||
qCDebug(LOG_LIB);
|
||||
|
||||
m_items.clear();
|
||||
}
|
||||
m_activeItems.clear();
|
||||
};
|
||||
|
||||
QList<T *> activeItems()
|
||||
{
|
||||
qCDebug(LOG_LIB);
|
||||
|
||||
return m_activeItems;
|
||||
};
|
||||
|
||||
void editItems()
|
||||
{
|
||||
@ -61,14 +69,6 @@ public:
|
||||
qCInfo(LOG_LIB) << "Dialog returns" << ret;
|
||||
};
|
||||
|
||||
void initItems()
|
||||
{
|
||||
qCDebug(LOG_LIB);
|
||||
|
||||
m_items.clear();
|
||||
m_items = getItems();
|
||||
};
|
||||
|
||||
T *itemByTag(const QString _tag) const
|
||||
{
|
||||
qCDebug(LOG_LIB);
|
||||
@ -84,7 +84,7 @@ public:
|
||||
qCWarning(LOG_LIB) << "Could not find item by tag" << _tag;
|
||||
|
||||
return found;
|
||||
}
|
||||
};
|
||||
|
||||
T *itemByTagNumber(const int _number) const
|
||||
{
|
||||
@ -101,7 +101,7 @@ public:
|
||||
qCWarning(LOG_LIB) << "Could not find item by number" << _number;
|
||||
|
||||
return found;
|
||||
}
|
||||
};
|
||||
|
||||
T *itemFromWidget() const
|
||||
{
|
||||
@ -143,6 +143,7 @@ public:
|
||||
|
||||
private:
|
||||
QList<T *> m_items;
|
||||
QList<T *> m_activeItems;
|
||||
QString m_type;
|
||||
|
||||
// init method
|
||||
@ -181,6 +182,18 @@ private:
|
||||
return items;
|
||||
};
|
||||
|
||||
void initItems()
|
||||
{
|
||||
qCDebug(LOG_LIB);
|
||||
|
||||
m_items.clear();
|
||||
m_activeItems.clear();
|
||||
|
||||
m_items = getItems();
|
||||
foreach(T *item, m_items)
|
||||
if (item->isActive()) m_activeItems.append(item);
|
||||
};
|
||||
|
||||
void repaint()
|
||||
{
|
||||
qCDebug(LOG_LIB);
|
||||
|
Reference in New Issue
Block a user