forked from qt-creator/qt-creator
Utils: Add an Icon::combinedIcon convenience override
...which takes a list of Utils::Icon. This will be used more often in upcoming changes. Change-Id: Id5ba1616c6ad393b1603043980ad7ec8315738d2 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "icon.h"
|
||||
#include "qtcassert.h"
|
||||
#include "theme/theme.h"
|
||||
@@ -252,4 +253,10 @@ QIcon Icon::combinedIcon(const QList<QIcon> &icons)
|
||||
return result;
|
||||
}
|
||||
|
||||
QIcon Icon::combinedIcon(const QList<Icon> &icons)
|
||||
{
|
||||
const QList<QIcon> qIcons = transform(icons, &Icon::icon);
|
||||
return combinedIcon(qIcons);
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -76,8 +76,9 @@ public:
|
||||
// Like sideBarIcon plus added action mode for the flat icon
|
||||
static QIcon modeIcon(const Icon &classic, const Icon &flat, const Icon &flatActive);
|
||||
|
||||
// Combined icon pixmaps in Normal and Disabled states from several QIcons
|
||||
// Combined icon pixmaps in Normal and Disabled states from several Icons
|
||||
static QIcon combinedIcon(const QList<QIcon> &icons);
|
||||
static QIcon combinedIcon(const QList<Icon> &icons);
|
||||
|
||||
private:
|
||||
IconStyleOptions m_style = None;
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include "../runnables.h"
|
||||
|
||||
#include <ssh/sshconnection.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/icon.h>
|
||||
#include <utils/portlist.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -409,9 +408,7 @@ void IDevice::setDeviceIcon(const QList<Utils::Icon> &deviceIcon)
|
||||
|
||||
QIcon IDevice::deviceIcon() const
|
||||
{
|
||||
const QList<QIcon> icons =
|
||||
Utils::transform(d->deviceIcons, [](const Utils::Icon &icon){return icon.icon();});
|
||||
return Utils::Icon::combinedIcon(icons);
|
||||
return Utils::Icon::combinedIcon(d->deviceIcons);
|
||||
}
|
||||
|
||||
QSsh::SshConnectionParameters IDevice::sshParameters() const
|
||||
|
Reference in New Issue
Block a user