diff --git a/app/SettingsBase.h b/app/SettingsBase.h index 3812d745..1d70117a 100644 --- a/app/SettingsBase.h +++ b/app/SettingsBase.h @@ -1,96 +1,96 @@ /*************************************************************************** * Copyright (C) 2009 by Ben Cooksley * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef SETTINGS_BASE_H #define SETTINGS_BASE_H #include "MenuItem.h" #include "BaseMode.h" #include "tooltipmanager.h" #include "ui_configDialog.h" #include #include #include #include #include #include #include #include class SettingsBase : public KXmlGuiWindow { Q_OBJECT public: explicit SettingsBase(QWidget * parent = 0); ~SettingsBase(); - bool queryClose(); + bool queryClose() Q_DECL_OVERRIDE; protected: - virtual QSize sizeHint() const; + QSize sizeHint() const Q_DECL_OVERRIDE; private Q_SLOTS: void initApplication(); void initToolBar(); void initHelpMenu(); void initConfig(); void initMenuList(MenuItem * parent); void configUpdated(); void configShow(); void about(); void changePlugin(); void viewChange(bool state); void updateViewActions(); void changeToolBar( BaseMode::ToolBarItems toolbar ); void changeAboutMenu( const KAboutData * menuAbout, QAction * menuItem, QString fallback ); private: // The plugins QMap possibleViews; QList tooltipManagers; BaseMode * activeView; // The search bar KLineEdit * searchText; QWidget * spacerWidget; // The toolbar QWidgetAction * searchAction; QWidgetAction * spacerAction; QAction * configureAction; QAction * quitAction; // The help menu QAction * aboutViewAction; QAction * aboutModuleAction; KActionMenu * helpActionMenu; // The configuration KConfigDialog * configDialog; Ui::ConfigDialog configWidget; QButtonGroup viewSelection; // The control module QStackedWidget * stackedWidget; // The module list MenuItem * rootModule; MenuItem * lostFound; KService::List categories; KService::List modules; // The about dialog KAboutApplicationDialog * aboutDialog; }; #endif diff --git a/app/ToolTips/tooltipmanager.h b/app/ToolTips/tooltipmanager.h index 434af905..44f438c7 100644 --- a/app/ToolTips/tooltipmanager.h +++ b/app/ToolTips/tooltipmanager.h @@ -1,75 +1,75 @@ /******************************************************************************* * Copyright (C) 2008 by Konstantin Heil * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * *******************************************************************************/ #ifndef TOOLTIPMANAGER_H #define TOOLTIPMANAGER_H #include #include class QLayout; class QAbstractItemView; /** * @brief Manages the tooltips for an item view. * * When hovering an item, a tooltip is shown after * a short timeout. The tooltip is hidden again when the * viewport is hovered or the item view has been left. */ class ToolTipManager : public QObject { Q_OBJECT public: /** * Standard constructor. The ToolTipManager will start handling ToolTip events on the provided * view immediately. * * @param parent The view which will have the tooltips displayed for. */ explicit ToolTipManager(QAbstractItemView* parent); virtual ~ToolTipManager(); public Q_SLOTS: /** * Hides the currently shown tooltip. Invoking this method is * only needed when the tooltip should be hidden although * an item is hovered. */ void hideToolTip(); protected: - virtual bool eventFilter(QObject* watched, QEvent* event); + bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE; private Q_SLOTS: void prepareToolTip(); void requestToolTip(const QModelIndex& index); private: void showToolTip( QModelIndex menuItem ); QWidget * createTipContent( QModelIndex item ); QLayout * generateToolTipLine( QModelIndex * item, QWidget * toolTip, QSize iconSize, bool comment ); class Private; ToolTipManager::Private* d; }; #endif diff --git a/classic/ClassicMode.h b/classic/ClassicMode.h index 23ba91da..4f155f11 100644 --- a/classic/ClassicMode.h +++ b/classic/ClassicMode.h @@ -1,65 +1,65 @@ /************************************************************************** * Copyright (C) 2009 Ben Cooksley * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301, USA. * ***************************************************************************/ #ifndef CLASSICMODE_H #define CLASSICMODE_H #include "BaseMode.h" class MenuItem; class ModuleView; class QModelIndex; class ClassicMode : public BaseMode { Q_OBJECT public: ClassicMode(QObject * parent, const QVariantList& ); ~ClassicMode(); - void initEvent(); - void leaveModuleView(); - QWidget * mainWidget(); - KAboutData * aboutData(); - ModuleView * moduleView() const; + void initEvent() Q_DECL_OVERRIDE; + void leaveModuleView() Q_DECL_OVERRIDE; + QWidget * mainWidget() Q_DECL_OVERRIDE; + KAboutData * aboutData() Q_DECL_OVERRIDE; + ModuleView * moduleView() const Q_DECL_OVERRIDE; protected: - QList views() const; + QList views() const Q_DECL_OVERRIDE; public Q_SLOTS: void expandColumns(); - void searchChanged( const QString& text ); + void searchChanged( const QString& text ) Q_DECL_OVERRIDE; void selectModule( const QModelIndex& selectedModule ); void changeModule( const QModelIndex& activeModule ); - void saveState(); - void giveFocus(); - void addConfiguration( KConfigDialog * config ); - void loadConfiguration(); - void saveConfiguration(); + void saveState() Q_DECL_OVERRIDE; + void giveFocus() Q_DECL_OVERRIDE; + void addConfiguration( KConfigDialog * config ) Q_DECL_OVERRIDE; + void loadConfiguration() Q_DECL_OVERRIDE; + void saveConfiguration() Q_DECL_OVERRIDE; private Q_SLOTS: void moduleLoaded(); void initWidget(); void moveUp( MenuItem * item ); private: class Private; Private *const d; }; #endif diff --git a/core/ExternalAppModule.h b/core/ExternalAppModule.h index c3ec68d2..b04d5b64 100644 --- a/core/ExternalAppModule.h +++ b/core/ExternalAppModule.h @@ -1,50 +1,50 @@ /*************************************************************************** * Copyright (C) 2009 Ben Cooksley * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef EXTERNALAPPMODULE_H #define EXTERNALAPPMODULE_H #include #include "ui_externalModule.h" class QShowEvent; class KCModuleInfo; class ExternalAppModule : public QWidget { Q_OBJECT public: explicit ExternalAppModule(QWidget * parent = 0, KCModuleInfo * module = 0); ~ExternalAppModule(); protected: - void showEvent(QShowEvent * event); + void showEvent(QShowEvent * event) Q_DECL_OVERRIDE; private Q_SLOTS: void runExternal(); private: KCModuleInfo * moduleInfo; Ui::ExternalModule externalModule; bool firstShow; }; #endif diff --git a/core/MenuModel.h b/core/MenuModel.h index c9d2c9e7..4b0adb40 100644 --- a/core/MenuModel.h +++ b/core/MenuModel.h @@ -1,172 +1,172 @@ /************************************************************************** * Copyright (C) 2009 Ben Cooksley * * Copyright (C) 2007 Will Stephenson * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301, USA. * ***************************************************************************/ #ifndef MENUMODEL_H #define MENUMODEL_H #include #include "systemsettingsview_export.h" class MenuItem; /** * @brief Provides a menu of the MenuItem objects * * Provides a standardised model to be used with views to display the list of modules in a variety of ways.\n * It is recommended to also use this with the MenuProxyModel to provide searching * and correct ordering of modules. * * @author Ben Cooksley * @author Will Stephenson */ class SYSTEMSETTINGSVIEW_EXPORT MenuModel : public QAbstractItemModel { Q_OBJECT public: /** * Creates a MenuModel using the MenuItem specified. The MenuItem must always be valid * throughout the life of the MenuModel, otherwise it will cause crashes. * * @param menuRoot The MenuItem to use as the basis for providing information. * @param parent The QObject to use as a parent of the MenuModel. */ explicit MenuModel( MenuItem * menuRoot, QObject *parent = 0 ); /** * Destroys the MenuModel. The menuRoot will not be destroyed. */ ~MenuModel(); /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides the name, tooltip, icon, category, keywords and the internal MenuItem to views. * * @param index The QModelIndex you want information about. * @param role The information role you want information about. * @returns The data requested for the role provided from the QModelIndex provided. */ - QVariant data( const QModelIndex &index, int role ) const; + QVariant data( const QModelIndex &index, int role ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides the status flags for the QModelIndex specified. * The item always has selectable and enabled for its status unless invalid. * * @returns The flags for the QModelIndex provided. */ - Qt::ItemFlags flags( const QModelIndex &index ) const; + Qt::ItemFlags flags( const QModelIndex &index ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides a QModelIndex at the row and column specified who belongs to the parent specified. * * @param row Vertical position in the grid of children. * @param column Horizontal position in the grid of children. * @param parent The parent of the requested child. * @returns The QModelIndex for the item requested. */ - QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; + QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides the parent QModelIndex for the child specified. * * @param index The child of the parent. * @returns A QModelIndex for the parent. */ - QModelIndex parent( const QModelIndex &index ) const; + QModelIndex parent( const QModelIndex &index ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides the number of MenuItems ( categories or modules ) that the specified parent has. * * @param parent The QModelIndex the count is performed on. * @returns The number of rows ( children ) in the parent. */ - int rowCount( const QModelIndex &parent = QModelIndex() ) const; + int rowCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Returns 1, the number of columns of information about a row. * * @param parent This is ignored, as the count is always 1. * @returns The number of columns ( 1 ) in the parent. */ - int columnCount( const QModelIndex &parent = QModelIndex() ) const; + int columnCount( const QModelIndex &parent = QModelIndex() ) const Q_DECL_OVERRIDE; /** * Makes the MenuItem specified be hidden from the list, while still showing its children.\n * Children of exceptions consider their grand parents as their parent. * Parents of exceptions consider the exceptions children as theirs. * * @param exception The MenuItem to give an exception to. */ void addException( MenuItem * exception ); /** * Revokes the exception granted above. After this, the MenuItem's parents will return their children * as normal and the grand children will return their true parents, restoring normal operation. * It has no effect if the MenuItem does not have an exception. * * @param exception The MenuItem to revoke an exception from. */ void removeException( MenuItem * exception ); /** * Role used to request the keywords to filter the items when searching. */ static const int UserFilterRole; /** * Role used to request the weight of a module, used to sort the items. */ static const int UserSortRole; protected: /** * Provides the MenuItem which is used internally to provide information. * * @returns The MenuItem used internally. */ MenuItem* rootItem() const; /** * Provides a list of children of an item which has been altered by the exceptions list * * @param parent The parent of the children desired * @returns The list of children for the item specified */ QList childrenList( MenuItem * parent ) const; /** * Provides the parent of the child specified altered by the exceptions list * * @param child The child of the parent * @returns The exceptions list affected parent of the child */ MenuItem* parentItem( MenuItem * child ) const; private: class Private; Private *const d; }; #endif diff --git a/core/MenuProxyModel.h b/core/MenuProxyModel.h index eabeb5e4..4d8f5d5b 100644 --- a/core/MenuProxyModel.h +++ b/core/MenuProxyModel.h @@ -1,125 +1,125 @@ /************************************************************************** * Copyright (C) 2009 Ben Cooksley * * Copyright (C) 2007 Will Stephenson * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * * 02110-1301, USA. * ***************************************************************************/ #ifndef MENUPROXYMODEL_H #define MENUPROXYMODEL_H #include #include "systemsettingsview_export.h" /** * @brief Provides a filter model for MenuModel * * Provides a standardised model to be used with views to filter a MenuModel.\n * It automatically sorts the items appropriately depending on if it is categorised * or not. * Call setFilterRegExp(QString) with the desired text to filter to perform searching. * Items that do not match the search parameters will be disabled, not hidden. * * @author Will Stephenson * @author Ben Cooksley */ class SYSTEMSETTINGSVIEW_EXPORT MenuProxyModel : public KCategorizedSortFilterProxyModel { Q_OBJECT Q_PROPERTY(QString filterRegExp READ filterRegExp WRITE setFilterRegExp NOTIFY filterRegExpChanged) public: /** * Constructs a MenuProxyModel with the specified parent. * * @param parent The QObject to use as a parent. */ MenuProxyModel( QObject *parent = 0 ); - QHash roleNames() const; + QHash roleNames() const Q_DECL_OVERRIDE; /** * Please see the Qt QSortFilterProxyModel documentation for further information.\n * Provides information on whether or not the QModelIndex specified by left is below right. * * @param left the QModelIndex that is being used for comparing. * @param right the QModelIndex to compare aganist. * @returns true if the left is below the right. */ - virtual bool lessThan( const QModelIndex &left, const QModelIndex &right ) const; + bool lessThan( const QModelIndex &left, const QModelIndex &right ) const Q_DECL_OVERRIDE; /** * Please see the KDE KCategorizedSortFilterProxyModel documentation for futher information.\n * Provides information on whether or not the QModelIndex specified by left is below right. * * @param left the QModelIndex that is being used for comparing. * @param right the QModelIndex to compare aganist. * @returns true if the left is below the right. */ - virtual bool subSortLessThan( const QModelIndex &left, const QModelIndex &right ) const; + bool subSortLessThan( const QModelIndex &left, const QModelIndex &right ) const Q_DECL_OVERRIDE; /** * Please see the Qt QSortFilterProxyModel documentation for futher information.\n * Provides additional filtering of the MenuModel to only show categories which contain modules. * * @param source_column Please see QSortFilterProxyModel documentation. * @param source_parent Please see QSortFilterProxyModel documentation. * @returns true if the row should be displayed, false if it should not. */ - virtual bool filterAcceptsRow( int source_column, const QModelIndex &source_parent ) const; + bool filterAcceptsRow( int source_column, const QModelIndex &source_parent ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Provides the status flags for the QModelIndex specified. * The item will be selectable and enabled for its status unless invalid or filtered by search terms. * * @returns The flags for the QModelIndex provided. */ - Qt::ItemFlags flags( const QModelIndex &index ) const; + Qt::ItemFlags flags( const QModelIndex &index ) const Q_DECL_OVERRIDE; /** * Please see Qt QAbstractItemModel documentation for more details.\n * Reimplemented for internal reasons. */ void setFilterRegExp ( const QRegExp & regExp ); /** * Please see Qt QAbstractItemModel documentation for more details.\n * Reimplemented for internal reasons. */ void setFilterRegExp ( const QString & pattern ); QString filterRegExp() const; /** * makes the filter highlight matching entries instead of hiding them */ void setFilterHighlightsEntries (bool highlight ); /** * @returns the filter highlight matching entries instead of hiding them, default true */ bool filterHighlightsEntries() const; Q_SIGNALS: void filterRegExpChanged(); private: bool m_filterHighlightsEntries : 1; }; #endif diff --git a/core/ModuleView.h b/core/ModuleView.h index 4ab2d929..b0490347 100644 --- a/core/ModuleView.h +++ b/core/ModuleView.h @@ -1,160 +1,160 @@ /***************************************************************************** * Copyright (C) 2009 Ben Cooksley * * Copyright (C) 2009 by Mathias Soeken * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *****************************************************************************/ #ifndef MODULE_VIEW_H #define MODULE_VIEW_H #include #include #include #include "systemsettingsview_export.h" class KAboutData; class KCModuleInfo; class KCModuleProxy; class KPageWidgetItem; /** * @brief Provides a convienent way to display modules * * Provides a standardised interface for displaying multiple modules simultaneously * and provides facilities to access the current module, and to load its help, restore * default settings, save new settings and revert changes to settings * * It also provides checking for when a module has changed its configuration, and will prompt * if the user tries to change module or view if BaseMode is reimplemented correctly * * It also provides signals for active module changes, configuration changes and for when it has * been requested to close by button press * * @author Mathias Soeken * @author Ben Cooksley */ class SYSTEMSETTINGSVIEW_EXPORT ModuleView : public QWidget { Q_OBJECT public: /** * Constructs a ModuleView, with the parent specified. */ explicit ModuleView(QWidget * parent = 0); /** * Destroys the module view, along with all modules loaded, and any changes present in them. * * @warning The user will not be prompted to save changes if any exist.\n */ ~ModuleView(); /** * Provides the module information, which is used to set the caption of the window when either the * active module or configuration changes. */ KCModuleInfo * activeModule() const; /** * Provides the about data of the active module, used for the about dialog. */ const KAboutData * aboutData() const; /** * Resolves any changes in the currently active module by prompting the user if they exist. * * @returns true if the user saved or discarded changes, or there were no changes at all. * @returns false if the user canceled the module change. */ bool resolveChanges(); /** * Closes all active modules, after checking there are no active changes. * * @warning This forces all modules to be destroyed regardless of if changes exist or not * If possible, always check with resolveChanges() first. */ void closeModules(); void setFaceType(KPageView::FaceType type); KPageView::FaceType faceType() const; public Q_SLOTS: /** * Loads the module specified by menuItem.\n * If the module has children, they will all be loaded instead of the module. * * @param menuItem the QModelIndex that you want to load. Must be sourced from either MenuModel or MenuProxyModel */ void loadModule( QModelIndex menuItem ); /** * Will open KHelpCenter, and load the help for the active module. */ void moduleHelp(); /** * Causes the active module to reload its configuration, reverting all changes. */ void moduleLoad(); /** * Causes the active module to save its configuration, applying all changes. */ bool moduleSave(); /** * Causes the active module to revert all changes to the configuration, and return to defaults. */ void moduleDefaults(); /** * Reimplemented for internal reasons.\n */ - void keyPressEvent( QKeyEvent * event ); + void keyPressEvent( QKeyEvent * event ) Q_DECL_OVERRIDE; private: bool resolveChanges( KCModuleProxy *currentProxy ); void addModule( KCModuleInfo *module ); bool moduleSave( KCModuleProxy *module ); void updatePageIconHeader( KPageWidgetItem * page, bool light = false ); private Q_SLOTS: void activeModuleChanged( KPageWidgetItem* current, KPageWidgetItem* previous); void updateButtons(); void stateChanged(); Q_SIGNALS: /** * Emitted when the currently active module is changed. This occurs whenever the active module or * its configuration changes. This causes the window caption to update. */ void moduleChanged( bool state ); /** * Emitted when the ModuleView is asked to close.\n */ void closeRequest(); private: class Private; Private *const d; }; #endif diff --git a/icons/CategorizedView.h b/icons/CategorizedView.h index 8a57b9b9..4da69fbb 100644 --- a/icons/CategorizedView.h +++ b/icons/CategorizedView.h @@ -1,35 +1,35 @@ /*************************************************************************** * Copyright (C) 2009 by Rafael Fernández López * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef CATEGORIZEDVIEW_H #define CATEGORIZEDVIEW_H #include class CategorizedView : public KCategorizedView { public: CategorizedView( QWidget *parent = 0 ); - virtual void setModel( QAbstractItemModel *model ); + void setModel( QAbstractItemModel *model ) Q_DECL_OVERRIDE; protected: - virtual void wheelEvent(QWheelEvent *); + void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; }; #endif diff --git a/icons/CategoryDrawer.h b/icons/CategoryDrawer.h index d16582ec..cd0ce413 100644 --- a/icons/CategoryDrawer.h +++ b/icons/CategoryDrawer.h @@ -1,45 +1,45 @@ /*************************************************************************** * Copyright (C) 2009 by Rafael Fernández López * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef CATEGORYDRAWER_H #define CATEGORYDRAWER_H #include class QPainter; class QModelIndex; class QStyleOption; class CategoryDrawer : public KCategoryDrawer { Q_OBJECT public: CategoryDrawer(KCategorizedView *view); - virtual void drawCategory(const QModelIndex &index, + void drawCategory(const QModelIndex &index, int sortRole, const QStyleOption &option, - QPainter *painter) const; + QPainter *painter) const Q_DECL_OVERRIDE; - virtual int categoryHeight(const QModelIndex &index, const QStyleOption &option) const; - virtual int leftMargin() const; - virtual int rightMargin() const; + int categoryHeight(const QModelIndex &index, const QStyleOption &option) const Q_DECL_OVERRIDE; + int leftMargin() const Q_DECL_OVERRIDE; + int rightMargin() const Q_DECL_OVERRIDE; }; #endif diff --git a/icons/IconMode.h b/icons/IconMode.h index d4f5485b..af39914f 100644 --- a/icons/IconMode.h +++ b/icons/IconMode.h @@ -1,61 +1,61 @@ /*************************************************************************** * Copyright (C) 2009 by Ben Cooksley * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef ICONMODE_H #define ICONMODE_H #include "BaseMode.h" class ModuleView; class KAboutData; class QModelIndex; class QAbstractItemView; class IconMode : public BaseMode { Q_OBJECT public: IconMode(QObject * parent, const QVariantList& ); ~IconMode(); - QWidget * mainWidget(); - void initEvent(); - void giveFocus(); - void leaveModuleView(); - KAboutData * aboutData(); - ModuleView * moduleView() const; + QWidget * mainWidget() Q_DECL_OVERRIDE; + void initEvent() Q_DECL_OVERRIDE; + void giveFocus() Q_DECL_OVERRIDE; + void leaveModuleView() Q_DECL_OVERRIDE; + KAboutData * aboutData() Q_DECL_OVERRIDE; + ModuleView * moduleView() const Q_DECL_OVERRIDE; protected: - QList views() const; + QList views() const Q_DECL_OVERRIDE; public Q_SLOTS: - void searchChanged( const QString& text ); + void searchChanged( const QString& text ) Q_DECL_OVERRIDE; private Q_SLOTS: void changeModule( const QModelIndex& activeModule ); void moduleLoaded(); void backToOverview(); void initWidget(); private: class Private; Private *const d; }; #endif diff --git a/sidebar/CategorizedView.h b/sidebar/CategorizedView.h index 8a57b9b9..4da69fbb 100644 --- a/sidebar/CategorizedView.h +++ b/sidebar/CategorizedView.h @@ -1,35 +1,35 @@ /*************************************************************************** * Copyright (C) 2009 by Rafael Fernández López * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef CATEGORIZEDVIEW_H #define CATEGORIZEDVIEW_H #include class CategorizedView : public KCategorizedView { public: CategorizedView( QWidget *parent = 0 ); - virtual void setModel( QAbstractItemModel *model ); + void setModel( QAbstractItemModel *model ) Q_DECL_OVERRIDE; protected: - virtual void wheelEvent(QWheelEvent *); + void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; }; #endif diff --git a/sidebar/CategoryDrawer.h b/sidebar/CategoryDrawer.h index d16582ec..cd0ce413 100644 --- a/sidebar/CategoryDrawer.h +++ b/sidebar/CategoryDrawer.h @@ -1,45 +1,45 @@ /*************************************************************************** * Copyright (C) 2009 by Rafael Fernández López * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef CATEGORYDRAWER_H #define CATEGORYDRAWER_H #include class QPainter; class QModelIndex; class QStyleOption; class CategoryDrawer : public KCategoryDrawer { Q_OBJECT public: CategoryDrawer(KCategorizedView *view); - virtual void drawCategory(const QModelIndex &index, + void drawCategory(const QModelIndex &index, int sortRole, const QStyleOption &option, - QPainter *painter) const; + QPainter *painter) const Q_DECL_OVERRIDE; - virtual int categoryHeight(const QModelIndex &index, const QStyleOption &option) const; - virtual int leftMargin() const; - virtual int rightMargin() const; + int categoryHeight(const QModelIndex &index, const QStyleOption &option) const Q_DECL_OVERRIDE; + int leftMargin() const Q_DECL_OVERRIDE; + int rightMargin() const Q_DECL_OVERRIDE; }; #endif diff --git a/sidebar/SidebarMode.h b/sidebar/SidebarMode.h index 26b90136..4422f577 100644 --- a/sidebar/SidebarMode.h +++ b/sidebar/SidebarMode.h @@ -1,84 +1,84 @@ /*************************************************************************** * Copyright (C) 2009 by Ben Cooksley * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * ***************************************************************************/ #ifndef SIDEBARMODE_H #define SIDEBARMODE_H #include "BaseMode.h" class ModuleView; class KAboutData; class QModelIndex; class QAbstractItemView; class QAbstractItemModel; class SidebarMode : public BaseMode { Q_OBJECT Q_PROPERTY(QAbstractItemModel *categoryModel READ categoryModel CONSTANT) Q_PROPERTY(QAbstractItemModel *subCategoryModel READ subCategoryModel CONSTANT) Q_PROPERTY(int activeCategory READ activeCategory WRITE setActiveCategory NOTIFY activeCategoryChanged) Q_PROPERTY(int activeSubCategory READ activeSubCategory WRITE setActiveSubCategory NOTIFY activeSubCategoryChanged) Q_PROPERTY(int width READ width NOTIFY widthChanged) public: SidebarMode(QObject * parent, const QVariantList& ); ~SidebarMode(); - QWidget * mainWidget(); - void initEvent(); - void giveFocus(); - void leaveModuleView(); - KAboutData * aboutData(); - ModuleView * moduleView() const; + QWidget * mainWidget() Q_DECL_OVERRIDE; + void initEvent() Q_DECL_OVERRIDE; + void giveFocus() Q_DECL_OVERRIDE; + void leaveModuleView() Q_DECL_OVERRIDE; + KAboutData * aboutData() Q_DECL_OVERRIDE; + ModuleView * moduleView() const Q_DECL_OVERRIDE; QAbstractItemModel *categoryModel() const; QAbstractItemModel *subCategoryModel() const; int activeCategory() const; void setActiveCategory(int cat); int activeSubCategory() const; void setActiveSubCategory(int cat); int width() const; Q_INVOKABLE void triggerGlobalAction(const QString &name); Q_INVOKABLE void requestToolTip(int index, const QRectF &rect); Q_INVOKABLE void hideToolTip(); protected: - QList views() const; - bool eventFilter(QObject* watched, QEvent* event); + QList views() const Q_DECL_OVERRIDE; + bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE; private Q_SLOTS: void changeModule( const QModelIndex& activeModule ); void moduleLoaded(); void initWidget(); Q_SIGNALS: void activeCategoryChanged(); void activeSubCategoryChanged(); void widthChanged(); private: class Private; Private *const d; }; #endif diff --git a/sidebar/ToolTips/tooltipmanager.h b/sidebar/ToolTips/tooltipmanager.h index 5e3ad987..3cf4deb3 100644 --- a/sidebar/ToolTips/tooltipmanager.h +++ b/sidebar/ToolTips/tooltipmanager.h @@ -1,76 +1,76 @@ /******************************************************************************* * Copyright (C) 2008 by Konstantin Heil * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * *******************************************************************************/ #ifndef TOOLTIPMANAGER_H #define TOOLTIPMANAGER_H #include #include #include class QLayout; class QAbstractItemView; /** * @brief Manages the tooltips for an item view. * * When hovering an item, a tooltip is shown after * a short timeout. The tooltip is hidden again when the * viewport is hovered or the item view has been left. */ class ToolTipManager : public QObject { Q_OBJECT public: /** * Standard constructor. The ToolTipManager will start handling ToolTip events on the provided * view immediately. * * @param parent The view which will have the tooltips displayed for. */ explicit ToolTipManager(QAbstractItemModel *model, QWidget* parent); virtual ~ToolTipManager(); public Q_SLOTS: /** * Hides the currently shown tooltip. Invoking this method is * only needed when the tooltip should be hidden although * an item is hovered. */ void hideToolTip(); void requestToolTip(const QModelIndex& index, const QRect &rect); protected: - virtual bool eventFilter(QObject* watched, QEvent* event); + bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE; private Q_SLOTS: void prepareToolTip(); private: void showToolTip( QModelIndex menuItem ); QWidget * createTipContent( QModelIndex item ); QLayout * generateToolTipLine( QModelIndex * item, QWidget * toolTip, QSize iconSize, bool comment ); class Private; ToolTipManager::Private* d; }; #endif