From cfa69dbbcc6d6f9b85a71961c3d60d9e9e690e2b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 17 Sep 2015 08:54:38 +0300 Subject: [PATCH] ModelEditor: Fix MSVC compilation QStringLiteral does not work with split string literal and MSVC. Only the first part gets a 'L' prepended, and an "error C2308: concatenating mismatched strings" is generated. Change-Id: I3edf1259103ea5168aef06c0a81aab4a381d0f83 Reviewed-by: David Schulz --- src/plugins/modeleditor/abstracteditor.cpp | 24 +++++++++++----------- src/plugins/modeleditor/actionhandler.cpp | 9 ++++---- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/plugins/modeleditor/abstracteditor.cpp b/src/plugins/modeleditor/abstracteditor.cpp index 0b45535f0d8..dd9fec7c011 100644 --- a/src/plugins/modeleditor/abstracteditor.cpp +++ b/src/plugins/modeleditor/abstracteditor.cpp @@ -164,18 +164,18 @@ void AbstractEditor::init(QWidget *parent) d->leftToolBox->setStyle(windowsStyle); // TODO improve this (and the diagram colors) for use with dark theme d->leftToolBox->setStyleSheet( - QStringLiteral("QToolBox::tab {" - " margin-left: 2px;" - " background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," - " stop: 0 #E1E1E1, stop: 0.4 #DDDDDD," - " stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);" - " color: #606060;" - "}" - "" - "QToolBox::tab:selected {" - " font: italic;" - " color: black;" - "}")); + QLatin1String("QToolBox::tab {" + " margin-left: 2px;" + " background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," + " stop: 0 #E1E1E1, stop: 0.4 #DDDDDD," + " stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);" + " color: #606060;" + "}" + "" + "QToolBox::tab:selected {" + " font: italic;" + " color: black;" + "}")); QFont font; font.setPointSizeF(font.pointSizeF() * 0.8); d->leftToolBox->setFont(font); diff --git a/src/plugins/modeleditor/actionhandler.cpp b/src/plugins/modeleditor/actionhandler.cpp index 5554a8b3c16..13be8d43269 100644 --- a/src/plugins/modeleditor/actionhandler.cpp +++ b/src/plugins/modeleditor/actionhandler.cpp @@ -130,10 +130,11 @@ void ActionHandler::createActions() medit->addAction(deleteCommand, Core::Constants::G_EDIT_COPYPASTE); d->deleteAction = deleteCommand->action(); d->selectAllAction = registerCommand(Core::Constants::SELECTALL, [this]() { selectAll(); })->action(); - registerCommand(Constants::ACTION_ADD_PACKAGE, 0); - registerCommand(Constants::ACTION_ADD_COMPONENT, 0); - registerCommand(Constants::ACTION_ADD_CLASS, 0); - registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, 0); + const std::function emptySlot; + registerCommand(Constants::ACTION_ADD_PACKAGE, emptySlot); + registerCommand(Constants::ACTION_ADD_COMPONENT, emptySlot); + registerCommand(Constants::ACTION_ADD_CLASS, emptySlot); + registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, emptySlot); } void ActionHandler::createEditPropertiesShortcut(const Core::Id &shortcutId)