i92guboj
22nd August 2013, 16:04
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);
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 :)
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);
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 :)