forked from qt-creator/qt-creator
ModelEditor: Remove QStringLiteral from plugin code
Change-Id: Ia88af8340540790bb6922682166c662863ebcaa3 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -160,7 +160,7 @@ void ActionHandler::createActions()
|
|||||||
d->removeAction = removeCommand->action();
|
d->removeAction = removeCommand->action();
|
||||||
Core::Command *deleteCommand = registerCommand(
|
Core::Command *deleteCommand = registerCommand(
|
||||||
Constants::DELETE_SELECTED_ELEMENTS, [this]() { deleteSelectedElements(); }, d->context, true,
|
Constants::DELETE_SELECTED_ELEMENTS, [this]() { deleteSelectedElements(); }, d->context, true,
|
||||||
tr("&Delete"), QKeySequence(QStringLiteral("Ctrl+D")));
|
tr("&Delete"), QKeySequence("Ctrl+D"));
|
||||||
medit->addAction(deleteCommand, Core::Constants::G_EDIT_COPYPASTE);
|
medit->addAction(deleteCommand, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
d->deleteAction = deleteCommand->action();
|
d->deleteAction = deleteCommand->action();
|
||||||
d->selectAllAction = registerCommand(Core::Constants::SELECTALL, [this]() { selectAll(); }, d->context)->action();
|
d->selectAllAction = registerCommand(Core::Constants::SELECTALL, [this]() { selectAll(); }, d->context)->action();
|
||||||
@@ -180,26 +180,26 @@ void ActionHandler::createActions()
|
|||||||
|
|
||||||
Core::Command *zoomInCommand = registerCommand(
|
Core::Command *zoomInCommand = registerCommand(
|
||||||
Constants::ZOOM_IN, [this]() { zoomIn(); }, d->context, true,
|
Constants::ZOOM_IN, [this]() { zoomIn(); }, d->context, true,
|
||||||
tr("Zoom In"), QKeySequence(QStringLiteral("Ctrl++")));
|
tr("Zoom In"), QKeySequence("Ctrl++"));
|
||||||
menuModelEditor->addAction(zoomInCommand);
|
menuModelEditor->addAction(zoomInCommand);
|
||||||
d->zoomInAction = zoomInCommand->action();
|
d->zoomInAction = zoomInCommand->action();
|
||||||
|
|
||||||
Core::Command *zoomOutCommand = registerCommand(
|
Core::Command *zoomOutCommand = registerCommand(
|
||||||
Constants::ZOOM_OUT, [this]() { zoomOut(); }, d->context, true,
|
Constants::ZOOM_OUT, [this]() { zoomOut(); }, d->context, true,
|
||||||
tr("Zoom Out"), QKeySequence(QStringLiteral("Ctrl+-")));
|
tr("Zoom Out"), QKeySequence("Ctrl+-"));
|
||||||
menuModelEditor->addAction(zoomOutCommand);
|
menuModelEditor->addAction(zoomOutCommand);
|
||||||
d->zoomOutAction = zoomOutCommand->action();
|
d->zoomOutAction = zoomOutCommand->action();
|
||||||
|
|
||||||
Core::Command *resetZoomCommand = registerCommand(
|
Core::Command *resetZoomCommand = registerCommand(
|
||||||
Constants::RESET_ZOOM, [this]() { resetZoom(); }, d->context, true,
|
Constants::RESET_ZOOM, [this]() { resetZoom(); }, d->context, true,
|
||||||
tr("Reset Zoom"), QKeySequence(QStringLiteral("Ctrl+0")));
|
tr("Reset Zoom"), QKeySequence("Ctrl+0"));
|
||||||
menuModelEditor->addAction(resetZoomCommand);
|
menuModelEditor->addAction(resetZoomCommand);
|
||||||
d->zoomOutAction = resetZoomCommand->action();
|
d->zoomOutAction = resetZoomCommand->action();
|
||||||
|
|
||||||
d->openParentDiagramAction = registerCommand(
|
d->openParentDiagramAction = registerCommand(
|
||||||
Constants::OPEN_PARENT_DIAGRAM, [this]() { openParentDiagram(); }, Core::Context(), true,
|
Constants::OPEN_PARENT_DIAGRAM, [this]() { openParentDiagram(); }, Core::Context(), true,
|
||||||
tr("Open Parent Diagram"), QKeySequence(QStringLiteral("Ctrl+Shift+P")))->action();
|
tr("Open Parent Diagram"), QKeySequence("Ctrl+Shift+P"))->action();
|
||||||
d->openParentDiagramAction->setIcon(QIcon(QStringLiteral(":/modeleditor/up.png")));
|
d->openParentDiagramAction->setIcon(QIcon(":/modeleditor/up.png"));
|
||||||
registerCommand(Constants::ACTION_ADD_PACKAGE, nullptr, Core::Context(), true, tr("Add Package"));
|
registerCommand(Constants::ACTION_ADD_PACKAGE, nullptr, Core::Context(), true, tr("Add Package"));
|
||||||
registerCommand(Constants::ACTION_ADD_COMPONENT, nullptr, Core::Context(), true, tr("Add Component"));
|
registerCommand(Constants::ACTION_ADD_COMPONENT, nullptr, Core::Context(), true, tr("Add Component"));
|
||||||
registerCommand(Constants::ACTION_ADD_CLASS, nullptr, Core::Context(), true, tr("Add Class"));
|
registerCommand(Constants::ACTION_ADD_CLASS, nullptr, Core::Context(), true, tr("Add Class"));
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void ClassViewController::appendClassDeclarationsFromSymbol(CPlusPlus::Symbol *s
|
|||||||
QString className = overview.prettyName(
|
QString className = overview.prettyName(
|
||||||
CPlusPlus::LookupContext::fullyQualifiedName(symbol));
|
CPlusPlus::LookupContext::fullyQualifiedName(symbol));
|
||||||
// Ignore private class created by Q_OBJECT macro
|
// Ignore private class created by Q_OBJECT macro
|
||||||
if (!className.endsWith(QStringLiteral("::QPrivateSignal")))
|
if (!className.endsWith("::QPrivateSignal"))
|
||||||
classNames->insert(className);
|
classNames->insert(className);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ void UpdateIncludeDependenciesVisitor::visitMComponent(qmt::MComponent *componen
|
|||||||
if (!haveDependency(component, includeComponent)) {
|
if (!haveDependency(component, includeComponent)) {
|
||||||
auto dependency = new qmt::MDependency;
|
auto dependency = new qmt::MDependency;
|
||||||
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
||||||
dependency->setStereotypes(QStringList() << QStringLiteral("include"));
|
dependency->setStereotypes(QStringList() << "include");
|
||||||
dependency->setDirection(qmt::MDependency::AToB);
|
dependency->setDirection(qmt::MDependency::AToB);
|
||||||
dependency->setSource(component->uid());
|
dependency->setSource(component->uid());
|
||||||
dependency->setTarget(includeComponent->uid());
|
dependency->setTarget(includeComponent->uid());
|
||||||
@@ -211,7 +211,7 @@ void UpdateIncludeDependenciesVisitor::visitMComponent(qmt::MComponent *componen
|
|||||||
auto dependency = new qmt::MDependency;
|
auto dependency = new qmt::MDependency;
|
||||||
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
||||||
// TODO set stereotype for testing purpose
|
// TODO set stereotype for testing purpose
|
||||||
dependency->setStereotypes(QStringList() << QStringLiteral("same stereotype"));
|
dependency->setStereotypes(QStringList() << "same stereotype");
|
||||||
dependency->setDirection(qmt::MDependency::AToB);
|
dependency->setDirection(qmt::MDependency::AToB);
|
||||||
dependency->setSource(componentAncestors.at(index1)->uid());
|
dependency->setSource(componentAncestors.at(index1)->uid());
|
||||||
dependency->setTarget(includeComponentAncestors.at(index2)->uid());
|
dependency->setTarget(includeComponentAncestors.at(index2)->uid());
|
||||||
@@ -232,7 +232,7 @@ void UpdateIncludeDependenciesVisitor::visitMComponent(qmt::MComponent *componen
|
|||||||
auto dependency = new qmt::MDependency;
|
auto dependency = new qmt::MDependency;
|
||||||
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
||||||
// TODO set stereotype for testing purpose
|
// TODO set stereotype for testing purpose
|
||||||
dependency->setStereotypes(QStringList() << QStringLiteral("ancestor"));
|
dependency->setStereotypes(QStringList() << "ancestor");
|
||||||
dependency->setDirection(qmt::MDependency::AToB);
|
dependency->setDirection(qmt::MDependency::AToB);
|
||||||
dependency->setSource(componentAncestors.at(componentHighestAncestorIndex)->uid());
|
dependency->setSource(componentAncestors.at(componentHighestAncestorIndex)->uid());
|
||||||
dependency->setTarget(includeComponentAncestors.at(includeComponentHighestAncestorIndex)->uid());
|
dependency->setTarget(includeComponentAncestors.at(includeComponentHighestAncestorIndex)->uid());
|
||||||
@@ -247,7 +247,7 @@ void UpdateIncludeDependenciesVisitor::visitMComponent(qmt::MComponent *componen
|
|||||||
auto dependency = new qmt::MDependency;
|
auto dependency = new qmt::MDependency;
|
||||||
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
dependency->setFlags(qmt::MElement::ReverseEngineered);
|
||||||
// TODO set stereotype for testing purpose
|
// TODO set stereotype for testing purpose
|
||||||
dependency->setStereotypes(QStringList() << QStringLiteral("parents"));
|
dependency->setStereotypes(QStringList() << "parents");
|
||||||
dependency->setDirection(qmt::MDependency::AToB);
|
dependency->setDirection(qmt::MDependency::AToB);
|
||||||
dependency->setSource(componentAncestors.at(0)->uid());
|
dependency->setSource(componentAncestors.at(0)->uid());
|
||||||
dependency->setTarget(includeComponentAncestors.at(0)->uid());
|
dependency->setTarget(includeComponentAncestors.at(0)->uid());
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ bool ElementTasks::hasClassDefinition(const qmt::MElement *element) const
|
|||||||
if (auto klass = dynamic_cast<const qmt::MClass *>(element)) {
|
if (auto klass = dynamic_cast<const qmt::MClass *>(element)) {
|
||||||
QString qualifiedClassName = klass->umlNamespace().isEmpty()
|
QString qualifiedClassName = klass->umlNamespace().isEmpty()
|
||||||
? klass->name()
|
? klass->name()
|
||||||
: klass->umlNamespace() + QStringLiteral("::") + klass->name();
|
: klass->umlNamespace() + "::" + klass->name();
|
||||||
|
|
||||||
CppTools::CppClassesFilter *classesFilter = ExtensionSystem::PluginManager::getObject<CppTools::CppClassesFilter>();
|
CppTools::CppClassesFilter *classesFilter = ExtensionSystem::PluginManager::getObject<CppTools::CppClassesFilter>();
|
||||||
if (!classesFilter)
|
if (!classesFilter)
|
||||||
@@ -142,7 +142,7 @@ void ElementTasks::openClassDefinition(const qmt::MElement *element)
|
|||||||
if (auto klass = dynamic_cast<const qmt::MClass *>(element)) {
|
if (auto klass = dynamic_cast<const qmt::MClass *>(element)) {
|
||||||
QString qualifiedClassName = klass->umlNamespace().isEmpty()
|
QString qualifiedClassName = klass->umlNamespace().isEmpty()
|
||||||
? klass->name()
|
? klass->name()
|
||||||
: klass->umlNamespace() + QStringLiteral("::") + klass->name();
|
: klass->umlNamespace() + "::" + klass->name();
|
||||||
|
|
||||||
CppTools::CppClassesFilter *classesFilter = ExtensionSystem::PluginManager::getObject<CppTools::CppClassesFilter>();
|
CppTools::CppClassesFilter *classesFilter = ExtensionSystem::PluginManager::getObject<CppTools::CppClassesFilter>();
|
||||||
if (!classesFilter)
|
if (!classesFilter)
|
||||||
@@ -424,7 +424,7 @@ bool ElementTasks::extendContextMenu(const qmt::DElement *delement, const qmt::M
|
|||||||
{
|
{
|
||||||
bool extended = false;
|
bool extended = false;
|
||||||
if (dynamic_cast<const qmt::DPackage *>(delement)) {
|
if (dynamic_cast<const qmt::DPackage *>(delement)) {
|
||||||
menu->addAction(new qmt::ContextMenuAction(tr("Update Include Dependencies"), QStringLiteral("updateIncludeDependencies"), menu));
|
menu->addAction(new qmt::ContextMenuAction(tr("Update Include Dependencies"), "updateIncludeDependencies", menu));
|
||||||
extended = true;
|
extended = true;
|
||||||
}
|
}
|
||||||
return extended;
|
return extended;
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void ModelEditor::init(QWidget *parent)
|
|||||||
|
|
||||||
d->leftToolBox = new QToolBox(d->leftGroup);
|
d->leftToolBox = new QToolBox(d->leftGroup);
|
||||||
// Windows style does not truncate the tab label to a very small width (GTK+ does)
|
// Windows style does not truncate the tab label to a very small width (GTK+ does)
|
||||||
static QStyle *windowsStyle = QStyleFactory().create(QStringLiteral("Windows"));
|
static QStyle *windowsStyle = QStyleFactory().create("Windows");
|
||||||
if (windowsStyle)
|
if (windowsStyle)
|
||||||
d->leftToolBox->setStyle(windowsStyle);
|
d->leftToolBox->setStyle(windowsStyle);
|
||||||
// TODO improve this (and the diagram colors) for use with dark theme
|
// TODO improve this (and the diagram colors) for use with dark theme
|
||||||
@@ -321,19 +321,19 @@ void ModelEditor::init(QWidget *parent)
|
|||||||
|
|
||||||
toolbarLayout->addWidget(
|
toolbarLayout->addWidget(
|
||||||
createToolbarCommandButton(Constants::ACTION_ADD_PACKAGE, [this]() { onAddPackage(); },
|
createToolbarCommandButton(Constants::ACTION_ADD_PACKAGE, [this]() { onAddPackage(); },
|
||||||
QIcon(QStringLiteral(":/modelinglib/48x48/package.png")),
|
QIcon(":/modelinglib/48x48/package.png"),
|
||||||
tr("Add Package"), d->toolbar));
|
tr("Add Package"), d->toolbar));
|
||||||
toolbarLayout->addWidget(
|
toolbarLayout->addWidget(
|
||||||
createToolbarCommandButton(Constants::ACTION_ADD_COMPONENT, [this]() { onAddComponent(); },
|
createToolbarCommandButton(Constants::ACTION_ADD_COMPONENT, [this]() { onAddComponent(); },
|
||||||
QIcon(QStringLiteral(":/modelinglib/48x48/component.png")),
|
QIcon(":/modelinglib/48x48/component.png"),
|
||||||
tr("Add Component"), d->toolbar));
|
tr("Add Component"), d->toolbar));
|
||||||
toolbarLayout->addWidget(
|
toolbarLayout->addWidget(
|
||||||
createToolbarCommandButton(Constants::ACTION_ADD_CLASS, [this]() { onAddClass(); },
|
createToolbarCommandButton(Constants::ACTION_ADD_CLASS, [this]() { onAddClass(); },
|
||||||
QIcon(QStringLiteral(":/modelinglib/48x48/class.png")),
|
QIcon(":/modelinglib/48x48/class.png"),
|
||||||
tr("Add Class"), d->toolbar));
|
tr("Add Class"), d->toolbar));
|
||||||
toolbarLayout->addWidget(
|
toolbarLayout->addWidget(
|
||||||
createToolbarCommandButton(Constants::ACTION_ADD_CANVAS_DIAGRAM, [this]() { onAddCanvasDiagram(); },
|
createToolbarCommandButton(Constants::ACTION_ADD_CANVAS_DIAGRAM, [this]() { onAddCanvasDiagram(); },
|
||||||
QIcon(QStringLiteral(":/modelinglib/48x48/canvas-diagram.png")),
|
QIcon(":/modelinglib/48x48/canvas-diagram.png"),
|
||||||
tr("Add Canvas Diagram"), d->toolbar));
|
tr("Add Canvas Diagram"), d->toolbar));
|
||||||
toolbarLayout->addSpacing(20);
|
toolbarLayout->addSpacing(20);
|
||||||
|
|
||||||
@@ -341,13 +341,13 @@ void ModelEditor::init(QWidget *parent)
|
|||||||
syncToggleButton->setDefaultAction(d->actionHandler->synchronizeBrowserAction());
|
syncToggleButton->setDefaultAction(d->actionHandler->synchronizeBrowserAction());
|
||||||
QMenu *syncMenu = new QMenu(syncToggleButton);
|
QMenu *syncMenu = new QMenu(syncToggleButton);
|
||||||
QActionGroup *syncGroup = new QActionGroup(syncMenu);
|
QActionGroup *syncGroup = new QActionGroup(syncMenu);
|
||||||
d->syncBrowserWithDiagramAction = syncMenu->addAction(QStringLiteral("Synchronize Structure with Diagram"));
|
d->syncBrowserWithDiagramAction = syncMenu->addAction(tr("Synchronize Structure with Diagram"));
|
||||||
d->syncBrowserWithDiagramAction->setCheckable(true);
|
d->syncBrowserWithDiagramAction->setCheckable(true);
|
||||||
d->syncBrowserWithDiagramAction->setActionGroup(syncGroup);
|
d->syncBrowserWithDiagramAction->setActionGroup(syncGroup);
|
||||||
d->syncDiagramWithBrowserAction = syncMenu->addAction(QStringLiteral("Synchronize Diagram with Structure"));
|
d->syncDiagramWithBrowserAction = syncMenu->addAction(tr("Synchronize Diagram with Structure"));
|
||||||
d->syncDiagramWithBrowserAction->setCheckable(true);
|
d->syncDiagramWithBrowserAction->setCheckable(true);
|
||||||
d->syncDiagramWithBrowserAction->setActionGroup(syncGroup);
|
d->syncDiagramWithBrowserAction->setActionGroup(syncGroup);
|
||||||
d->syncEachOtherAction = syncMenu->addAction(QStringLiteral("Keep Synchronized"));
|
d->syncEachOtherAction = syncMenu->addAction(tr("Keep Synchronized"));
|
||||||
d->syncEachOtherAction->setCheckable(true);
|
d->syncEachOtherAction->setCheckable(true);
|
||||||
d->syncEachOtherAction->setActionGroup(syncGroup);
|
d->syncEachOtherAction->setActionGroup(syncGroup);
|
||||||
syncToggleButton->setMenu(syncMenu);
|
syncToggleButton->setMenu(syncMenu);
|
||||||
@@ -578,13 +578,13 @@ void ModelEditor::exportDiagram()
|
|||||||
QString suffix = QFileInfo(fileName).suffix().toLower();
|
QString suffix = QFileInfo(fileName).suffix().toLower();
|
||||||
// TODO use QFileDialog::selectedNameFilter() as fallback if no suffix is given
|
// TODO use QFileDialog::selectedNameFilter() as fallback if no suffix is given
|
||||||
if (suffix.isEmpty()) {
|
if (suffix.isEmpty()) {
|
||||||
suffix = QStringLiteral("png");
|
suffix = "png";
|
||||||
fileName += QStringLiteral(".png");
|
fileName += ".png";
|
||||||
}
|
}
|
||||||
if (suffix == QStringLiteral("pdf"))
|
if (suffix == "pdf")
|
||||||
success = sceneModel->exportPdf(fileName);
|
success = sceneModel->exportPdf(fileName);
|
||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
else if (suffix == QStringLiteral("svg"))
|
else if (suffix == "svg")
|
||||||
success = sceneModel->exportSvg(fileName);
|
success = sceneModel->exportSvg(fileName);
|
||||||
#endif // QT_NO_SVG
|
#endif // QT_NO_SVG
|
||||||
else
|
else
|
||||||
@@ -1025,29 +1025,29 @@ void ModelEditor::initToolbars()
|
|||||||
qmt::StereotypeIcon::Element stereotypeIconElement = qmt::StereotypeIcon::ElementAny;
|
qmt::StereotypeIcon::Element stereotypeIconElement = qmt::StereotypeIcon::ElementAny;
|
||||||
qmt::StyleEngine::ElementType styleEngineElementType = qmt::StyleEngine::TypeOther;
|
qmt::StyleEngine::ElementType styleEngineElementType = qmt::StyleEngine::TypeOther;
|
||||||
if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_PACKAGE)) {
|
if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_PACKAGE)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/package.png");
|
iconPath = ":/modelinglib/48x48/package.png";
|
||||||
stereotypeIconElement = qmt::StereotypeIcon::ElementPackage;
|
stereotypeIconElement = qmt::StereotypeIcon::ElementPackage;
|
||||||
styleEngineElementType = qmt::StyleEngine::TypePackage;
|
styleEngineElementType = qmt::StyleEngine::TypePackage;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_COMPONENT)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_COMPONENT)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/component.png");
|
iconPath = ":/modelinglib/48x48/component.png";
|
||||||
stereotypeIconElement = qmt::StereotypeIcon::ElementComponent;
|
stereotypeIconElement = qmt::StereotypeIcon::ElementComponent;
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeComponent;
|
styleEngineElementType = qmt::StyleEngine::TypeComponent;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_CLASS)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_CLASS)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/class.png");
|
iconPath = ":/modelinglib/48x48/class.png";
|
||||||
stereotypeIconElement = qmt::StereotypeIcon::ElementClass;
|
stereotypeIconElement = qmt::StereotypeIcon::ElementClass;
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeClass;
|
styleEngineElementType = qmt::StyleEngine::TypeClass;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_ITEM)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_ITEM)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/item.png");
|
iconPath = ":/modelinglib/48x48/item.png";
|
||||||
stereotypeIconElement = qmt::StereotypeIcon::ElementItem;
|
stereotypeIconElement = qmt::StereotypeIcon::ElementItem;
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeItem;
|
styleEngineElementType = qmt::StyleEngine::TypeItem;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/annotation.png");
|
iconPath = ":/modelinglib/48x48/annotation.png";
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeAnnotation;
|
styleEngineElementType = qmt::StyleEngine::TypeAnnotation;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/boundary.png");
|
iconPath = ":/modelinglib/48x48/boundary.png";
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeBoundary;
|
styleEngineElementType = qmt::StyleEngine::TypeBoundary;
|
||||||
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE)) {
|
} else if (tool.m_elementType == QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE)) {
|
||||||
iconPath = QStringLiteral(":/modelinglib/48x48/swimlane.png");
|
iconPath = ":/modelinglib/48x48/swimlane.png";
|
||||||
styleEngineElementType = qmt::StyleEngine::TypeSwimlane;
|
styleEngineElementType = qmt::StyleEngine::TypeSwimlane;
|
||||||
}
|
}
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
@@ -1078,7 +1078,7 @@ void ModelEditor::initToolbars()
|
|||||||
|
|
||||||
// fallback if no toolbar was defined
|
// fallback if no toolbar was defined
|
||||||
if (!toolBars.isEmpty()) {
|
if (!toolBars.isEmpty()) {
|
||||||
QString generalId = QStringLiteral("General");
|
QString generalId = "General";
|
||||||
auto toolBar = new QWidget(d->leftToolBox);
|
auto toolBar = new QWidget(d->leftToolBox);
|
||||||
toolBar->setProperty(PROPERTYNAME_TOOLBARID, generalId);
|
toolBar->setProperty(PROPERTYNAME_TOOLBARID, generalId);
|
||||||
auto toolBarLayout = new QVBoxLayout(toolBar);
|
auto toolBarLayout = new QVBoxLayout(toolBar);
|
||||||
@@ -1087,34 +1087,34 @@ void ModelEditor::initToolbars()
|
|||||||
d->leftToolBox->insertItem(0, toolBar, generalId);
|
d->leftToolBox->insertItem(0, toolBar, generalId);
|
||||||
toolBars.insert(generalId, toolBar);
|
toolBars.insert(generalId, toolBar);
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/package.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/package.png"),
|
||||||
tr("Package"), QLatin1String(qmt::ELEMENT_TYPE_PACKAGE),
|
tr("Package"), QLatin1String(qmt::ELEMENT_TYPE_PACKAGE),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/component.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/component.png"),
|
||||||
tr("Component"), QLatin1String(qmt::ELEMENT_TYPE_COMPONENT),
|
tr("Component"), QLatin1String(qmt::ELEMENT_TYPE_COMPONENT),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/class.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/class.png"),
|
||||||
tr("Class"), QLatin1String(qmt::ELEMENT_TYPE_CLASS),
|
tr("Class"), QLatin1String(qmt::ELEMENT_TYPE_CLASS),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/item.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/item.png"),
|
||||||
tr("Item"), QLatin1String(qmt::ELEMENT_TYPE_ITEM),
|
tr("Item"), QLatin1String(qmt::ELEMENT_TYPE_ITEM),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
auto horizLine1 = new QFrame(d->leftToolBox);
|
auto horizLine1 = new QFrame(d->leftToolBox);
|
||||||
horizLine1->setFrameShape(QFrame::HLine);
|
horizLine1->setFrameShape(QFrame::HLine);
|
||||||
toolBarLayout->addWidget(horizLine1);
|
toolBarLayout->addWidget(horizLine1);
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/annotation.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/annotation.png"),
|
||||||
tr("Annotation"), QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION),
|
tr("Annotation"), QLatin1String(qmt::ELEMENT_TYPE_ANNOTATION),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/boundary.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/boundary.png"),
|
||||||
tr("Boundary"), QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY),
|
tr("Boundary"), QLatin1String(qmt::ELEMENT_TYPE_BOUNDARY),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
toolBarLayout->addWidget(
|
toolBarLayout->addWidget(
|
||||||
new DragTool(QIcon(QStringLiteral(":/modelinglib/48x48/swimlane.png")),
|
new DragTool(QIcon(":/modelinglib/48x48/swimlane.png"),
|
||||||
tr("Swimlane"), QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE),
|
tr("Swimlane"), QLatin1String(qmt::ELEMENT_TYPE_SWIMLANE),
|
||||||
QString(), toolBar));
|
QString(), toolBar));
|
||||||
}
|
}
|
||||||
@@ -1216,7 +1216,7 @@ void ModelEditor::addDiagramToSelector(const qmt::MDiagram *diagram)
|
|||||||
int i = d->diagramSelector->findData(diagramUid);
|
int i = d->diagramSelector->findData(diagramUid);
|
||||||
if (i >= 0)
|
if (i >= 0)
|
||||||
d->diagramSelector->removeItem(i);
|
d->diagramSelector->removeItem(i);
|
||||||
d->diagramSelector->insertItem(0, QIcon(QStringLiteral(":/modelinglib/48x48/canvas-diagram.png")), diagramLabel, diagramUid);
|
d->diagramSelector->insertItem(0, QIcon(":/modelinglib/48x48/canvas-diagram.png"), diagramLabel, diagramUid);
|
||||||
d->diagramSelector->setCurrentIndex(0);
|
d->diagramSelector->setCurrentIndex(0);
|
||||||
while (d->diagramSelector->count() > 20)
|
while (d->diagramSelector->count() > 20)
|
||||||
d->diagramSelector->removeItem(d->diagramSelector->count() - 1);
|
d->diagramSelector->removeItem(d->diagramSelector->count() - 1);
|
||||||
@@ -1264,7 +1264,7 @@ QString ModelEditor::buildDiagramLabel(const qmt::MDiagram *diagram)
|
|||||||
owner = owner->owner();
|
owner = owner->owner();
|
||||||
}
|
}
|
||||||
if (!path.isEmpty()) {
|
if (!path.isEmpty()) {
|
||||||
label += QStringLiteral(" [");
|
label += " [";
|
||||||
label += path.last();
|
label += path.last();
|
||||||
for (int i = path.count() - 2; i >= 0; --i) {
|
for (int i = path.count() - 2; i >= 0; --i) {
|
||||||
label += QLatin1Char('.');
|
label += QLatin1Char('.');
|
||||||
|
|||||||
@@ -174,10 +174,10 @@ void PxNodeController::addExplorerNode(const ProjectExplorer::Node *node,
|
|||||||
QString stereotype;
|
QString stereotype;
|
||||||
switch (node->nodeType()) {
|
switch (node->nodeType()) {
|
||||||
case ProjectExplorer::NodeType::VirtualFolder:
|
case ProjectExplorer::NodeType::VirtualFolder:
|
||||||
stereotype = QStringLiteral("virtual folder");
|
stereotype = "virtual folder";
|
||||||
break;
|
break;
|
||||||
case ProjectExplorer::NodeType::Project:
|
case ProjectExplorer::NodeType::Project:
|
||||||
stereotype = QStringLiteral("project");
|
stereotype = "project";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user