27 #include <QAbstractItemView>
32 #include "../vtools/tools/vabstracttool.h"
33 #include "../vmisc/logging.h"
35 Q_LOGGING_CATEGORY(fillComboBox,
"fill_combobox")
60 , m_iconHeight(height)
77 qCDebug(fillComboBox,
"PieceFillComboBox::init");
78 this->blockSignals(
true);
104 setMaxVisibleItems(15);
105 this->model()->sort(1, Qt::AscendingOrder);
111 this->blockSignals(
false);
121 setCurrentIndex(findData(fill));
123 if (currentIndex()!= count() -1 )
137 QPixmap pixmap(w, h);
138 pixmap.fill(QColor(Qt::black));
139 QPainter painter(&pixmap);
140 painter.fillRect(1, 1, w-2, h-2, QColor(Qt::white));
141 painter.fillRect(1, 1, w-2, h-2, style);
153 QVariant fill = itemData(index);
154 if(fill != QVariant::Invalid )
void fillChangedSignal(const QString &fill)
void setFill(const QString &fill)
virtual ~PieceFillComboBox()
void fillChanged(int index)
QPixmap createFillIcon(const int w, const int h, Qt::BrushStyle style)
PieceFillComboBox(QWidget *parent=nullptr, const char *name=nullptr)
const QString FilldDiagonalCross
const QString FillBackwardDiagonal
const QString FillHorizLines
const QString FillVertLines
const QString FillForwardDiagonal