[vlc-devel] [PATCH] qt/pref: fix toolbar icon or text beeing cropped on Hi-DPI displays

Francois Cartegnie fcvlcdev at free.fr
Wed Sep 13 14:18:08 CEST 2017

Le 13/09/2017 à 14:10, pierre a écrit :
>     QToolButton* btnOk = new QToolButton();
>     //icon.png is 64x64
>     btnOk->setIcon(QIcon(":/img/icon.png"));
>     btnOk->setIconSize(QSize(40, 40));
>     btnOk->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
>     btnOk->setText("not cropped");
>     QToolButton* btnKo = new QToolButton();
>     btnKo->setIcon(QIcon(":/img/icon.png"));
>     btnKo->setIconSize(QSize(120, 40));
>     btnKo->setText("cropped");
>     btnKo->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);

And that's what documentation says and explains cropping:

"The default size is defined by the GUI style. This is a maximum size
for the icons. Smaller icons will not be scaled up."

So an arbitrary 40px. It really needs the real size.

Francois Cartegnie
VideoLAN - VLC Developer

More information about the vlc-devel mailing list