diff --git a/CMakeLists.txt b/CMakeLists.txt index c179368..3fcc3f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,44 +1,43 @@ cmake_minimum_required(VERSION 2.8.12) project(kteatime) -find_package(ECM 1.3.0 REQUIRED NO_MODULE) +set(QT_MIN_VERSION "5.9.0") +set(KF5_VERSION "5.46.0") + + +find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(ECMInstallIcons) # Search KDE installation -find_package(Qt5 5.2.0 CONFIG REQUIRED +find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets ) -find_package(KF5 5.23.0 REQUIRED +find_package(KF5 ${KF5_VERSION} REQUIRED Config Crash DocTools I18n IconThemes NotifyConfig Notifications TextWidgets XmlGui ) include(KDEInstallDirs) include(KDECMakeSettings) -include(KDECompilerSettings NO_POLICY_SCOPE) +include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) -add_definitions( -DQT_NO_CAST_FROM_ASCII ) -add_definitions( -DQT_NO_CAST_TO_ASCII ) -add_definitions(-DQT_USE_FAST_OPERATOR_PLUS) add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT) -add_definitions(-DQT_NO_URL_CAST_FROM_STRING) -add_definitions(-DQT_USE_QSTRINGBUILDER) ADD_SUBDIRECTORY(doc) ADD_SUBDIRECTORY(data) ADD_SUBDIRECTORY(src) install(FILES org.kde.kteatime.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/tealistmodel.h b/src/tealistmodel.h index ecb6132..e30adfd 100644 --- a/src/tealistmodel.h +++ b/src/tealistmodel.h @@ -1,131 +1,131 @@ /* * Copyright 2007-2009 by Stefan Böhmann * * 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, see . */ #ifndef TEALISTMODEL_H #define TEALISTMODEL_H #include class Tea; /** * @short provides an model used by SettingsDialog * * @author Stefan Böhmann */ class TeaListModel : public QAbstractTableModel { public: /** * Constructs an TeaListModel with the given list of Teas and for the given parent. * @param teas the initial list of teas to manage. * @param parent the parent object. */ explicit TeaListModel(const QList &teas, QObject *parent = nullptr); /** * Returns the index of the item in the model specified by the given row, column and parent index. * @param row the row. * @param column the column. * @param parent will be ignored by this model. * * @return @ref QModelIndex with the index of the item. */ - QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; + QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override; /** * Returns the number of rows. * @param parent will be ignored by this model. * * @return the number of rows. */ - int rowCount(const QModelIndex &parent = QModelIndex()) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; /** * Returns the number of columns. * @param parent will be ignored by this model. * * @return the number of columns. */ - int columnCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; /** * Returns the data stored under the given role for the item referred to by the index. * @param index the index of the item. * @param role the role * * @return the specified data. */ - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; /** * Sets the role data for the item at index to value. * @param index the index of the item. * @param value the new value for the item. * @param role the role. * * @return if successful true, otherwise false. */ - bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; /** * Returns the data for the given role and section in the header with the specified orientation. * @param section the section. * @param orientation the orientation. * @param role the role. * * @return the specified data. */ - QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; /** * inserts rows into the model before the given one. * * @param row the row - if 0 the new rows will be insert before any exists rows. * @param count number of rows to add. * @param parent will be ignored by this model. * * @return true if the rows were successfully inserted, otherwise false. */ - bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; /** * removes rows from the model, starting with the given row. * @param row the first row to remove. * @param count number of rows to remove. * @param parent will be ignored by this model. * * @return true if the rows were successfully removed, otherwise false. */ - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; /** * Returns the whole list of teas. * * @return list of teas. */ const QList getTeaList() const; private: QList m_tealist; }; #endif // kate: word-wrap off; encoding utf-8; indent-width 4; tab-width 4; line-numbers on; mixed-indent off; remove-trailing-space-save on; replace-tabs-save on; replace-tabs on; space-indent on; // vim:set spell et sw=4 ts=4 nowrap cino=l1,cs,U1: