ScxmlEditor: Use ICore::dialogParent() as dialog parent

Change-Id: I0f8f0cb29b4fca1ecaf400ddc0b79e0616b27c79
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2018-11-26 23:15:41 +01:00
parent d1df55d128
commit d0756657f4
2 changed files with 7 additions and 2 deletions

View File

@@ -25,6 +25,8 @@
#include "colorthemeview.h" #include "colorthemeview.h"
#include <coreplugin/icore.h>
#include <QBrush> #include <QBrush>
#include <QColorDialog> #include <QColorDialog>
#include <QLinearGradient> #include <QLinearGradient>
@@ -58,7 +60,7 @@ void ColorThemeItem::openColorDialog()
{ {
QColor oldColor = m_color; QColor oldColor = m_color;
QColorDialog dialog(oldColor, 0); QColorDialog dialog(oldColor, Core::ICore::dialogParent());
dialog.setWindowTitle(tr("Pick Color")); dialog.setWindowTitle(tr("Pick Color"));
connect(&dialog, &QColorDialog::currentColorChanged, this, &ColorThemeItem::setColor); connect(&dialog, &QColorDialog::currentColorChanged, this, &ColorThemeItem::setColor);
QPoint topRight = parentWidget()->mapToGlobal(parentWidget()->rect().topRight()); QPoint topRight = parentWidget()->mapToGlobal(parentWidget()->rect().topRight());

View File

@@ -31,6 +31,8 @@
#include "scxmluifactory.h" #include "scxmluifactory.h"
#include "shapeprovider.h" #include "shapeprovider.h"
#include <coreplugin/icore.h>
#include <QDebug> #include <QDebug>
#include <QMessageBox> #include <QMessageBox>
#include <QMimeData> #include <QMimeData>
@@ -246,7 +248,8 @@ void GraphicsView::dropEvent(QDropEvent *event)
m_document->setCurrentTag(targetTag); m_document->setCurrentTag(targetTag);
QByteArray scxmlData = m_shapeProvider->scxmlCode(groupIndex, shapeIndex, targetTag); QByteArray scxmlData = m_shapeProvider->scxmlCode(groupIndex, shapeIndex, targetTag);
if (!scxmlData.isEmpty() && !m_document->pasteData(scxmlData, targetPos, targetPos)) if (!scxmlData.isEmpty() && !m_document->pasteData(scxmlData, targetPos, targetPos))
QMessageBox::warning(0, tr("SCXML Generation Failed"), m_document->lastError()); QMessageBox::warning(Core::ICore::dialogParent(), tr("SCXML Generation Failed"),
m_document->lastError());
} }
} else { } else {
event->ignore(); event->ignore();