X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fgraphicalui.h;h=42b5785287bd82db7c359bcf4bc20cf2ac234886;hb=f9cd845a9119e0abf450a91d8802f5c1822dd638;hp=f250e1ab27df3b90fcf16e2c2e3ccf466a74d24d;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf;p=quassel.git diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index f250e1ab..42b57852 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -18,10 +18,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef GRAPHICALUI_H_ -#define GRAPHICALUI_H_ +#pragma once + +#include "uisupport-export.h" #include "abstractui.h" +#include "singleton.h" class ActionCollection; class ContextMenuActionProvider; @@ -35,14 +37,11 @@ class UiStyle; #include #endif -class GraphicalUi : public AbstractUi +class UISUPPORT_EXPORT GraphicalUi : public AbstractUi, protected Singleton { Q_OBJECT public: - GraphicalUi(QObject *parent = 0); - virtual void init(); - //! Access global ActionCollections. /** These ActionCollections are associated with the main window, i.e. they contain global * actions (and thus, shortcuts). Widgets providing application-wide shortcuts should @@ -78,6 +77,9 @@ public: static bool isMainWidgetVisible(); protected: + GraphicalUi(QObject *parent = nullptr); + void init() override; + //! This is the widget we associate global actions with, typically the main window void setMainWidget(QWidget *); @@ -103,21 +105,17 @@ protected: void setToolBarActionProvider(ToolBarActionProvider *); void setUiStyle(UiStyle *); - virtual bool eventFilter(QObject *obj, QEvent *event); + bool eventFilter(QObject *obj, QEvent *event) override; protected slots: - virtual void disconnectedFromCore(); + void disconnectedFromCore() override; private: - static inline GraphicalUi *instance(); - - static GraphicalUi *_instance; static QWidget *_mainWidget; static QHash _actionCollections; static ContextMenuActionProvider *_contextMenuActionProvider; static ToolBarActionProvider *_toolBarActionProvider; static UiStyle *_uiStyle; - static bool _onAllDesktops; #ifdef Q_OS_WIN DWORD _dwTickCount; @@ -130,11 +128,8 @@ private: // inlines -GraphicalUi *GraphicalUi::instance() { return _instance; } ContextMenuActionProvider *GraphicalUi::contextMenuActionProvider() { return _contextMenuActionProvider; } ToolBarActionProvider *GraphicalUi::toolBarActionProvider() { return _toolBarActionProvider; } UiStyle *GraphicalUi::uiStyle() { return _uiStyle; } QWidget *GraphicalUi::mainWidget() { return _mainWidget; } bool GraphicalUi::isHidingMainWidgetAllowed() const { return false; } - -#endif