diff options
Diffstat (limited to 'src/qt/guiutil.h')
-rw-r--r-- | src/qt/guiutil.h | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index e965a91d18..011827e134 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011-2017 The Bitcoin Core developers +// Copyright (c) 2011-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -10,6 +10,7 @@ #include <QEvent> #include <QHeaderView> +#include <QItemDelegate> #include <QMessageBox> #include <QObject> #include <QProgressBar> @@ -120,9 +121,6 @@ namespace GUIUtil // Open the config file bool openBitcoinConf(); - // Replace invalid default fonts with known good ones - void SubstituteFonts(const QString& language); - /** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text representation if needed. This assures that Qt can word-wrap long tooltip messages. Tooltips longer than the provided size threshold (in characters) are wrapped. @@ -219,11 +217,11 @@ namespace GUIUtil protected: void mouseReleaseEvent(QMouseEvent *event); }; - + class ClickableProgressBar : public QProgressBar { Q_OBJECT - + Q_SIGNALS: /** Emitted when the progressbar is clicked. The relative mouse coordinates of the click are * passed to the signal. @@ -233,20 +231,20 @@ namespace GUIUtil void mouseReleaseEvent(QMouseEvent *event); }; -#if defined(Q_OS_MAC) - // workaround for Qt OSX Bug: - // https://bugreports.qt-project.org/browse/QTBUG-15631 - // QProgressBar uses around 10% CPU even when app is in background - class ProgressBar : public ClickableProgressBar - { - bool event(QEvent *e) { - return (e->type() != QEvent::StyleAnimationUpdate) ? QProgressBar::event(e) : false; - } - }; -#else typedef ClickableProgressBar ProgressBar; -#endif + class ItemDelegate : public QItemDelegate + { + Q_OBJECT + public: + ItemDelegate(QObject* parent) : QItemDelegate(parent) {} + + Q_SIGNALS: + void keyEscapePressed(); + + private: + bool eventFilter(QObject *object, QEvent *event); + }; } // namespace GUIUtil #endif // BITCOIN_QT_GUIUTIL_H |