diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2012-11-19 16:52:47 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-21 16:36:50 +0100 |
commit | 91abfd521a1c719d7dc68e562a5486fc206b1f32 (patch) | |
tree | a59fdf481b2c1792885dc489ef833a4bba1633ee /examples/widgets/graphicsview/diagramscene/mainwindow.cpp | |
parent | 626283740f9e670a9756e792d36b7cfe6a02cf45 (diff) |
Clean up diagramscene example's toolbutton icons.
Remove artefacts from pointer.png.
Replace several PNGs with images without artefacts (used FreeSerif as
the font).
Stopped scaling images up in MainWindow::createColorToolButtonIcon.
Change-Id: I7adf2deea73b89c631d39d575804e8d3f58c9fe1
Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
Diffstat (limited to 'examples/widgets/graphicsview/diagramscene/mainwindow.cpp')
-rw-r--r-- | examples/widgets/graphicsview/diagramscene/mainwindow.cpp | 8 |
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); |