summaryrefslogtreecommitdiff
path: root/src/plugins/coreplugin/infobar.h
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-09-03 10:34:52 +0200
committerhjk <hjk121@nokiamail.com>2014-09-04 10:23:03 +0200
commitf70ba9930eacdb91e31e8b1f2f4f57afee2aac80 (patch)
tree29896d0ba5dd422979ec36aff6ba42413eb4c41f /src/plugins/coreplugin/infobar.h
parent2e17339b05028dee540cc6da6a481229e98224be (diff)
downloadqt-creator-f70ba9930eacdb91e31e8b1f2f4f57afee2aac80.tar.gz
Core: Use std::function for info bar callbacks
Change-Id: Iae7cbef053bfe86a7692e09f66af91117815d2a6 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/plugins/coreplugin/infobar.h')
-rw-r--r--src/plugins/coreplugin/infobar.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/coreplugin/infobar.h b/src/plugins/coreplugin/infobar.h
index 78bd7768bf..bacd8add96 100644
--- a/src/plugins/coreplugin/infobar.h
+++ b/src/plugins/coreplugin/infobar.h
@@ -36,6 +36,8 @@
#include <QObject>
#include <QSet>
+#include <functional>
+
QT_BEGIN_NAMESPACE
class QBoxLayout;
QT_END_NAMESPACE
@@ -56,19 +58,19 @@ public:
InfoBarEntry(Id _id, const QString &_infoText, GlobalSuppressionMode _globalSuppression = GlobalSuppressionDisabled);
InfoBarEntry(const InfoBarEntry &other) { *this = other; }
- void setCustomButtonInfo(const QString &_buttonText, QObject *_object, const char *_member);
- void setCancelButtonInfo(QObject *_object, const char *_member);
- void setCancelButtonInfo(const QString &_cancelButtonText, QObject *_object, const char *_member);
+
+ typedef std::function<void()> CallBack;
+ void setCustomButtonInfo(const QString &_buttonText, CallBack callBack);
+ void setCancelButtonInfo(CallBack callBack);
+ void setCancelButtonInfo(const QString &_cancelButtonText, CallBack callBack);
private:
Id id;
QString infoText;
QString buttonText;
- QObject *object;
- const char *buttonPressMember;
+ CallBack m_buttonCallBack;
QString cancelButtonText;
- QObject *cancelObject;
- const char *cancelButtonPressMember;
+ CallBack m_cancelButtonCallBack;
GlobalSuppressionMode globalSuppression;
friend class InfoBar;
friend class InfoBarDisplay;