entrypushbutton: explicitly search for max icon size

This commit is contained in:
Albert S. 2019-08-23 23:40:08 +02:00
부모 4c4b5280b9
커밋 69cc2710c3

파일 보기

@ -22,7 +22,16 @@ EntryPushButton::EntryPushButton(const EntryConfig &config) : QPushButton()
this->setIcon(config.icon);
if(!config.icon.availableSizes().isEmpty())
{
this->setIconSize(config.icon.availableSizes().first());
auto sizes = config.icon.availableSizes();
QSize maxSize = sizes.first();
for(QSize &current : sizes)
{
if(current.width() > maxSize.width())
{
maxSize = current;
}
}
this->setIconSize(maxSize);
}
this->config = config;
connect(this, SIGNAL(clicked()), this, SLOT(emitOwnClicked()));