X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fgraphicalui.h;h=42b5785287bd82db7c359bcf4bc20cf2ac234886;hp=f6a4cf6851bc8793beb3a345b6bc28edfd235101;hb=158443f71d48215eea8b47b836b61afd77654b78;hpb=b6028cdd595b736e8cffa1bddb6ad60df364301e diff --git a/src/uisupport/graphicalui.h b/src/uisupport/graphicalui.h index f6a4cf68..42b57852 100644 --- a/src/uisupport/graphicalui.h +++ b/src/uisupport/graphicalui.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -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