7 #include <QAbstractItemView>
10 #include "../vtools/tools/vabstracttool.h"
11 #include "../vmisc/logging.h"
12 #include "../ifc/ifcdef.h"
16 Q_LOGGING_CATEGORY(colorComboBox,
"color_combobox")
23 , m_currentColor("black")
37 , m_currentColor(
"black")
39 , m_iconHeight(height)
41 qCDebug(colorComboBox,
"ColorComboBox Constructor 2 used");
66 this->blockSignals(
true);
78 this->view()->setTextElideMode(Qt::ElideNone);
81 while (i != map.constEnd())
84 addItem(QIcon(pixmap), i.value(), QVariant(i.key()));
88 setMaxVisibleItems(map.size());
89 this->model()->sort(1, Qt::AscendingOrder);
93 this->blockSignals(
false);
100 qCDebug(colorComboBox,
"ColorComboBox::setColor");
103 setCurrentIndex(findData(color));
105 if (currentIndex()!= count() -1 )
117 qCDebug(colorComboBox,
"ColorComboBox::colorChanged");
119 QVariant color = itemData(index);
120 if(color != QVariant::Invalid )
void setColor(const QString &color)
void colorChangedSignal(const QString &color)
void colorChanged(int index)
ColorComboBox(QWidget *parent=nullptr, const char *name=nullptr)
void setItems(QMap< QString, QString > map)
const QString ColorByGroup