From d4282e2689ec8647e9deb842ac434f274218a63a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sat, 16 Mar 2019 11:14:42 +0100 Subject: Icons: cache small edit icon In analogy to the trash-icons, cache a small rendered version of the edit icon. This will be used in the dive-site table. Rename the icon alias from "duplicate-edit-icon" to "edit-icon", as it actually is not a duplicated. The other "edit" icon is an "undo" icon! Move the accessor functions to cleanertablemode.cpp. This is not the ideal place, but since the functions are declared in cleanertablemodel.h it's certainly better than the old place (models.cpp)! Signed-off-by: Berthold Stoeger --- qt-models/cleanertablemodel.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'qt-models/cleanertablemodel.cpp') diff --git a/qt-models/cleanertablemodel.cpp b/qt-models/cleanertablemodel.cpp index 6a542ef27..36b0f4e76 100644 --- a/qt-models/cleanertablemodel.cpp +++ b/qt-models/cleanertablemodel.cpp @@ -2,6 +2,24 @@ #include "cleanertablemodel.h" #include "core/metrics.h" +const QPixmap &trashIcon() +{ + static QPixmap trash = QPixmap(":list-remove-icon").scaledToHeight(defaultIconMetrics().sz_small); + return trash; +} + +const QPixmap &trashForbiddenIcon() +{ + static QPixmap trash = QPixmap(":list-remove-disabled-icon").scaledToHeight(defaultIconMetrics().sz_small); + return trash; +} + +const QPixmap &editIcon() +{ + static QPixmap edit = QPixmap(":edit-icon").scaledToHeight(defaultIconMetrics().sz_small); + return edit; +} + CleanerTableModel::CleanerTableModel(QObject *parent) : QAbstractTableModel(parent) { } -- cgit v1.2.3-70-g09d2