QToolButton icon scaled down on Windows - why?
-
Hi,
Could you check whether both returns the same iconSize ?
-
Both places return QSize(32, 32) , which makes sense, since I'm setting the size with setIconSize(QSize(32, 32)) .
Windows:
!http://i39.tinypic.com/2qbvm2t.png()!Mac:
!http://i39.tinypic.com/30c4t9t.png()!Edit: I should perhaps mention that the buttons are added to the toolbar portion of a window, and then grouped with a QButtonGroup.
-
bq. Edit: I should perhaps mention that the buttons are added to the toolbar portion of a window, and then grouped with a QButtonGroup
I guess the tool bar's icon size is applied just to its children if applicable, and is N/A for the button group(it hasn't an iconSize to propagate to its children on) ... so you need to set the icon size expplicitely to each tool button and it would work
-
ah, ok ... I have thought you setIconSize by tool bar
but anyway I tested this and it works:
@
ui->setupUi(this);
QToolButton *button1 = new QToolButton;
QToolButton *button2 = new QToolButton;
QToolButton *button3 = new QToolButton;
QGroupBox *groupBox = new QGroupBox();
button1->setText("Button 1");
button1->setIconSize(QSize(32,32));
button1->setIcon(QIcon("test.ico"));
button2->setText("Button 2");
button3->setText("Button 3");
QHBoxLayout *hbox = new QHBoxLayout;
hbox->setContentsMargins(0, 0, 0, 0);
hbox ->addWidget(button1);
hbox ->addWidget(button2);
hbox ->addWidget(button3);
groupBox->setLayout(hbox);
ui->mainToolBar->addWidget(groupBox); @ -
yes!
I tested with qt 5.1.1 mingw and qt 5.2.0 beta VS 2010 on Windows XP ... on both it's working fine -
Sounds like it could be a Windows specific bug. Did you check on the "bug report system":http://bugreports.qt-project.org whether something like that was reported ?
-
Not necessarily, there can be regressions/subtle differences between platforms.
Then you can open a new report with a minimal compilable example that helps reproduce the behavior. Providing the link here would be a plus
-
-
Seems like it's a problem on Windows 7 as well. Added this to the bug report. I could sort of accept that this was a problem on XP only, but not across the whole Windows line as it seems. I'm wondering why no-one else notices things like this? Given the amount of bug reports from me alone regarding widgets (especially on the Mac), I'm gonna hit an email to Digia, having ranted basically everywhere else about the state of Widgets and desktop platforms to no avail. This is soooo frustrating!