diff --git a/kmymoney/icons/icons.cpp b/kmymoney/icons/icons.cpp index 6f80e4a03..0d3bfbd29 100644 --- a/kmymoney/icons/icons.cpp +++ b/kmymoney/icons/icons.cpp @@ -1,558 +1,557 @@ /*************************************************************************** icons.cpp ------------------- begin : Sun Jun 25 2017 copyright : (C) 2017 by Łukasz Wojniłowicz ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #include "icons.h" #include #include #include #include #include #include #include #include namespace Icons { QHash sStandardIcons; uint qHash(const Icon key, uint seed) { return ::qHash(static_cast(key), seed); } uint qHash(const IconSet key, uint seed) { return ::qHash(static_cast(key), seed); } struct iconDescription { Icon baseIcon; Icon overlayIcon; Qt::Corner corner; }; const QHash > iconMappings{ {Icon::AccountClosed, {{IconSet::Common, QStringLiteral("account-types-closed")}, {IconSet::Oxygen, QStringLiteral("dialog-close")}, {IconSet::Breeze, QStringLiteral("dialog-close")}}}, {Icon::ArrowDown, {{IconSet::Common, QStringLiteral("arrow-down")}, {IconSet::Tango, QStringLiteral("go-down")}}}, {Icon::ArrowLeft, {{IconSet::Common, QStringLiteral("arrow-left")}, {IconSet::Tango, QStringLiteral("go-previous")}}}, {Icon::ArrowRight, {{IconSet::Common, QStringLiteral("arrow-right")}, {IconSet::Tango, QStringLiteral("go-next")}}}, {Icon::ArrowUp, {{IconSet::Common, QStringLiteral("arrow-up")}, {IconSet::Tango, QStringLiteral("go-up")}}}, {Icon::Budget, {{IconSet::Common, QStringLiteral("budget")}, {IconSet::Oxygen, QStringLiteral("view-time-schedule-calculus")}, {IconSet::Breeze, QStringLiteral("view-time-schedule-calculus")}}}, {Icon::Calculator, {{IconSet::Common, QStringLiteral("accessories-calculator")}}}, {Icon::Configure, {{IconSet::Common, QStringLiteral("configure")}, {IconSet::Tango, QStringLiteral("preferences-system")}}}, {Icon::DialogCancel, {{IconSet::Common, QStringLiteral("dialog-cancel")}, {IconSet::Tango, QStringLiteral("stop")}}}, {Icon::DialogClose, {{IconSet::Common, QStringLiteral("dialog-close")}}}, {Icon::DialogError, {{IconSet::Common, QStringLiteral("dialog-error")}}}, {Icon::DialogInformation, {{IconSet::Common, QStringLiteral("dialog-information")}}}, {Icon::DialogOK, {{IconSet::Common, QStringLiteral("dialog-ok")}, {IconSet::Tango, QStringLiteral("finish")}}}, {Icon::DialogOKApply, {{IconSet::Common, QStringLiteral("dialog-ok-apply")}}}, {Icon::DialogWarning, {{IconSet::Common, QStringLiteral("dialog-warning")}}}, {Icon::DocumentClose, {{IconSet::Common, QStringLiteral("document-close")}, {IconSet::Tango, QStringLiteral("stop")}}}, {Icon::DocumentEdit, {{IconSet::Common, QStringLiteral("document-edit")}, {IconSet::Tango, QStringLiteral("text-editor")}}}, {Icon::DocumentExport, {{IconSet::Common, QStringLiteral("format-indent-more")}, {IconSet::Oxygen, QStringLiteral("document-export")}, {IconSet::Breeze, QStringLiteral("document-export")}}}, {Icon::DocumentImport, {{IconSet::Common, QStringLiteral("format-indent-less")}, {IconSet::Oxygen, QStringLiteral("document-import")}, {IconSet::Breeze, QStringLiteral("document-import")}}}, {Icon::DocumentNew, {{IconSet::Common, QStringLiteral("document-new")}}}, {Icon::DocumentOpen, {{IconSet::Common, QStringLiteral("document-open")}}}, {Icon::DocumentProperties, {{IconSet::Common, QStringLiteral("document-properties")}}}, {Icon::DocumentSave, {{IconSet::Common, QStringLiteral("document-save")}}}, {Icon::Download, {{IconSet::Breeze, QStringLiteral("edit-download")}, {IconSet::Common, QStringLiteral("go-down")}, {IconSet::Oxygen, QStringLiteral("download")}}}, {Icon::EditClear, {{IconSet::Common, QStringLiteral("edit-clear")}}}, {Icon::EditCopy, {{IconSet::Common, QStringLiteral("edit-copy")}}}, {Icon::EditDelete, {{IconSet::Common, QStringLiteral("edit-delete")}}}, {Icon::EditFind, {{IconSet::Common, QStringLiteral("edit-find")}}}, {Icon::EditRename, {{IconSet::Common, QStringLiteral("edit-rename")}, {IconSet::Tango, QStringLiteral("text-editor")}}}, {Icon::EditUndo, {{IconSet::Common, QStringLiteral("edit-undo")}}}, {Icon::Folder, {{IconSet::Common, QStringLiteral("folder")}}}, {Icon::GoTo, {{IconSet::Common, QStringLiteral("go-jump")}}}, {Icon::Help, {{IconSet::Common, QStringLiteral("help-contents")}}}, {Icon::HideCategories, {{IconSet::Common, QStringLiteral("hide-categories")}}}, {Icon::HideReconciled, {{IconSet::Common, QStringLiteral("hide-reconciled")}}}, {Icon::KMyMoney, {{IconSet::Common, QStringLiteral("kmymoney")}}}, {Icon::KeyEnter, {{IconSet::Common, QStringLiteral("input-keyboard")}, {IconSet::Oxygen, QStringLiteral("key-enter")}, {IconSet::Breeze, QStringLiteral("key-enter")}}}, {Icon::ListAdd, {{IconSet::Common, QStringLiteral("list-add")}}}, {Icon::ListAddTag, {{IconSet::Common, QStringLiteral("list-add-tag")}}}, {Icon::ListAddUser, {{IconSet::Common, QStringLiteral("list-add-user")}}}, {Icon::ListCollapse, {{IconSet::Common, QStringLiteral("zoom-out")}, {IconSet::Tango, QStringLiteral("list-remove")}}}, {Icon::ListExpand, {{IconSet::Common, QStringLiteral("zoom-in")}, {IconSet::Tango, QStringLiteral("list-add")}}}, {Icon::ListRemoveTag, {{IconSet::Common, QStringLiteral("list-remove-tag")}}}, {Icon::ListRemoveUser, {{IconSet::Common, QStringLiteral("list-remove-user")}}}, {Icon::MailMessage, {{IconSet::Common, QStringLiteral("internet-mail")}, {IconSet::Oxygen, QStringLiteral("mail-message")}, {IconSet::Breeze, QStringLiteral("mail-message")}}}, {Icon::MailMessageNew, {{IconSet::Common, QStringLiteral("mail-message-new")}}}, {Icon::MailReceive, {{IconSet::Common, QStringLiteral("mail-receive")}}}, {Icon::MapOnlineAccount, {{IconSet::Common, QStringLiteral("news-subscribe")}}}, {Icon::Merge, {{IconSet::Common, QStringLiteral("reconcile")}, {IconSet::Oxygen, QStringLiteral("merge")}, {IconSet::Breeze, QStringLiteral("merge")}}}, {Icon::NewSchedule, {{IconSet::Common, QStringLiteral("appointment-new")}}}, {Icon::OfficeChartLine, {{IconSet::Common, QStringLiteral("account-types-investments")}, {IconSet::Oxygen, QStringLiteral("office-chart-line")}, {IconSet::Breeze, QStringLiteral("office-chart-line")}, {IconSet::Tango, QStringLiteral("report-line")}}}, {Icon::OpenDatabase, {{IconSet::Common, QStringLiteral("svn-update")}}}, {Icon::Pause, {{IconSet::Common, QStringLiteral("media-playback-pause")}}}, {Icon::PayeeMerge, {{IconSet::Common, QStringLiteral("merge")}}}, {Icon::PayeeRename, {{IconSet::Common, QStringLiteral("user-properties")}, {IconSet::Oxygen, QStringLiteral("payee-rename")}}}, {Icon::PerformanceTest, {{IconSet::Common, QStringLiteral("fork")}}}, {Icon::PreferencesColors, {{IconSet::Common, QStringLiteral("preferences-desktop-color")}}}, {Icon::PreferencesFonts, {{IconSet::Common, QStringLiteral("preferences-desktop-font")}}}, {Icon::PreferencesGeneral, {{IconSet::Common, QStringLiteral("system-run")}, {IconSet::Tango, QStringLiteral("media-playback-start")}}}, {Icon::PreferencesIcons, {{IconSet::Common, QStringLiteral("preferences-desktop-icon")}}}, {Icon::PreferencesNetwork, {{IconSet::Common, QStringLiteral("preferences-system-network")}}}, {Icon::PreferencesPlugins, {{IconSet::Common, QStringLiteral("network-disconnect")}}}, {Icon::Reconcile, {{IconSet::Common, QStringLiteral("reconcile")}, {IconSet::Oxygen, QStringLiteral("merge")}, {IconSet::Breeze, QStringLiteral("merge")}}}, {Icon::Reconciled, {{IconSet::Common, QStringLiteral("reconciled")}, {IconSet::Oxygen, QStringLiteral("flag-green")}, {IconSet::Breeze, QStringLiteral("flag-green")}}}, {Icon::Refresh, {{IconSet::Breeze, QStringLiteral("view-refresh")}, {IconSet::Oxygen, QStringLiteral("refresh")}}}, {Icon::Report, {{IconSet::Common, QStringLiteral("application-vnd.oasis.opendocument.spreadsheet")}}}, {Icon::Reverse, {{IconSet::Common, QStringLiteral("reverse")}}}, {Icon::SeekForward, {{IconSet::Common, QStringLiteral("media-seek-forward")}}}, {Icon::SkipForward, {{IconSet::Common, QStringLiteral("media-skip-forward")}}}, {Icon::SortAscending, {{IconSet::Common, QStringLiteral("go-up")}, {IconSet::Oxygen, QStringLiteral("view-sort-ascending")}, {IconSet::Breeze, QStringLiteral("view-sort-ascending")}}}, {Icon::SortDescending, {{IconSet::Common, QStringLiteral("go-down")}, {IconSet::Oxygen, QStringLiteral("view-sort-descending")}, {IconSet::Breeze, QStringLiteral("view-sort-descending")}}}, {Icon::Split, {{IconSet::Common, QStringLiteral("transaction-split")}, {IconSet::Oxygen, QStringLiteral("split")}, {IconSet::Breeze, QStringLiteral("split")}}}, {Icon::TagRename, {{IconSet::Common, QStringLiteral("tag-rename")}}}, {Icon::TaskAccepted, {{IconSet::Common, QStringLiteral("task-accepted")}}}, - {Icon::TaskAttention, - {{IconSet::Common, QStringLiteral("task-attention")}, - {IconSet::Tango, QStringLiteral("dialog-warning")}}}, {Icon::TaskComplete, {{IconSet::Common, QStringLiteral("task-complete")}}}, {Icon::TaskOngoing, {{IconSet::Common, QStringLiteral("task-ongoing")}}}, {Icon::TaskReject, {{IconSet::Common, QStringLiteral("task-reject")}}}, + {Icon::Warning, + {{IconSet::Common, QStringLiteral("dialog-warning")}}}, {Icon::Tip, {{IconSet::Common, QStringLiteral("info")}, {IconSet::Oxygen, QStringLiteral("ktip")}}}, {Icon::Unknown, {{IconSet::Common, QStringLiteral("unknown")}}}, {Icon::UnmapOnlineAccount, {{IconSet::Common, QStringLiteral("news-unsubscribe")}}}, {Icon::UserProperties, {{IconSet::Common, QStringLiteral("system-users")}, {IconSet::Oxygen, QStringLiteral("user-properties")}, {IconSet::Breeze, QStringLiteral("user-properties")}}}, {Icon::ViewAccounts, {{IconSet::Common, QStringLiteral("account")}, {IconSet::Oxygen, QStringLiteral("view-bank-account")}, {IconSet::Breeze, QStringLiteral("view-bank-account")}}}, {Icon::ViewAsset, {{IconSet::Common, QStringLiteral("account-types-asset")}, {IconSet::Oxygen, QStringLiteral("view-bank-account")}, {IconSet::Breeze, QStringLiteral("view-bank-account")}}}, {Icon::ViewBank, {{IconSet::Common, QStringLiteral("bank")}, {IconSet::Oxygen, QStringLiteral("view-bank")}, {IconSet::Breeze, QStringLiteral("view-bank")}}}, {Icon::ViewBankAccount, {{IconSet::Common, QStringLiteral("account")}, {IconSet::Oxygen, QStringLiteral("view-bank-account")}, {IconSet::Breeze, QStringLiteral("view-bank-account")}}}, {Icon::ViewBudgets, {{IconSet::Common, QStringLiteral("budget")}, {IconSet::Oxygen, QStringLiteral("view-time-schedule-calculus")}, {IconSet::Breeze, QStringLiteral("view-time-schedule-calculus")}}}, {Icon::ViewCalendar, {{IconSet::Common, QStringLiteral("view-calendar")}}}, {Icon::ViewCalendarDay, {{IconSet::Common, QStringLiteral("office-calendar")}, {IconSet::Oxygen, QStringLiteral("view-calendar-day")}, {IconSet::Breeze, QStringLiteral("view-calendar-day")}}}, {Icon::ViewCash, {{IconSet::Common, QStringLiteral("account-types-cash")}}}, {Icon::ViewCategories, {{IconSet::Common, QStringLiteral("categories")}, {IconSet::Oxygen, QStringLiteral("view-categories")}, {IconSet::Breeze, QStringLiteral("view-categories")}, {IconSet::Oxygen, QStringLiteral("view-financial-categories")}}}, {Icon::ViewChecking, {{IconSet::Common, QStringLiteral("account-types-checking")}, {IconSet::Oxygen, QStringLiteral("view-bank-account-checking")}, {IconSet::Breeze, QStringLiteral("view-bank-account-checking")}}}, {Icon::ViewClose, {{IconSet::Common, QStringLiteral("view-close")}}}, {Icon::ViewCreditCard, {{IconSet::Breeze, QStringLiteral("skrooge_credit_card")}, {IconSet::Common, QStringLiteral("account-types-credit-card")}, {IconSet::Oxygen, QStringLiteral("view-credit-card-account")}}}, {Icon::ViewCurrencyList, {{IconSet::Common, QStringLiteral("view-currency-list")}}}, {Icon::ViewEquity, {{IconSet::Common, QStringLiteral("account")}, {IconSet::Oxygen, QStringLiteral("view-bank-account")}, {IconSet::Breeze, QStringLiteral("view-bank-account")}}}, {Icon::ViewExpense, {{IconSet::Breeze, QStringLiteral("view-categories-expenditures")}, {IconSet::Common, QStringLiteral("account-types-expense")}, {IconSet::Oxygen, QStringLiteral("view-expenses-categories")}}}, {Icon::ViewFilter, {{IconSet::Common, QStringLiteral("view-filter")}}}, {Icon::ViewFinancialCategories, {{IconSet::Common, QStringLiteral("categories")}, {IconSet::Oxygen, QStringLiteral("view-categories")}, {IconSet::Breeze, QStringLiteral("view-categories")}, {IconSet::Oxygen, QStringLiteral("view-financial-categories")}}}, {Icon::ViewFinancialList, {{IconSet::Common, QStringLiteral("ledger")}, {IconSet::Oxygen, QStringLiteral("view-financial-list")}}}, {Icon::ViewFinancialTransfer, {{IconSet::Common, QStringLiteral("ledger")}, {IconSet::Oxygen, QStringLiteral("view-financial-transfer")}}}, {Icon::ViewForecast, {{IconSet::Common, QStringLiteral("forecast")}, {IconSet::Oxygen, QStringLiteral("view-financial-forecast")}}}, {Icon::ViewHome, {{IconSet::Common, QStringLiteral("home")}, {IconSet::Oxygen, QStringLiteral("go-home")}, {IconSet::Breeze, QStringLiteral("go-home")}}}, {Icon::ViewIncome, {{IconSet::Breeze, QStringLiteral("view-categories-incomes")}, {IconSet::Common, QStringLiteral("account-types-income")}, {IconSet::Oxygen, QStringLiteral("view-income-categories")}}}, {Icon::ViewInstitutions, {{IconSet::Common, QStringLiteral("institution")}, {IconSet::Oxygen, QStringLiteral("view-bank")}, {IconSet::Breeze, QStringLiteral("view-bank")}}}, {Icon::ViewInvestments, {{IconSet::Common, QStringLiteral("investment")}, {IconSet::Oxygen, QStringLiteral("view-investment")}}}, {Icon::ViewLedgers, {{IconSet::Common, QStringLiteral("ledger")}, {IconSet::Oxygen, QStringLiteral("view-financial-list")}}}, {Icon::ViewLiability, {{IconSet::Common, QStringLiteral("account-types-liability")}, {IconSet::Oxygen, QStringLiteral("view-loan")}}}, {Icon::ViewLoan, {{IconSet::Common, QStringLiteral("account-types-loan")}, {IconSet::Oxygen, QStringLiteral("view-loan")}}}, {Icon::ViewLoanAsset, {{IconSet::Common, QStringLiteral("account-types-loan")}, {IconSet::Oxygen, QStringLiteral("view-loan-asset")}}}, {Icon::ViewOutbox, {{IconSet::Common, QStringLiteral("online-banking")}}}, {Icon::ViewPayees, {{IconSet::Common, QStringLiteral("payee")}, {IconSet::Oxygen, QStringLiteral("system-users")}, {IconSet::Breeze, QStringLiteral("system-users")}}}, {Icon::ViewReports, {{IconSet::Common, QStringLiteral("report")}, {IconSet::Oxygen, QStringLiteral("office-chart-bar")}, {IconSet::Breeze, QStringLiteral("office-chart-bar")}}}, {Icon::ViewSaving, {{IconSet::Common, QStringLiteral("account-types-savings")}, {IconSet::Oxygen, QStringLiteral("view-bank-account-savings")}, {IconSet::Breeze, QStringLiteral("view-bank-account-savings")}}}, {Icon::ViewSchedules, {{IconSet::Common, QStringLiteral("schedule")}, {IconSet::Oxygen, QStringLiteral("view-pim-calendar")}, {IconSet::Breeze, QStringLiteral("view-pim-calendar")}}}, {Icon::ViewStock, {{IconSet::Common, QStringLiteral("account-types-investments")}, {IconSet::Oxygen, QStringLiteral("view-stock-account")}}}, {Icon::ViewTags, {{IconSet::Common, QStringLiteral("bookmark-new")}, {IconSet::Oxygen, QStringLiteral("mail-tagged")}, {IconSet::Breeze, QStringLiteral("mail-tagged")}}}, {Icon::ViewTransactionDetail, {{IconSet::Common, QStringLiteral("edit-find")}, {IconSet::Oxygen, QStringLiteral("zoom-in")}, {IconSet::Breeze, QStringLiteral("zoom-in")}}}, {Icon::ViewUpcominEvents, {{IconSet::Common, QStringLiteral("view-calendar-upcoming-events")}}}, {Icon::ZoomIn, {{IconSet::Common, QStringLiteral("zoom-in")}}}, {Icon::ZoomOut, {{IconSet::Common, QStringLiteral("zoom-out")}}}, {Icon::Visibility, {{IconSet::Common, QStringLiteral("visibility")}}}, {Icon::NoVisibility, {{IconSet::Common, QStringLiteral("hint")}}} }; const QHash sComposedIcons { {Icon::EditFindTransaction, {Icon::ViewFinancialTransfer, Icon::EditFind, Qt::BottomRightCorner}}, {Icon::InstitutionNew, {Icon::ViewBank, Icon::ListAdd, Qt::BottomRightCorner}}, {Icon::InstitutionEdit, {Icon::ViewBank, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::InstitutionDelete, {Icon::ViewBank, Icon::EditDelete, Qt::BottomRightCorner}}, {Icon::AccountNew, {Icon::ViewBankAccount, Icon::ListAdd, Qt::TopRightCorner}}, {Icon::AccountFinishReconciliation, {Icon::Merge, Icon::DialogOK, Qt::BottomRightCorner}}, {Icon::AccountEdit, {Icon::ViewBankAccount, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::AccountDelete, {Icon::ViewBankAccount, Icon::EditDelete, Qt::BottomRightCorner}}, {Icon::AccountClose, {Icon::ViewBankAccount, Icon::DialogClose, Qt::BottomRightCorner}}, {Icon::AccountReopen, {Icon::ViewBankAccount, Icon::DialogOK, Qt::BottomRightCorner}}, {Icon::AccountUpdate, {Icon::ViewBankAccount, Icon::Download, Qt::BottomRightCorner}}, {Icon::AccountUpdateAll, {Icon::ViewBankAccount, Icon::Download, Qt::BottomRightCorner}}, {Icon::AccountCreditTransfer, {Icon::ViewBankAccount, Icon::MailMessageNew, Qt::BottomRightCorner}}, {Icon::CategoryNew, {Icon::ViewFinancialCategories, Icon::ListAdd, Qt::TopRightCorner}}, {Icon::CategoryEdit, {Icon::ViewFinancialCategories, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::CategoryDelete, {Icon::ViewFinancialCategories, Icon::EditDelete, Qt::BottomRightCorner}}, {Icon::TransactionNew, {Icon::ViewFinancialTransfer, Icon::ListAdd, Qt::TopRightCorner}}, {Icon::TransactionEdit, {Icon::ViewFinancialTransfer, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::TransactionMatch, {Icon::ViewFinancialTransfer, Icon::DocumentImport, Qt::BottomRightCorner}}, {Icon::TransactionAccept, {Icon::ViewFinancialTransfer, Icon::DialogOKApply, Qt::BottomRightCorner}}, {Icon::InvestmentNew, {Icon::ViewInvestments, Icon::ListAdd, Qt::TopRightCorner}}, {Icon::InvestmentEdit, {Icon::ViewInvestments, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::InvestmentDelete, {Icon::ViewInvestments, Icon::EditDelete, Qt::BottomRightCorner}}, {Icon::InvestmentOnlinePrice, {Icon::ViewInvestments, Icon::Download, Qt::BottomRightCorner}}, {Icon::InvestmentOnlinePriceAll, {Icon::ViewInvestments, Icon::Download, Qt::BottomRightCorner}}, {Icon::BudgetNew, {Icon::Budget, Icon::ListAdd, Qt::TopRightCorner}}, {Icon::BudgetRename, {Icon::Budget, Icon::DocumentEdit, Qt::BottomRightCorner}}, {Icon::BudgetDelete, {Icon::Budget, Icon::EditDelete, Qt::BottomRightCorner}}, {Icon::BudgetCopy, {Icon::Budget, Icon::EditCopy, Qt::BottomRightCorner}}, {Icon::PriceUpdate, {Icon::ViewCurrencyList, Icon::Download, Qt::BottomRightCorner}} }; KMM_ICONS_EXPORT void setUpMappings(const QString& themeName) { for (auto iconDef = iconMappings.cbegin(); iconDef != iconMappings.cend(); ++iconDef) { const auto icon = iconDef.key(); for (auto mapping = iconDef.value().cbegin(); mapping != iconDef->cend(); ++mapping) { switch (mapping.key()) { case (IconSet::Oxygen): if (themeName.contains(QStringLiteral("oxygen"), Qt::CaseInsensitive)) { sStandardIcons.insert(icon, mapping.value()); continue; } break; case (IconSet::Tango): if (themeName.contains(QStringLiteral("tango"), Qt::CaseInsensitive)) { sStandardIcons.insert(icon, mapping.value()); continue; } break; case (IconSet::Breeze): if (themeName.contains(QStringLiteral("breeze"), Qt::CaseInsensitive)) { sStandardIcons.insert(icon, mapping.value()); continue; } break; case (IconSet::Common): sStandardIcons.insert(icon, mapping.value()); break; } } } } /** * This method overlays an icon over another one, to get a composite one * eg. an icon to add accounts */ QIcon overlayIcon(iconDescription description, const int size = 64) { const auto iconName = sStandardIcons[description.baseIcon]; const auto overlayName = sStandardIcons[description.overlayIcon]; const auto corner = description.corner; QPixmap pxIcon; QString kyIcon = iconName + overlayName; // If found in the cache, return quickly if (QPixmapCache::find(kyIcon, pxIcon)) return pxIcon; // try to retrieve the main icon from cache if (!QPixmapCache::find(iconName, pxIcon)) { pxIcon = QIcon::fromTheme(iconName).pixmap(size); QPixmapCache::insert(iconName, pxIcon); } if (overlayName.isEmpty()) // call from MyMoneyAccount::accountPixmap can have no overlay icon, so handle that appropriately return pxIcon; QPainter pixmapPainter(&pxIcon); QPixmap pxOverlay = QIcon::fromTheme(overlayName).pixmap(size); int x, y; switch (corner) { case Qt::TopLeftCorner: x = 0; y = 0; break; case Qt::TopRightCorner: x = pxIcon.width() / 2; y = 0; break; case Qt::BottomLeftCorner: x = 0; y = pxIcon.height() / 2; break; case Qt::BottomRightCorner: default: x = pxIcon.width() / 2; y = pxIcon.height() / 2; break; } pixmapPainter.drawPixmap(x, y, pxIcon.width() / 2, pxIcon.height() / 2, pxOverlay); //save for later use QPixmapCache::insert(kyIcon, pxIcon); return pxIcon; } KMM_ICONS_EXPORT QIcon get(Icon icon) { if (sComposedIcons.contains(icon)) return overlayIcon(sComposedIcons[icon]); return QIcon::fromTheme(sStandardIcons[icon]); } QString iconCacheDir() { const QString cachePath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation); if (QDir::root().mkpath(cachePath)) { return cachePath; } return QString(); } KMM_ICONS_EXPORT bool storeIconInApplicationCache(const QString& name, const QIcon& icon) { // split the icon name from the type QRegularExpression iconPath(QStringLiteral("^(?[a-zA-Z]+):(?.+)"), QRegularExpression::CaseInsensitiveOption); QRegularExpressionMatch matcher = iconPath.match(name); if (matcher.hasMatch()) { if (matcher.captured(QStringLiteral("type")).compare(QLatin1String("enum")) == 0) { return true; } else { const QString cacheDir = iconCacheDir(); if (!cacheDir.isEmpty()) { return icon.pixmap(16).save(QString::fromLatin1("%1/%2-%3").arg(cacheDir, matcher.captured(QStringLiteral("type")), matcher.captured(QStringLiteral("name"))), "PNG"); } } } return false; } KMM_ICONS_EXPORT QIcon loadIconFromApplicationCache(const QString& name) { const QHash sEnumIcons { { QStringLiteral("ViewBank"), Icon::ViewBank }, }; // split the icon name from the type QRegularExpression iconPath(QStringLiteral("^(?[a-zA-Z]+):(?.+)"), QRegularExpression::CaseInsensitiveOption); QRegularExpressionMatch matcher = iconPath.match(name); if (matcher.hasMatch()) { if (matcher.captured(QStringLiteral("type")).compare(QLatin1String("enum")) == 0) { // type is enum, so we use our own set of icons const QString iconName = matcher.captured(QStringLiteral("name")); if (sEnumIcons.contains(iconName)) { return get(sEnumIcons[iconName]); } } else { // otherwise, we use the type as part of the filename const QString cacheDir = iconCacheDir(); if (!cacheDir.isEmpty()) { const QString filename = QString::fromLatin1("%1/%2-%3").arg(cacheDir, matcher.captured(QStringLiteral("type")), matcher.captured(QStringLiteral("name"))); if (QFile::exists(filename)) { return QIcon(filename); } } } } return QIcon(); } } diff --git a/kmymoney/icons/icons.h b/kmymoney/icons/icons.h index a1e79fda5..ec361a1dd 100644 --- a/kmymoney/icons/icons.h +++ b/kmymoney/icons/icons.h @@ -1,132 +1,132 @@ /*************************************************************************** icons.h ------------------- begin : Sun Jun 25 2017 copyright : (C) 2017 by Łukasz Wojniłowicz ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef ICONS_H #define ICONS_H // ---------------------------------------------------------------------------- // QT Includes #include // ---------------------------------------------------------------------------- // Project Includes class QString; class QIcon; namespace Icons { enum class IconSet { Common, Oxygen, Tango, Breeze }; enum class Icon { OpenDatabase, Merge, Reconcile, Split, Tip, PerformanceTest, Calculator, UserProperties, DocumentProperties, ZoomIn, ZoomOut, Pause, SeekForward, SkipForward, HideReconciled, HideCategories, ViewHome, ViewInstitutions, ViewAccounts, ViewCategories, ViewSchedules, ViewTags, ViewPayees, ViewLedgers, ViewInvestments, ViewReports, ViewBudgets, ViewForecast, ViewOutbox, ViewFilter, ViewLoan, ViewStock, ViewChecking, ViewSaving, ViewLoanAsset, ViewCreditCard, ViewCash, ViewEquity, ViewIncome, ViewExpense, ViewAsset, ViewLiability, ViewUpcominEvents, ViewCalendarDay, ViewFinancialList, ViewBankAccount, ViewCurrencyList, ViewFinancialCategories, ViewFinancialTransfer, ViewBank, Budget, ViewCalendar, ViewTransactionDetail, ViewClose, DialogOK, DialogClose, DialogCancel, DialogOKApply, DialogError, DialogWarning, DialogInformation, ListExpand, ListCollapse, ListAdd, ListAddUser, ListRemoveUser, ListAddTag, ListRemoveTag, GoTo, KeyEnter, Download, TagRename, EditDelete, EditCopy, EditRename, EditFind, EditUndo, EditClear, DocumentEdit, DocumentNew, DocumentSave, DocumentClose, DocumentOpen, DocumentImport, DocumentExport, OfficeChartLine, MailMessageNew, MailMessage, MailReceive, MapOnlineAccount, UnmapOnlineAccount, NewSchedule, KMyMoney, PayeeRename, PayeeMerge, Configure, Reconciled, AccountClosed, Unknown, Report, Refresh, PreferencesGeneral, SortAscending, SortDescending, ArrowUp, ArrowDown, ArrowRight, ArrowLeft, - TaskAttention, TaskComplete, + Warning, TaskComplete, TaskReject, TaskAccepted, TaskOngoing, Help, Folder, PreferencesFonts, PreferencesColors, PreferencesIcons, PreferencesNetwork, PreferencesPlugins, Empty, EditFindTransaction, InstitutionNew, InstitutionEdit, InstitutionDelete, AccountNew, AccountEdit, AccountDelete, AccountClose, AccountReopen, AccountUpdate, AccountUpdateAll, AccountCreditTransfer, AccountFinishReconciliation, CategoryNew, CategoryEdit, CategoryDelete, TransactionNew, TransactionEdit, TransactionMatch, TransactionAccept, InvestmentNew, InvestmentEdit, InvestmentDelete, InvestmentOnlinePrice, BudgetNew, BudgetRename, BudgetDelete, BudgetCopy, PriceUpdate, InvestmentOnlinePriceAll, Reverse, Visibility, NoVisibility }; KMM_ICONS_EXPORT void setUpMappings(const QString & themeName); KMM_ICONS_EXPORT QIcon get(Icons::Icon icon); /** * return an icon from the application local cache or an icon provided * by the application. The @a name is formatted as @c type:iconName. * The following types are supported * * - enum * - favicon * * @sa storeIconInApplicationCache(const QString& name, const QIcon& icon) */ KMM_ICONS_EXPORT QIcon loadIconFromApplicationCache(const QString& name); /** * store the @a icon in the applications local cache directory under the given @a name. * The @a name is formatted as @c type:iconName. * The icon will be stored in the file "type-iconName". * * @sa loadIconFromApplicationCache(const QString& name) */ KMM_ICONS_EXPORT bool storeIconInApplicationCache(const QString& name, const QIcon& icon); } #endif diff --git a/kmymoney/plugins/views/onlinejoboutbox/onlinejobmodel.cpp b/kmymoney/plugins/views/onlinejoboutbox/onlinejobmodel.cpp index 0547dca4c..7617ba485 100644 --- a/kmymoney/plugins/views/onlinejoboutbox/onlinejobmodel.cpp +++ b/kmymoney/plugins/views/onlinejoboutbox/onlinejobmodel.cpp @@ -1,281 +1,281 @@ /* * This file is part of KMyMoney, A Personal Finance Manager by KDE * Copyright (C) 2013-2015 Christian Dávid * * 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 . */ #include "onlinejobmodel.h" #include #include #include #include "mymoneyobject.h" #include "mymoneyfile.h" #include "mymoneyaccount.h" #include "mymoneyutils.h" #include "onlinetasks/interfaces/tasks/onlinetask.h" #include "onlinetasks/interfaces/tasks/credittransfer.h" #include "mymoney/onlinejobtyped.h" #include "payeeidentifier.h" #include "payeeidentifiertyped.h" #include "payeeidentifier/ibanbic/ibanbic.h" #include "icons/icons.h" #include "mymoneyexception.h" #include "mymoneyenums.h" #include "mymoneymoney.h" #include "mymoneysecurity.h" using namespace Icons; onlineJobModel::onlineJobModel(QObject *parent) : QAbstractTableModel(parent), m_jobIdList(QStringList()) { MyMoneyFile *const file = MyMoneyFile::instance(); connect(file, &MyMoneyFile::objectAdded, this, &onlineJobModel::slotObjectAdded); connect(file, &MyMoneyFile::objectModified, this, &onlineJobModel::slotObjectModified); connect(file, &MyMoneyFile::objectRemoved, this, &onlineJobModel::slotObjectRemoved); } void onlineJobModel::load() { unload(); beginInsertRows(QModelIndex(), 0, 0); foreach (const onlineJob job, MyMoneyFile::instance()->onlineJobList()) { m_jobIdList.append(job.id()); } endInsertRows(); } void onlineJobModel::unload() { if (!m_jobIdList.isEmpty()) { beginResetModel(); m_jobIdList.clear(); endResetModel(); } } int onlineJobModel::rowCount(const QModelIndex & parent) const { if (parent.isValid()) return 0; return m_jobIdList.count(); } int onlineJobModel::columnCount(const QModelIndex & parent) const { if (parent.isValid()) return 0; return 4; } QVariant onlineJobModel::headerData(int section, Qt::Orientation orientation, int role) const { if (role != Qt::DisplayRole) return QVariant(); if (orientation == Qt::Horizontal) { switch (section) { case columns::ColAccount: return i18n("Account"); case columns::ColAction: return i18n("Action"); case columns::ColDestination: return i18n("Destination"); case columns::ColValue: return i18n("Value"); } } return QVariant(); } /** * @todo LOW improve speed * @todo use now onlineJob system */ QVariant onlineJobModel::data(const QModelIndex & index, int role) const { if (index.parent().isValid()) return QVariant(); Q_ASSERT(m_jobIdList.length() > index.row()); onlineJob job; try { job = MyMoneyFile::instance()->getOnlineJob(m_jobIdList[index.row()]); } catch (const MyMoneyException &) { return QVariant(); } // id of MyMoneyObject if (role == roles::OnlineJobId) return QVariant::fromValue(job.id()); else if (role == roles::OnlineJobRole) return QVariant::fromValue(job); // If job is null, display an error message and exit if (job.isNull()) { if (index.column() == columns::ColAction) { switch (role) { case Qt::DisplayRole: return i18n("Not able to display this job."); case Qt::ToolTipRole: return i18n("Could not find a plugin to display this job or it does not contain any data."); } } return QVariant(); } // Show general information if (index.column() == columns::ColAccount) { // Account column if (role == Qt::DisplayRole) { return QVariant::fromValue(job.responsibleMyMoneyAccount().name()); } else if (role == Qt::DecorationRole) { if (job.isLocked()) return Icons::get(Icon::TaskOngoing); switch (job.bankAnswerState()) { case eMyMoney::OnlineJob::sendingState::acceptedByBank: return Icons::get(Icon::TaskComplete); case eMyMoney::OnlineJob::sendingState::sendingError: case eMyMoney::OnlineJob::sendingState::abortedByUser: case eMyMoney::OnlineJob::sendingState::rejectedByBank: return Icons::get(Icon::TaskReject); case eMyMoney::OnlineJob::sendingState::noBankAnswer: break; } if (job.sendDate().isValid()) { return Icons::get(Icon::TaskAccepted); } else if (!job.isValid()) { - return Icons::get(Icon::TaskAttention); + return Icons::get(Icon::Warning); } } else if (role == Qt::ToolTipRole) { if (job.isLocked()) return i18n("Job is being processed at the moment."); switch (job.bankAnswerState()) { case eMyMoney::OnlineJob::sendingState::acceptedByBank: return i18nc("Arg 1 is a date/time", "This job was accepted by the bank on %1.", job.bankAnswerDate().toString(Qt::DefaultLocaleShortDate)); case eMyMoney::OnlineJob::sendingState::sendingError: return i18nc("Arg 1 is a date/time", "Sending this job failed (tried on %1).", job.sendDate().toString(Qt::DefaultLocaleShortDate)); case eMyMoney::OnlineJob::sendingState::abortedByUser: return i18n("Sending this job was manually aborted."); case eMyMoney::OnlineJob::sendingState::rejectedByBank: return i18nc("Arg 1 is a date/time", "The bank rejected this job on %1.", job.bankAnswerDate().toString(Qt::DefaultLocaleShortDate)); case eMyMoney::OnlineJob::sendingState::noBankAnswer: if (job.sendDate().isValid()) return i18nc("Arg 1 is a date/time", "The bank accepted this job on %1.", job.sendDate().toString(Qt::DefaultLocaleShortDate)); else if (!job.isValid()) return i18n("This job needs further editing and cannot be sent therefore."); else return i18n("This job is ready for sending."); } } return QVariant(); } else if (index.column() == columns::ColAction) { if (role == Qt::DisplayRole) return QVariant::fromValue(job.task()->jobTypeName()); return QVariant(); } // Show credit transfer data try { onlineJobTyped transfer(job); if (index.column() == columns::ColValue) { if (role == Qt::DisplayRole) return QVariant::fromValue(MyMoneyUtils::formatMoney(transfer.task()->value(), transfer.task()->currency())); if (role == Qt::TextAlignmentRole) return int (Qt::AlignVCenter | Qt::AlignRight); } else if (index.column() == columns::ColDestination) { if (role == Qt::DisplayRole) { const payeeIdentifierTyped ibanBic(transfer.constTask()->beneficiary()); return QVariant(ibanBic->ownerName()); } } } catch (const MyMoneyException &) { } return QVariant(); } void onlineJobModel::reloadAll() { emit dataChanged(index(rowCount() - 1, 0), index(rowCount() - 1, columnCount() - 1)); } /** * This method removes the rows from MyMoneyFile. */ bool onlineJobModel::removeRow(int row, const QModelIndex& parent) { if (parent.isValid()) return false; Q_ASSERT(m_jobIdList.count() < row); MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyFileTransaction transaction; const onlineJob job = file->getOnlineJob(m_jobIdList[row]); file->removeOnlineJob(job); transaction.commit(); return true; } /** * This method removes the rows from MyMoneyFile. */ bool onlineJobModel::removeRows(int row, int count, const QModelIndex & parent) { if (parent.isValid()) return false; Q_ASSERT(m_jobIdList.count() > row); Q_ASSERT(m_jobIdList.count() >= (row + count)); MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyFileTransaction transaction; for (int i = 0; i < count; ++i) { const onlineJob job = file->getOnlineJob(m_jobIdList[row+i]); file->removeOnlineJob(job); } transaction.commit(); return true; } void onlineJobModel::slotObjectAdded(eMyMoney::File::Object objType, const QString& id) { if (Q_LIKELY(objType != eMyMoney::File::Object::OnlineJob)) return; beginInsertRows(QModelIndex(), rowCount(), rowCount()); m_jobIdList.append(id); endInsertRows(); } void onlineJobModel::slotObjectModified(eMyMoney::File::Object objType, const QString& id) { if (Q_LIKELY(objType != eMyMoney::File::Object::OnlineJob)) return; int row = m_jobIdList.indexOf(id); if (row != -1) emit dataChanged(index(row, 0), index(row, columnCount() - 1)); } void onlineJobModel::slotObjectRemoved(eMyMoney::File::Object objType, const QString& id) { if (Q_LIKELY(objType != eMyMoney::File::Object::OnlineJob)) return; int row = m_jobIdList.indexOf(id); if (row != -1) { m_jobIdList.removeAll(id); beginRemoveRows(QModelIndex(), row, row); endRemoveRows(); } } diff --git a/kmymoney/widgets/registersearchline.cpp b/kmymoney/widgets/registersearchline.cpp index 760506b9f..7de87c3e1 100644 --- a/kmymoney/widgets/registersearchline.cpp +++ b/kmymoney/widgets/registersearchline.cpp @@ -1,253 +1,253 @@ /* * Copyright 2007-2018 Thomas Baumgart * Copyright 2017-2018 Łukasz Wojniłowicz * * 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 . */ #include "registersearchline.h" // ---------------------------------------------------------------------------- // QT Includes #include #include #include #include #include #include // ---------------------------------------------------------------------------- // KDE Includes #include #include // ---------------------------------------------------------------------------- // Project Includes #include "kmymoneyutils.h" #include "register.h" #include "registeritem.h" #include "registerfilter.h" #include "icons/icons.h" #include "widgetenums.h" using namespace eWidgets; using namespace KMyMoneyRegister; using namespace Icons; class RegisterSearchLine::RegisterSearchLinePrivate { public: RegisterSearchLinePrivate() : reg(0), combo(0), queuedSearches(0), status(eRegister::ItemState::Any) {} Register* reg; KComboBox* combo; QString search; int queuedSearches; eRegister::ItemState status; }; RegisterSearchLine::RegisterSearchLine(QWidget* parent, Register* reg) : KLineEdit(parent), d(new RegisterSearchLinePrivate) { setClearButtonEnabled(true); if (!parentWidget()->layout()) parentWidget()->setLayout(new QHBoxLayout); parentWidget()->layout()->addWidget(this); d->reg = reg; connect(this, &QLineEdit::textChanged, this, &RegisterSearchLine::queueSearch); QLabel* label = new QLabel(i18nc("label for status combo", "Stat&us"), parentWidget()); parentWidget()->layout()->addWidget(label); d->combo = new KComboBox(parentWidget()); parentWidget()->layout()->addWidget(d->combo); // don't change the order of the following lines unless updating // the case labels in RegisterSearchLine::itemMatches() at the same time d->combo->insertItem((int)eRegister::ItemState::Any, Icons::get(Icon::Unknown), i18n("Any status")); d->combo->insertItem((int)eRegister::ItemState::Imported, Icons::get(Icon::DocumentImport), i18n("Imported")); d->combo->insertItem((int)eRegister::ItemState::Matched, Icons::get(Icon::TransactionMatch), i18n("Matched")); - d->combo->insertItem((int)eRegister::ItemState::Erroneous, Icons::get(Icon::TaskAttention), i18n("Erroneous")); + d->combo->insertItem((int)eRegister::ItemState::Erroneous, Icons::get(Icon::Warning), i18n("Erroneous")); d->combo->insertItem((int)eRegister::ItemState::Scheduled, Icons::get(Icon::ViewSchedules), i18n("Scheduled")); d->combo->insertItem((int)eRegister::ItemState::NotMarked, i18n("Not marked")); d->combo->insertItem((int)eRegister::ItemState::NotReconciled, i18n("Not reconciled")); d->combo->insertItem((int)eRegister::ItemState::Cleared, i18nc("Reconciliation state 'Cleared'", "Cleared")); d->combo->setCurrentIndex((int)eRegister::ItemState::Any); connect(d->combo, static_cast(&QComboBox::activated), this, &RegisterSearchLine::slotStatusChanged); label->setBuddy(d->combo); if (reg) { connect(reg, &QObject::destroyed, this, &RegisterSearchLine::registerDestroyed); connect(reg, &Register::itemAdded, this, &RegisterSearchLine::itemAdded); } else { setEnabled(false); } } RegisterSearchLine::~RegisterSearchLine() { delete d; } void RegisterSearchLine::setRegister(Register* reg) { if (d->reg) { disconnect(d->reg, &QObject::destroyed, this, &RegisterSearchLine::registerDestroyed); disconnect(d->reg, &Register::itemAdded, this, &RegisterSearchLine::itemAdded); } d->reg = reg; if (reg) { connect(reg, &QObject::destroyed, this, &RegisterSearchLine::registerDestroyed); connect(reg, &Register::itemAdded, this, &RegisterSearchLine::itemAdded); } setEnabled(reg != 0); } void RegisterSearchLine::slotStatusChanged(int status) { d->status = static_cast(status); updateSearch(); } void RegisterSearchLine::queueSearch(const QString& search) { d->queuedSearches++; d->search = search; QTimer::singleShot(200, this, SLOT(activateSearch())); } void RegisterSearchLine::activateSearch() { --(d->queuedSearches); if (d->queuedSearches == 0) updateSearch(d->search); } void RegisterSearchLine::updateSearch(const QString& s) { if (!d->reg) return; d->search = s.isNull() ? text() : s; // keep track of the current focus item RegisterItem* focusItem = d->reg->focusItem(); bool enabled = d->reg->updatesEnabled(); d->reg->setUpdatesEnabled(false); bool scrollBarVisible = d->reg->verticalScrollBar()->isVisible(); RegisterFilter filter(d->search, d->status); RegisterItem* p = d->reg->firstItem(); for (; p; p = p->nextItem()) { p->setVisible(p->matches(filter)); } d->reg->suppressAdjacentMarkers(); d->reg->updateAlternate(); d->reg->setUpdatesEnabled(enabled); // if focus item is still visible, then make sure we have // it on screen if (focusItem && focusItem->isVisible()) { d->reg->update(); /* it's totally fine to call ensureFocusItemVisible instantly * while narrowing (by adding another letter) filtered results * because removing items from QTableWidget is fast * but while widening (by removing some letter) filtered results * QTableWidget lags and ensureFocusItemVisible() happens before * its update and focused item isn't made visible therefore */ QTimer::singleShot(500, d->reg, SLOT(ensureFocusItemVisible())); } // if the scrollbar's visibility changed, we need to resize the contents if (scrollBarVisible != d->reg->verticalScrollBar()->isVisible()) { d->reg->resize((int)eTransaction::Column::Detail); } } void RegisterSearchLine::itemAdded(RegisterItem* item) const { item->setVisible(item->matches(RegisterFilter(text(), d->status))); } void RegisterSearchLine::registerDestroyed() { d->reg = 0; setEnabled(false); } class RegisterSearchLineWidget::RegisterSearchLineWidgetPrivate { public: RegisterSearchLineWidgetPrivate() : reg(0), searchLine(0) {} Register* reg; RegisterSearchLine* searchLine; }; RegisterSearchLineWidget::RegisterSearchLineWidget(Register* reg, QWidget* parent) : QWidget(parent), d(new RegisterSearchLineWidgetPrivate) { d->reg = reg; createWidgets(); } RegisterSearchLineWidget::~RegisterSearchLineWidget() { delete d; } RegisterSearchLine* RegisterSearchLineWidget::createSearchLine(Register* reg) { if (!d->searchLine) d->searchLine = new RegisterSearchLine(this, reg); return d->searchLine; } void RegisterSearchLineWidget::createWidgets() { QHBoxLayout *searchLineLayout = new QHBoxLayout(this); searchLineLayout->setSpacing(0); searchLineLayout->setContentsMargins(0, 0, 0, 0); QLabel *label = new QLabel(i18nc("Filter widget label", "Fi<er:"), this); searchLineLayout->addWidget(label); d->searchLine = createSearchLine(d->reg); d->searchLine->show(); label->setBuddy(d->searchLine); label->show(); } RegisterSearchLine* RegisterSearchLineWidget::searchLine() const { return d->searchLine; }