26 #include <QAbstractItemView>
37 , m_currentWeight(0.35)
42 setEditable (
false );
51 , m_currentWeight(0.35)
53 , m_iconHeight(height)
56 setEditable (
false );
70 this->blockSignals(
true);
78 this->view()->setTextElideMode(Qt::ElideNone);
83 addItem(
createIcon(2.00),
"0.13mm (ISO)", 0.13);
85 addItem(
createIcon(2.00),
"0.18mm (ISO)", 0.18);
87 addItem(
createIcon(3.00),
"0.25mm (ISO)", 0.25);
89 addItem(
createIcon(3.00),
"0.35mm (ISO)", 0.35);
91 addItem(
createIcon(4.00),
"0.50mm (ISO)", 0.50);
94 addItem(
createIcon(4.00),
"0.70mm (ISO)", 0.70);
97 addItem(
createIcon(6.00),
"1.00mm (ISO)", 1.00);
100 addItem(
createIcon(7.00),
"1.40mm (ISO)", 1.40);
102 addItem(
createIcon(8.00),
"2.00mm (ISO)", 2.00);
104 setMaxVisibleItems(24);
106 this->blockSignals(
false);
125 setCurrentIndex(findData(weight));
127 if (currentIndex()!= count() -1 )
139 QVariant weight = itemData(index);
140 if(weight != QVariant::Invalid )
151 pixmap.fill(Qt::black);
153 QPen pen(Qt::black, width, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
155 QPainter painter(&pixmap);
160 return QIcon(pixmap);
void updateLineWeight(int index)
QIcon createIcon(const qreal &width)
virtual ~LineWeightComboBox()
LineWeightComboBox(QWidget *parent=nullptr, const char *name=nullptr)
qreal getLineWeight() const
void setLineWeight(const qreal &weight)
void lineWeightChanged(const qreal &weight)