Browse Source

ToolStripAction: add some new features

QGC4.4
davidsastresas 1 year ago committed by Julian Oes
parent
commit
e01a83f9da
No known key found for this signature in database
GPG Key ID: F0ED380FEA56DE41
  1. 36
      src/QmlControls/ToolStripAction.cc
  2. 20
      src/QmlControls/ToolStripAction.h

36
src/QmlControls/ToolStripAction.cc

@ -59,6 +59,42 @@ void ToolStripAction::setShowAlternateIcon(bool showAlternateIcon) @@ -59,6 +59,42 @@ void ToolStripAction::setShowAlternateIcon(bool showAlternateIcon)
}
void ToolStripAction::setbiColorIcon(bool biColorIcon)
{
if (biColorIcon != _biColorIcon) {
_biColorIcon = biColorIcon;
emit biColorIconChanged(biColorIcon);
}
}
void ToolStripAction::setfullColorIcon(bool fullColorIcon)
{
if (fullColorIcon != _fullColorIcon) {
_fullColorIcon = fullColorIcon;
emit fullColorIconChanged(fullColorIcon);
}
}
void ToolStripAction::setNonExclusive(bool nonExclusive)
{
if (nonExclusive != _nonExclusive) {
_nonExclusive = nonExclusive;
emit nonExclusiveChanged(nonExclusive);
}
}
void ToolStripAction::setToolStripIndex(int toolStripIndex)
{
if (toolStripIndex != _toolStripIndex) {
_toolStripIndex = toolStripIndex;
emit toolStripIndexChanged(toolStripIndex);
}
}
void ToolStripAction::setText(const QString& text)
{
if (text != _text) {

20
src/QmlControls/ToolStripAction.h

@ -25,6 +25,10 @@ public: @@ -25,6 +25,10 @@ public:
Q_PROPERTY(bool checkable READ checkable WRITE setCheckable NOTIFY checkableChanged)
Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY checkedChanged)
Q_PROPERTY(bool showAlternateIcon READ showAlternateIcon WRITE setShowAlternateIcon NOTIFY showAlternateIconChanged)
Q_PROPERTY(bool biColorIcon READ biColorIcon WRITE setbiColorIcon NOTIFY biColorIconChanged)
Q_PROPERTY(bool fullColorIcon READ fullColorIcon WRITE setfullColorIcon NOTIFY fullColorIconChanged)
Q_PROPERTY(bool nonExclusive READ nonExclusive WRITE setNonExclusive NOTIFY nonExclusiveChanged)
Q_PROPERTY(int toolStripIndex READ toolStripIndex WRITE setToolStripIndex NOTIFY toolStripIndexChanged)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QString iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged)
Q_PROPERTY(QString alternateIconSource READ alternateIconSource WRITE setAlternateIconSource NOTIFY alternateIconSourceChanged)
@ -35,6 +39,10 @@ public: @@ -35,6 +39,10 @@ public:
bool checkable (void) const { return _checkable; }
bool checked (void) const { return _checked; }
bool showAlternateIcon (void) const { return _showAlternateIcon; }
bool biColorIcon (void) const { return _biColorIcon; }
bool fullColorIcon (void) const { return _fullColorIcon; }
bool nonExclusive (void) const { return _nonExclusive; }
int toolStripIndex (void) const { return _toolStripIndex; }
QString text (void) const { return _text; }
QString iconSource (void) const { return _iconSource; }
QString alternateIconSource (void) const { return _alternateIconSource; }
@ -45,6 +53,10 @@ public: @@ -45,6 +53,10 @@ public:
void setCheckable (bool checkable);
void setChecked (bool checked);
void setShowAlternateIcon (bool showAlternateIcon);
void setbiColorIcon (bool biColorIcon);
void setfullColorIcon (bool fullColorIcon);
void setNonExclusive (bool nonExclusive);
void setToolStripIndex (int toolStripIndex);
void setText (const QString& text);
void setIconSource (const QString& iconSource);
void setAlternateIconSource (const QString& alternateIconSource);
@ -56,6 +68,10 @@ signals: @@ -56,6 +68,10 @@ signals:
void checkableChanged (bool checkable);
void checkedChanged (bool checked);
void showAlternateIconChanged (bool showAlternateIcon);
void biColorIconChanged (bool biColorIcon);
void fullColorIconChanged (bool fullColorIcon);
void nonExclusiveChanged (bool nonExclusive);
void toolStripIndexChanged (int toolStripIndex);
void textChanged (QString text);
void iconSourceChanged (QString iconSource);
void alternateIconSourceChanged (QString alternateIconSource);
@ -68,6 +84,10 @@ protected: @@ -68,6 +84,10 @@ protected:
bool _checkable = false;
bool _checked = false;
bool _showAlternateIcon = false;
bool _biColorIcon = false;
bool _fullColorIcon = false;
bool _nonExclusive = false;
int _toolStripIndex = -1;
QString _text;
QString _iconSource;
QString _alternateIconSource;

Loading…
Cancel
Save