ProjectExplorer: Fix some problems with plugin unloading

It was not possible to return false from
ProjectExplorerPlugin::initialize() without triggering crashes.

Change-Id: I96b2f80c835e69769f64f9b9c61f473e9ff88623
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-10-15 14:08:02 +02:00
parent 42fba8ee3b
commit e90a48e639
6 changed files with 17 additions and 2 deletions

View File

@@ -176,7 +176,7 @@ void FancyToolButton::paintEvent(QPaintEvent *event)
: QIcon::Disabled;
QRect iconRect(0, 0, Constants::MODEBAR_ICON_SIZE, Constants::MODEBAR_ICON_SIZE);
const bool isTitledAction = defaultAction()->property("titledAction").toBool();
const bool isTitledAction = defaultAction() && defaultAction()->property("titledAction").toBool();
// draw popup texts
if (isTitledAction && !m_iconsOnly) {
QFont normalFont(painter.font());
@@ -286,7 +286,7 @@ QSize FancyToolButton::sizeHint() const
}
QSizeF buttonSize = iconSize().expandedTo(QSize(64, 38));
if (defaultAction()->property("titledAction").toBool()) {
if (defaultAction() && defaultAction()->property("titledAction").toBool()) {
QFont boldFont(font());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize());
boldFont.setBold(true);