From 84170a935d0ce7278f7c61206a74a8990e9e4f63 Mon Sep 17 00:00:00 2001 From: Albert S Date: Mon, 3 Jun 2019 07:44:48 +0200 Subject: [PATCH] entrypushbutton: do not add icon from list if list is empty (crashes in debug builds) --- entrypushbutton.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/entrypushbutton.cpp b/entrypushbutton.cpp index b68dc5d..999e0cf 100644 --- a/entrypushbutton.cpp +++ b/entrypushbutton.cpp @@ -20,7 +20,10 @@ EntryPushButton::EntryPushButton(const EntryConfig &config) : QPushButton() this->setText(config.name); this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); this->setIcon(config.icon); - this->setIconSize(config.icon.availableSizes().first()); + if(!config.icon.availableSizes().isEmpty()) + { + this->setIconSize(config.icon.availableSizes().first()); + } this->config = config; connect(this, SIGNAL(clicked()), this, SLOT(emitOwnClicked())); }