From 91abfd521a1c719d7dc68e562a5486fc206b1f32 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 19 Nov 2012 16:52:47 +0100 Subject: 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 --- examples/widgets/graphicsview/diagramscene/mainwindow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/widgets/graphicsview/diagramscene/mainwindow.cpp') 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); -- cgit v1.2.3