Hello.
Is there any way to fill the whole button with its assigned icon?
I am doing it this way, so that images should exactly match the size of the buttons, but there's always an empty margin around the images.
QSize size
= ui
->plano_1
->size
();
qDebug
() << Q_FUNC_INFO <<
QString("icon size: %1,%2").
arg(size.
width()).
arg(size.
height());
ui
->plano_1
->setIcon
(QIcon(myBudget
->getPlano
(1)));
ui->plano_1->setIconSize(size);
ui->plano_1->setContentsMargins(0, 0, 0, 0);
QSize size = ui->plano_1->size();
qDebug() << Q_FUNC_INFO << QString("icon size: %1,%2").arg(size.width()).arg(size.height());
ui->plano_1->setIcon(QIcon(myBudget->getPlano(1)));
ui->plano_1->setIconSize(size);
ui->plano_1->setContentsMargins(0, 0, 0, 0);
To copy to clipboard, switch view to plain text mode
As you see, I also tried using setContentsMargins(0,0,0,0). But it doesn't seem to make any difference.
Thank you for any response
Bookmarks