fixed missing tooltip update for toggle/mode-type buttons

loadfix
Marc Zinnschlag 10 years ago
parent 3b347e666b
commit d37ff8ec63

@ -72,6 +72,11 @@ CSVWidget::PushButton::PushButton (const QIcon& icon, Type type, const QString&
QWidget *parent) QWidget *parent)
: QPushButton (icon, "", parent), mKeepOpen (false), mType (type), mToolTip (tooltip) : QPushButton (icon, "", parent), mKeepOpen (false), mType (type), mToolTip (tooltip)
{ {
if (type==Type_Mode || type==Type_Toggle)
{
setCheckable (true);
connect (this, SIGNAL (toggled (bool)), this, SLOT (checkedStateChanged (bool)));
}
setCheckable (type==Type_Mode || type==Type_Toggle); setCheckable (type==Type_Mode || type==Type_Toggle);
setExtendedToolTip(); setExtendedToolTip();
} }
@ -96,4 +101,9 @@ QString CSVWidget::PushButton::getBaseToolTip() const
CSVWidget::PushButton::Type CSVWidget::PushButton::getType() const CSVWidget::PushButton::Type CSVWidget::PushButton::getType() const
{ {
return mType; return mType;
}
void CSVWidget::PushButton::checkedStateChanged (bool checked)
{
setExtendedToolTip();
} }

@ -53,6 +53,10 @@ namespace CSVWidget
QString getBaseToolTip() const; QString getBaseToolTip() const;
Type getType() const; Type getType() const;
private slots:
void checkedStateChanged (bool checked);
}; };
} }

Loading…
Cancel
Save