summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/graphicsview/diagramscene/mainwindow.cpp')
-rw-r--r--examples/widgets/graphicsview/diagramscene/mainwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/graphicsview/diagramscene/mainwindow.cpp b/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
index 3e158489c1..39ebe48488 100644
--- a/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
+++ b/examples/widgets/graphicsview/diagramscene/mainwindow.cpp
@@ -340,8 +340,7 @@ void MainWindow::createToolBox()
QToolButton *textButton = new QToolButton;
textButton->setCheckable(true);
buttonGroup->addButton(textButton, InsertTextButton);
- textButton->setIcon(QIcon(QPixmap(":/images/textpointer.png")
- .scaled(30, 30)));
+ textButton->setIcon(QIcon(QPixmap(":/images/textpointer.png")));
textButton->setIconSize(QSize(50, 50));
QGridLayout *textLayout = new QGridLayout;
textLayout->addWidget(textButton, 0, 0, Qt::AlignHCenter);
@@ -639,8 +638,9 @@ QIcon MainWindow::createColorToolButtonIcon(const QString &imageFile,
pixmap.fill(Qt::transparent);
QPainter painter(&pixmap);
QPixmap image(imageFile);
- QRect target(0, 0, 50, 60);
- QRect source(0, 0, 42, 42);
+ // Draw icon centred horizontally on button.
+ QRect target(4, 0, 42, 43);
+ QRect source(0, 0, 42, 43);
painter.fillRect(QRect(0, 60, 50, 80), color);
painter.drawPixmap(target, image, source);