Changeset View
Changeset View
Standalone View
Standalone View
src/qt/guiutil.h
Show First 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
class ToolTipToRichTextFilter : public QObject { | class ToolTipToRichTextFilter : public QObject { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); | explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0); | ||||
protected: | protected: | ||||
bool eventFilter(QObject *obj, QEvent *evt); | bool eventFilter(QObject *obj, QEvent *evt) override; | ||||
private: | private: | ||||
int size_threshold; | int size_threshold; | ||||
}; | }; | ||||
/** | /** | ||||
* Makes a QTableView last column feel as if it was being resized from its left | * Makes a QTableView last column feel as if it was being resized from its left | ||||
* border. | * border. | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
Q_SIGNALS: | Q_SIGNALS: | ||||
/** Emitted when the label is clicked. The relative mouse coordinates of the | /** Emitted when the label is clicked. The relative mouse coordinates of the | ||||
* click are passed to the signal. | * click are passed to the signal. | ||||
*/ | */ | ||||
void clicked(const QPoint &point); | void clicked(const QPoint &point); | ||||
protected: | protected: | ||||
void mouseReleaseEvent(QMouseEvent *event); | void mouseReleaseEvent(QMouseEvent *event) override; | ||||
}; | }; | ||||
class ClickableProgressBar : public QProgressBar { | class ClickableProgressBar : public QProgressBar { | ||||
Q_OBJECT | Q_OBJECT | ||||
Q_SIGNALS: | Q_SIGNALS: | ||||
/** Emitted when the progressbar is clicked. The relative mouse coordinates | /** Emitted when the progressbar is clicked. The relative mouse coordinates | ||||
* of the click are passed to the signal. | * of the click are passed to the signal. | ||||
*/ | */ | ||||
void clicked(const QPoint &point); | void clicked(const QPoint &point); | ||||
protected: | protected: | ||||
void mouseReleaseEvent(QMouseEvent *event); | void mouseReleaseEvent(QMouseEvent *event) override; | ||||
}; | }; | ||||
#if defined(Q_OS_MAC) && QT_VERSION >= 0x050000 | #if defined(Q_OS_MAC) && QT_VERSION >= 0x050000 | ||||
// workaround for Qt OSX Bug: | // workaround for Qt OSX Bug: | ||||
// https://bugreports.qt-project.org/browse/QTBUG-15631 | // https://bugreports.qt-project.org/browse/QTBUG-15631 | ||||
// QProgressBar uses around 10% CPU even when app is in background | // QProgressBar uses around 10% CPU even when app is in background | ||||
class ProgressBar : public ClickableProgressBar { | class ProgressBar : public ClickableProgressBar { | ||||
bool event(QEvent *e) { | bool event(QEvent *e) override { | ||||
return (e->type() != QEvent::StyleAnimationUpdate) | return (e->type() != QEvent::StyleAnimationUpdate) | ||||
? QProgressBar::event(e) | ? QProgressBar::event(e) | ||||
: false; | : false; | ||||
} | } | ||||
}; | }; | ||||
#else | #else | ||||
typedef ClickableProgressBar ProgressBar; | typedef ClickableProgressBar ProgressBar; | ||||
#endif | #endif | ||||
} // namespace GUIUtil | } // namespace GUIUtil | ||||
#endif // BITCOIN_QT_GUIUTIL_H | #endif // BITCOIN_QT_GUIUTIL_H |