- QPixmap pixmap(64, 64);
- QPainter painter;
- painter.begin(&pixmap);
- painter.fillRect(pixmap.rect(), scheme.at(i));
- painter.end();
-
- QPushButton *button = new QPushButton(pixmap, "", this);
- button->setFixedSize(48, 48);
- layout->addWidget(button);
+ ColorButton *button = new ColorButton(this, i);
+ layout->addWidget(button, (i - (i % 3)) / 3, i % 3);