mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +08:00
refs #617, CActionItem supports icon
* standard paths for applications * support for Qt::DecorationRole * QMap<QString, QPixmap> m_availableActions * Constructor for icon only * only leafs support actions
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6a96d14baa
commit
a34be02e07
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <QList>
|
||||
#include <QString>
|
||||
#include <QPixmap>
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
@@ -26,6 +27,9 @@ namespace BlackGui
|
||||
//! Constructor
|
||||
CActionItem(const QString &action, const QString &name, CActionItem *parentItem = nullptr);
|
||||
|
||||
//! Constructor
|
||||
CActionItem(const QString &action, const QString &name, const QPixmap &icon, CActionItem *parentItem = nullptr);
|
||||
|
||||
//! Destructor
|
||||
~CActionItem();
|
||||
|
||||
@@ -41,6 +45,12 @@ namespace BlackGui
|
||||
//! Number of children
|
||||
int getChildCount() const;
|
||||
|
||||
//! Icon
|
||||
const QPixmap &getIcon() const { return m_icon; }
|
||||
|
||||
//! Set icon
|
||||
void setIcon(const QPixmap &icon) { m_icon = icon; }
|
||||
|
||||
//! Has children?
|
||||
bool hasChildren() const;
|
||||
|
||||
@@ -60,9 +70,10 @@ namespace BlackGui
|
||||
CActionItem *getParentItem() const;
|
||||
|
||||
private:
|
||||
QList<CActionItem *> m_childItems;
|
||||
QString m_action;
|
||||
QString m_actionName;
|
||||
QPixmap m_icon;
|
||||
QList<CActionItem *> m_childItems;
|
||||
CActionItem *m_parentItem = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user