From 69cc2710c3564cdaf113aa6e0e76f6a69c6e900b Mon Sep 17 00:00:00 2001 From: Albert S Date: Fri, 23 Aug 2019 23:40:08 +0200 Subject: [PATCH] entrypushbutton: explicitly search for max icon size --- entrypushbutton.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/entrypushbutton.cpp b/entrypushbutton.cpp index 999e0cf..3aca82d 100644 --- a/entrypushbutton.cpp +++ b/entrypushbutton.cpp @@ -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 ¤t : sizes) + { + if(current.width() > maxSize.width()) + { + maxSize = current; + } + } + this->setIconSize(maxSize); } this->config = config; connect(this, SIGNAL(clicked()), this, SLOT(emitOwnClicked()));