Icon: Pass const reference to QList in c'tor

Change-Id: I8e009cdd29d08fc0dbcac3c812885779c928337c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2023-07-20 12:38:52 +02:00
parent 635e8c1614
commit e8669653f1
2 changed files with 4 additions and 4 deletions

View File

@@ -134,15 +134,15 @@ static QPixmap masksToIcon(const MasksAndColors &masks, const QPixmap &combinedM
Icon::Icon() = default; Icon::Icon() = default;
Icon::Icon(QList<IconMaskAndColor> args, Icon::IconStyleOptions style) Icon::Icon(const QList<IconMaskAndColor> &args, Icon::IconStyleOptions style)
: m_iconSourceList(std::move(args)) : m_iconSourceList(args)
, m_style(style) , m_style(style)
{ {
} }
Icon::Icon(const FilePath &imageFileName) Icon::Icon(const FilePath &imageFileName)
: m_iconSourceList({{imageFileName, Theme::Color(-1)}})
{ {
m_iconSourceList.append({imageFileName, Theme::Color(-1)});
} }
QIcon Icon::icon() const QIcon Icon::icon() const

View File

@@ -40,7 +40,7 @@ public:
Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption) Q_DECLARE_FLAGS(IconStyleOptions, IconStyleOption)
Icon(); Icon();
Icon(QList<IconMaskAndColor> args, IconStyleOptions style = ToolBarStyle); Icon(const QList<IconMaskAndColor> &args, IconStyleOptions style = ToolBarStyle);
Icon(const FilePath &imageFileName); Icon(const FilePath &imageFileName);
QIcon icon() const; QIcon icon() const;