forked from qt-creator/qt-creator
QmlDesigner: Use Qt5-style connect
+ De-slot where possible Change-Id: Ibd2edbef7b7712aba20593bd0417940e828e0c9c Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
f87c1eba68
commit
5221d5f06a
@@ -76,7 +76,7 @@ SelectionContext AbstractAction::selectionContext() const
|
|||||||
DefaultAction::DefaultAction(const QString &description)
|
DefaultAction::DefaultAction(const QString &description)
|
||||||
: QAction(description, 0)
|
: QAction(description, 0)
|
||||||
{
|
{
|
||||||
connect(this, SIGNAL(triggered(bool)), this, SLOT(actionTriggered(bool)));
|
connect(this, &DefaultAction::triggered, this, &DefaultAction::actionTriggered);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DefaultAction::actionTriggered(bool enable)
|
void DefaultAction::actionTriggered(bool enable)
|
||||||
|
@@ -39,13 +39,13 @@ class QMLDESIGNERCORE_EXPORT DefaultAction : public QAction
|
|||||||
public:
|
public:
|
||||||
DefaultAction(const QString &description);
|
DefaultAction(const QString &description);
|
||||||
|
|
||||||
signals:
|
// virtual function instead of slot
|
||||||
void triggered(bool checked, const SelectionContext &selectionContext);
|
|
||||||
|
|
||||||
public slots: //virtual function instead of slot
|
|
||||||
virtual void actionTriggered(bool enable);
|
virtual void actionTriggered(bool enable);
|
||||||
void setSelectionContext(const SelectionContext &selectionContext);
|
void setSelectionContext(const SelectionContext &selectionContext);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void triggered(bool checked, const SelectionContext &selectionContext);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SelectionContext m_selectionContext;
|
SelectionContext m_selectionContext;
|
||||||
};
|
};
|
||||||
|
@@ -46,10 +46,8 @@ public:
|
|||||||
|
|
||||||
Utils::CrumblePath *crumblePath();
|
Utils::CrumblePath *crumblePath();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void onCrumblePathElementClicked(const QVariant &data);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void onCrumblePathElementClicked(const QVariant &data);
|
||||||
void updateVisibility();
|
void updateVisibility();
|
||||||
void showSaveDialog();
|
void showSaveDialog();
|
||||||
|
|
||||||
|
@@ -107,7 +107,6 @@ public:
|
|||||||
: DefaultAction(description), m_action(action)
|
: DefaultAction(description), m_action(action)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public /*slots*/:
|
|
||||||
virtual void actionTriggered(bool b)
|
virtual void actionTriggered(bool b)
|
||||||
{
|
{
|
||||||
m_selectionContext.setToggled(b);
|
m_selectionContext.setToggled(b);
|
||||||
|
@@ -36,7 +36,8 @@ namespace Internal {
|
|||||||
DebugViewWidget::DebugViewWidget(QWidget *parent) : QWidget(parent)
|
DebugViewWidget::DebugViewWidget(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
connect(m_ui.enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(enabledCheckBoxToggled(bool)));
|
connect(m_ui.enabledCheckBox, &QAbstractButton::toggled,
|
||||||
|
this, &DebugViewWidget::enabledCheckBoxToggled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebugViewWidget::addLogMessage(const QString &topic, const QString &message, bool highlight)
|
void DebugViewWidget::addLogMessage(const QString &topic, const QString &message, bool highlight)
|
||||||
|
@@ -45,7 +45,6 @@ public:
|
|||||||
|
|
||||||
void setDebugViewEnabled(bool b);
|
void setDebugViewEnabled(bool b);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void enabledCheckBoxToggled(bool b);
|
void enabledCheckBoxToggled(bool b);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -64,7 +64,8 @@ QWidget *BackgroundAction::createWidget(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
comboBox->setCurrentIndex(0);
|
comboBox->setCurrentIndex(0);
|
||||||
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitBackgroundChanged(int)));
|
connect(comboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &BackgroundAction::emitBackgroundChanged);
|
||||||
|
|
||||||
comboBox->setProperty("hideborder", true);
|
comboBox->setProperty("hideborder", true);
|
||||||
comboBox->setToolTip(tr("Set the color of the canvas."));
|
comboBox->setToolTip(tr("Set the color of the canvas."));
|
||||||
|
@@ -46,7 +46,7 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
QWidget *createWidget(QWidget *parent);
|
QWidget *createWidget(QWidget *parent);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void emitBackgroundChanged(int index);
|
void emitBackgroundChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -84,7 +84,6 @@ public:
|
|||||||
|
|
||||||
void highlightBoundingRect(FormEditorItem *formEditorItem);
|
void highlightBoundingRect(FormEditorItem *formEditorItem);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setShowBoundingRects(bool show);
|
void setShowBoundingRects(bool show);
|
||||||
bool showBoundingRects() const;
|
bool showBoundingRects() const;
|
||||||
|
|
||||||
|
@@ -607,7 +607,7 @@ bool FormEditorView::isMoveToolAvailable() const
|
|||||||
|
|
||||||
void FormEditorView::reset()
|
void FormEditorView::reset()
|
||||||
{
|
{
|
||||||
QTimer::singleShot(200, this, SLOT(delayedReset()));
|
QTimer::singleShot(200, this, &FormEditorView::delayedReset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FormEditorView::delayedReset()
|
void FormEditorView::delayedReset()
|
||||||
|
@@ -120,8 +120,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void delayedReset();
|
void delayedReset();
|
||||||
bool isMoveToolAvailable() const;
|
bool isMoveToolAvailable() const;
|
||||||
|
|
||||||
|
@@ -120,13 +120,15 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
|||||||
|
|
||||||
m_rootWidthAction = new LineEditAction(tr("Override Width"), this);
|
m_rootWidthAction = new LineEditAction(tr("Override Width"), this);
|
||||||
m_rootWidthAction->setToolTip(tr("Override width of root item."));
|
m_rootWidthAction->setToolTip(tr("Override width of root item."));
|
||||||
connect(m_rootWidthAction.data(), SIGNAL(textChanged(QString)), this, SLOT(changeRootItemWidth(QString)));
|
connect(m_rootWidthAction.data(), &LineEditAction::textChanged,
|
||||||
|
this, &FormEditorWidget::changeRootItemWidth);
|
||||||
addAction(m_rootWidthAction.data());
|
addAction(m_rootWidthAction.data());
|
||||||
upperActions.append(m_rootWidthAction.data());
|
upperActions.append(m_rootWidthAction.data());
|
||||||
|
|
||||||
m_rootHeightAction = new LineEditAction(tr("Override Height"), this);
|
m_rootHeightAction = new LineEditAction(tr("Override Height"), this);
|
||||||
m_rootHeightAction->setToolTip(tr("Override height of root item."));
|
m_rootHeightAction->setToolTip(tr("Override height of root item."));
|
||||||
connect(m_rootHeightAction.data(), SIGNAL(textChanged(QString)), this, SLOT(changeRootItemHeight(QString)));
|
connect(m_rootHeightAction.data(), &LineEditAction::textChanged,
|
||||||
|
this, &FormEditorWidget::changeRootItemHeight);
|
||||||
addAction(m_rootHeightAction.data());
|
addAction(m_rootHeightAction.data());
|
||||||
upperActions.append(m_rootHeightAction.data());
|
upperActions.append(m_rootHeightAction.data());
|
||||||
|
|
||||||
@@ -150,7 +152,8 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
|||||||
m_toolBox->addRightSideAction(m_backgroundAction.data());
|
m_toolBox->addRightSideAction(m_backgroundAction.data());
|
||||||
|
|
||||||
m_zoomAction = new ZoomAction(m_toolActionGroup.data());
|
m_zoomAction = new ZoomAction(m_toolActionGroup.data());
|
||||||
connect(m_zoomAction.data(), SIGNAL(zoomLevelChanged(double)), SLOT(setZoomLevel(double)));
|
connect(m_zoomAction.data(), &ZoomAction::zoomLevelChanged,
|
||||||
|
this, &FormEditorWidget::setZoomLevel);
|
||||||
addAction(m_zoomAction.data());
|
addAction(m_zoomAction.data());
|
||||||
upperActions.append(m_zoomAction.data());
|
upperActions.append(m_zoomAction.data());
|
||||||
m_toolBox->addRightSideAction(m_zoomAction.data());
|
m_toolBox->addRightSideAction(m_zoomAction.data());
|
||||||
@@ -159,7 +162,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
|
|||||||
m_resetAction->setShortcut(Qt::Key_R);
|
m_resetAction->setShortcut(Qt::Key_R);
|
||||||
m_resetAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
m_resetAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
||||||
m_resetAction->setIcon(Utils::Icons::RESET_TOOLBAR.icon());
|
m_resetAction->setIcon(Utils::Icons::RESET_TOOLBAR.icon());
|
||||||
connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(resetNodeInstanceView()));
|
connect(m_resetAction.data(), &QAction::triggered, this, &FormEditorWidget::resetNodeInstanceView);
|
||||||
addAction(m_resetAction.data());
|
addAction(m_resetAction.data());
|
||||||
upperActions.append(m_resetAction.data());
|
upperActions.append(m_resetAction.data());
|
||||||
m_toolBox->addRightSideAction(m_resetAction.data());
|
m_toolBox->addRightSideAction(m_resetAction.data());
|
||||||
|
@@ -88,7 +88,7 @@ protected:
|
|||||||
QActionGroup *toolActionGroup() const;
|
QActionGroup *toolActionGroup() const;
|
||||||
DocumentWarningWidget *errorWidget();
|
DocumentWarningWidget *errorWidget();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void changeTransformTool(bool checked);
|
void changeTransformTool(bool checked);
|
||||||
void setZoomLevel(double zoomLevel);
|
void setZoomLevel(double zoomLevel);
|
||||||
void changeRootItemWidth(const QString &widthText);
|
void changeRootItemWidth(const QString &widthText);
|
||||||
|
@@ -57,9 +57,9 @@ QWidget *LineEditAction::createWidget(QWidget *parent)
|
|||||||
lineEdit->setFont(font);
|
lineEdit->setFont(font);
|
||||||
lineEdit->setValidator(new QIntValidator(0, 4096, this));
|
lineEdit->setValidator(new QIntValidator(0, 4096, this));
|
||||||
|
|
||||||
connect(lineEdit, SIGNAL(textEdited(QString)), this, SIGNAL(textChanged(QString)));
|
connect(lineEdit, &QLineEdit::textEdited, this, &LineEditAction::textChanged);
|
||||||
connect(this, SIGNAL(lineEditTextClear()), lineEdit, SLOT(clear()));
|
connect(this, &LineEditAction::lineEditTextClear, lineEdit, &QLineEdit::clear);
|
||||||
connect(this, SIGNAL(lineEditTextChange(QString)), lineEdit, SLOT(setText(QString)));
|
connect(this, &LineEditAction::lineEditTextChange, lineEdit, &QLineEdit::setText);
|
||||||
|
|
||||||
return lineEdit;
|
return lineEdit;
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,8 @@ QWidget *NumberSeriesAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setModel(m_comboBoxModel.data());
|
comboBox->setModel(m_comboBoxModel.data());
|
||||||
|
|
||||||
comboBox->setCurrentIndex(m_comboBoxModelIndex);
|
comboBox->setCurrentIndex(m_comboBoxModelIndex);
|
||||||
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitValueChanged(int)));
|
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
|
this, &NumberSeriesAction::emitValueChanged);
|
||||||
|
|
||||||
return comboBox;
|
return comboBox;
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,7 @@ protected:
|
|||||||
signals:
|
signals:
|
||||||
void valueChanged(const QVariant &value);
|
void valueChanged(const QVariant &value);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void emitValueChanged(int index);
|
void emitValueChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -91,8 +91,9 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
comboBox->setCurrentIndex(8);
|
comboBox->setCurrentIndex(8);
|
||||||
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitZoomLevelChanged(int)));
|
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
connect(this, SIGNAL(indexChanged(int)), comboBox, SLOT(setCurrentIndex(int)));
|
this, &ZoomAction::emitZoomLevelChanged);
|
||||||
|
connect(this, &ZoomAction::indexChanged, comboBox, &QComboBox::setCurrentIndex);
|
||||||
|
|
||||||
comboBox->setProperty("hideborder", true);
|
comboBox->setProperty("hideborder", true);
|
||||||
return comboBox;
|
return comboBox;
|
||||||
|
@@ -51,7 +51,8 @@ protected:
|
|||||||
signals:
|
signals:
|
||||||
void zoomLevelChanged(double zoom);
|
void zoomLevelChanged(double zoom);
|
||||||
void indexChanged(int);
|
void indexChanged(int);
|
||||||
private slots:
|
|
||||||
|
private:
|
||||||
void emitZoomLevelChanged(int index);
|
void emitZoomLevelChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -47,7 +47,7 @@ ImportLabel::ImportLabel(QWidget *parent) :
|
|||||||
m_removeButton->setFocusPolicy(Qt::NoFocus);
|
m_removeButton->setFocusPolicy(Qt::NoFocus);
|
||||||
m_removeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
m_removeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
m_removeButton->setToolTip(tr("Remove Import"));
|
m_removeButton->setToolTip(tr("Remove Import"));
|
||||||
connect(m_removeButton, SIGNAL(clicked()), this, SLOT(emitRemoveImport()));
|
connect(m_removeButton, &QAbstractButton::clicked, this, [this] { emit removeImport(m_import); });
|
||||||
layout->addWidget(m_removeButton);
|
layout->addWidget(m_removeButton);
|
||||||
|
|
||||||
m_importLabel = new QLabel(this);
|
m_importLabel = new QLabel(this);
|
||||||
@@ -75,9 +75,4 @@ void ImportLabel::setReadOnly(bool readOnly) const
|
|||||||
: Utils::Icons::CLOSE_TOOLBAR.icon());
|
: Utils::Icons::CLOSE_TOOLBAR.icon());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportLabel::emitRemoveImport()
|
|
||||||
{
|
|
||||||
emit removeImport(m_import);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -45,9 +45,6 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void removeImport(const Import &import);
|
void removeImport(const Import &import);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void emitRemoveImport();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Import m_import;
|
Import m_import;
|
||||||
QLabel *m_importLabel;
|
QLabel *m_importLabel;
|
||||||
|
@@ -52,8 +52,8 @@ WidgetInfo ImportManagerView::widgetInfo()
|
|||||||
{
|
{
|
||||||
if (m_importsWidget == 0) {
|
if (m_importsWidget == 0) {
|
||||||
m_importsWidget = new ImportsWidget;
|
m_importsWidget = new ImportsWidget;
|
||||||
connect(m_importsWidget, SIGNAL(removeImport(Import)), this, SLOT(removeImport(Import)));
|
connect(m_importsWidget.data(), &ImportsWidget::removeImport, this, &ImportManagerView::removeImport);
|
||||||
connect(m_importsWidget, SIGNAL(addImport(Import)), this, SLOT(addImport(Import)));
|
connect(m_importsWidget.data(), &ImportsWidget::addImport, this, &ImportManagerView::addImport);
|
||||||
|
|
||||||
if (model())
|
if (model())
|
||||||
m_importsWidget->setImports(model()->imports());
|
m_importsWidget->setImports(model()->imports());
|
||||||
|
@@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) override;
|
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void removeImport(const Import &import);
|
void removeImport(const Import &import);
|
||||||
void addImport(const Import &import);
|
void addImport(const Import &import);
|
||||||
|
|
||||||
|
@@ -39,7 +39,8 @@ ImportsWidget::ImportsWidget(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
setWindowTitle(tr("Import Manager"));
|
setWindowTitle(tr("Import Manager"));
|
||||||
m_addImportComboBox = new ImportManagerComboBox(this);
|
m_addImportComboBox = new ImportManagerComboBox(this);
|
||||||
connect(m_addImportComboBox, SIGNAL(activated(int)), this, SLOT(addSelectedImport(int)));
|
connect(m_addImportComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
||||||
|
this, &ImportsWidget::addSelectedImport);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ImportsWidget::removeImports()
|
void ImportsWidget::removeImports()
|
||||||
@@ -126,7 +127,7 @@ void ImportsWidget::setImports(const QList<Import> &imports)
|
|||||||
ImportLabel *importLabel = new ImportLabel(this);
|
ImportLabel *importLabel = new ImportLabel(this);
|
||||||
importLabel->setImport(import);
|
importLabel->setImport(import);
|
||||||
m_importLabels.append(importLabel);
|
m_importLabels.append(importLabel);
|
||||||
connect(importLabel, SIGNAL(removeImport(Import)), this, SIGNAL(removeImport(Import)));
|
connect(importLabel, &ImportLabel::removeImport, this, &ImportsWidget::removeImport);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateLayout();
|
updateLayout();
|
||||||
|
@@ -59,7 +59,7 @@ signals:
|
|||||||
protected:
|
protected:
|
||||||
void updateLayout();
|
void updateLayout();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void addSelectedImport(int addImportComboBoxIndex);
|
void addSelectedImport(int addImportComboBoxIndex);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -53,8 +53,9 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
|
|||||||
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
comboBox->setToolTip(tr("Edit sub components defined in this file."));
|
||||||
comboBox->setModel(m_componentView->standardItemModel());
|
comboBox->setModel(m_componentView->standardItemModel());
|
||||||
comboBox->setCurrentIndex(-1);
|
comboBox->setCurrentIndex(-1);
|
||||||
connect(comboBox, SIGNAL(activated(int)), SLOT(emitCurrentComponentChanged(int)));
|
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
|
||||||
connect(this, SIGNAL(currentIndexChanged(int)), comboBox, SLOT(setCurrentIndex(int)));
|
this, &ComponentAction::emitCurrentComponentChanged);
|
||||||
|
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
|
||||||
|
|
||||||
return comboBox;
|
return comboBox;
|
||||||
}
|
}
|
||||||
|
@@ -44,7 +44,7 @@ class ComponentAction : public QWidgetAction
|
|||||||
public:
|
public:
|
||||||
ComponentAction(ComponentView *componentView);
|
ComponentAction(ComponentView *componentView);
|
||||||
void setCurrentIndex(int index);
|
void setCurrentIndex(int index);
|
||||||
|
void emitCurrentComponentChanged(int index);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QWidget *createWidget(QWidget *parent);
|
QWidget *createWidget(QWidget *parent);
|
||||||
@@ -54,9 +54,6 @@ signals:
|
|||||||
void changedToMaster();
|
void changedToMaster();
|
||||||
void currentIndexChanged(int index);
|
void currentIndexChanged(int index);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void emitCurrentComponentChanged(int index);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<ComponentView> m_componentView;
|
QPointer<ComponentView> m_componentView;
|
||||||
bool dontEmitCurrentComponentChanged;
|
bool dontEmitCurrentComponentChanged;
|
||||||
|
@@ -235,12 +235,12 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit)
|
|||||||
{
|
{
|
||||||
Q_CHECK_PTR(edit);
|
Q_CHECK_PTR(edit);
|
||||||
|
|
||||||
connect(edit, SIGNAL(undoAvailable(bool)),
|
connect(edit, &QPlainTextEdit::undoAvailable,
|
||||||
this, SIGNAL(undoAvailable(bool)));
|
this, &DesignDocument::undoAvailable);
|
||||||
connect(edit, SIGNAL(redoAvailable(bool)),
|
connect(edit, &QPlainTextEdit::redoAvailable,
|
||||||
this, SIGNAL(redoAvailable(bool)));
|
this, &DesignDocument::redoAvailable);
|
||||||
connect(edit, SIGNAL(modificationChanged(bool)),
|
connect(edit, &QPlainTextEdit::modificationChanged,
|
||||||
this, SIGNAL(dirtyStateChanged(bool)));
|
this, &DesignDocument::dirtyStateChanged);
|
||||||
|
|
||||||
m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit())));
|
m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit())));
|
||||||
|
|
||||||
|
@@ -106,7 +106,7 @@ signals:
|
|||||||
void designDocumentClosed();
|
void designDocumentClosed();
|
||||||
void qmlErrorsChanged(const QList<DocumentMessage> &errors);
|
void qmlErrorsChanged(const QList<DocumentMessage> &errors);
|
||||||
|
|
||||||
public slots:
|
public:
|
||||||
void deleteSelected();
|
void deleteSelected();
|
||||||
void copySelected();
|
void copySelected();
|
||||||
void cutSelected();
|
void cutSelected();
|
||||||
@@ -119,10 +119,9 @@ public slots:
|
|||||||
void changeToSubComponent(const ModelNode &componentNode);
|
void changeToSubComponent(const ModelNode &componentNode);
|
||||||
void changeToMaster();
|
void changeToMaster();
|
||||||
|
|
||||||
private slots:
|
private: // functions
|
||||||
void updateFileName(const Utils::FileName &oldFileName, const Utils::FileName &newFileName);
|
void updateFileName(const Utils::FileName &oldFileName, const Utils::FileName &newFileName);
|
||||||
|
|
||||||
private: // functions
|
|
||||||
void changeToInFileComponentModel(ComponentTextModifier *textModifer);
|
void changeToInFileComponentModel(ComponentTextModifier *textModifer);
|
||||||
|
|
||||||
void updateQrcFiles();
|
void updateQrcFiles();
|
||||||
|
@@ -43,7 +43,6 @@ class StackedUtilityPanelController : public UtilityPanelController
|
|||||||
public:
|
public:
|
||||||
StackedUtilityPanelController(QObject* parent = 0);
|
StackedUtilityPanelController(QObject* parent = 0);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void show(DesignDocument* DesignDocument);
|
void show(DesignDocument* DesignDocument);
|
||||||
void close(DesignDocument* DesignDocument);
|
void close(DesignDocument* DesignDocument);
|
||||||
|
|
||||||
|
@@ -69,7 +69,6 @@ public:
|
|||||||
|
|
||||||
ItemLibrarySection *sectionByName(const QString §ionName);
|
ItemLibrarySection *sectionByName(const QString §ionName);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setSearchText(const QString &searchText);
|
void setSearchText(const QString &searchText);
|
||||||
|
|
||||||
void setExpanded(bool, const QString §ion);
|
void setExpanded(bool, const QString §ion);
|
||||||
|
@@ -100,8 +100,8 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
|
|||||||
tabBar->addTab(tr("Resources", "Title of library resources view"));
|
tabBar->addTab(tr("Resources", "Title of library resources view"));
|
||||||
tabBar->addTab(tr("Imports", "Title of library imports view"));
|
tabBar->addTab(tr("Imports", "Title of library imports view"));
|
||||||
tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(setCurrentIndexOfStackedWidget(int)));
|
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::setCurrentIndexOfStackedWidget);
|
||||||
connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(updateSearch()));
|
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::updateSearch);
|
||||||
|
|
||||||
m_filterLineEdit = new Utils::FancyLineEdit(this);
|
m_filterLineEdit = new Utils::FancyLineEdit(this);
|
||||||
m_filterLineEdit->setObjectName(QStringLiteral("itemLibrarySearchInput"));
|
m_filterLineEdit->setObjectName(QStringLiteral("itemLibrarySearchInput"));
|
||||||
@@ -119,7 +119,7 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
|
|||||||
lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
|
lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 0);
|
||||||
lineEditLayout->addWidget(m_filterLineEdit.data(), 1, 1, 1, 1);
|
lineEditLayout->addWidget(m_filterLineEdit.data(), 1, 1, 1, 1);
|
||||||
lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 2);
|
lineEditLayout->addItem(new QSpacerItem(5, 5, QSizePolicy::Fixed, QSizePolicy::Fixed), 1, 2);
|
||||||
connect(m_filterLineEdit.data(), SIGNAL(filterChanged(QString)), this, SLOT(setSearchFilter(QString)));
|
connect(m_filterLineEdit.data(), &Utils::FancyLineEdit::filterChanged, this, &ItemLibraryWidget::setSearchFilter);
|
||||||
|
|
||||||
|
|
||||||
m_stackedWidget = new QStackedWidget(this);
|
m_stackedWidget = new QStackedWidget(this);
|
||||||
@@ -145,9 +145,9 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
|
|||||||
m_resourcesView->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
|
m_resourcesView->setStyleSheet(Theme::replaceCssColors(QString::fromUtf8(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
|
||||||
|
|
||||||
m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F5), this);
|
m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F5), this);
|
||||||
connect(m_qmlSourceUpdateShortcut, SIGNAL(activated()), this, SLOT(reloadQmlSource()));
|
connect(m_qmlSourceUpdateShortcut, &QShortcut::activated, this, &ItemLibraryWidget::reloadQmlSource);
|
||||||
|
|
||||||
connect(&m_compressionTimer, SIGNAL(timeout()), this, SLOT(updateModel()));
|
connect(&m_compressionTimer, &QTimer::timeout, this, &ItemLibraryWidget::updateModel);
|
||||||
|
|
||||||
// init the first load of the QML UI elements
|
// init the first load of the QML UI elements
|
||||||
reloadQmlSource();
|
reloadQmlSource();
|
||||||
@@ -159,12 +159,12 @@ void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_itemLibraryInfo)
|
if (m_itemLibraryInfo)
|
||||||
disconnect(m_itemLibraryInfo.data(), SIGNAL(entriesChanged()),
|
disconnect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
||||||
this, SLOT(delayedUpdateModel()));
|
this, &ItemLibraryWidget::delayedUpdateModel);
|
||||||
m_itemLibraryInfo = itemLibraryInfo;
|
m_itemLibraryInfo = itemLibraryInfo;
|
||||||
if (itemLibraryInfo)
|
if (itemLibraryInfo)
|
||||||
connect(m_itemLibraryInfo.data(), SIGNAL(entriesChanged()),
|
connect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
|
||||||
this, SLOT(delayedUpdateModel()));
|
this, &ItemLibraryWidget::delayedUpdateModel);
|
||||||
delayedUpdateModel();
|
delayedUpdateModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,7 +75,6 @@ public:
|
|||||||
static QString qmlSourcesPath();
|
static QString qmlSourcesPath();
|
||||||
void clearSearchFilter();
|
void clearSearchFilter();
|
||||||
|
|
||||||
public slots:
|
|
||||||
void setSearchFilter(const QString &searchFilter);
|
void setSearchFilter(const QString &searchFilter);
|
||||||
void delayedUpdateModel();
|
void delayedUpdateModel();
|
||||||
void updateModel();
|
void updateModel();
|
||||||
@@ -94,7 +93,7 @@ protected:
|
|||||||
signals:
|
signals:
|
||||||
void itemActivated(const QString& itemName);
|
void itemActivated(const QString& itemName);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void setCurrentIndexOfStackedWidget(int index);
|
void setCurrentIndexOfStackedWidget(int index);
|
||||||
void reloadQmlSource();
|
void reloadQmlSource();
|
||||||
|
|
||||||
|
@@ -115,8 +115,8 @@ NavigatorTreeModel::NavigatorTreeModel(QObject *parent)
|
|||||||
setColumnCount(2);
|
setColumnCount(2);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
connect(this, SIGNAL(itemChanged(QStandardItem*)),
|
connect(this, &QStandardItemModel::itemChanged,
|
||||||
this, SLOT(handleChangedItem(QStandardItem*)));
|
this, &NavigatorTreeModel::handleChangedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
NavigatorTreeModel::~NavigatorTreeModel()
|
NavigatorTreeModel::~NavigatorTreeModel()
|
||||||
|
@@ -123,10 +123,9 @@ public:
|
|||||||
ItemRow itemRowForNode(const ModelNode &node);
|
ItemRow itemRowForNode(const ModelNode &node);
|
||||||
bool blockItemChangedSignal(bool block);
|
bool blockItemChangedSignal(bool block);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleChangedItem(QStandardItem *item);
|
void handleChangedItem(QStandardItem *item);
|
||||||
|
|
||||||
private:
|
|
||||||
ItemRow createItemRow(const ModelNode &node);
|
ItemRow createItemRow(const ModelNode &node);
|
||||||
void updateItemRow(const ModelNode &node, ItemRow row);
|
void updateItemRow(const ModelNode &node, ItemRow row);
|
||||||
void handleChangedIdItem(QStandardItem *idItem, ModelNode &modelNode);
|
void handleChangedIdItem(QStandardItem *idItem, ModelNode &modelNode);
|
||||||
|
@@ -74,12 +74,12 @@ NavigatorView::NavigatorView(QObject* parent) :
|
|||||||
|
|
||||||
m_widget->setTreeModel(m_treeModel.data());
|
m_widget->setTreeModel(m_treeModel.data());
|
||||||
|
|
||||||
connect(treeWidget()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(changeSelection(QItemSelection,QItemSelection)));
|
connect(treeWidget()->selectionModel(), &QItemSelectionModel::selectionChanged, this, &NavigatorView::changeSelection);
|
||||||
|
|
||||||
connect(m_widget.data(), SIGNAL(leftButtonClicked()), this, SLOT(leftButtonClicked()));
|
connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked);
|
||||||
connect(m_widget.data(), SIGNAL(rightButtonClicked()), this, SLOT(rightButtonClicked()));
|
connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked);
|
||||||
connect(m_widget.data(), SIGNAL(downButtonClicked()), this, SLOT(downButtonClicked()));
|
connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked);
|
||||||
connect(m_widget.data(), SIGNAL(upButtonClicked()), this, SLOT(upButtonClicked()));
|
connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked);
|
||||||
|
|
||||||
treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);
|
treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);
|
||||||
|
|
||||||
|
@@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
void bindingPropertiesChanged(const QList<BindingProperty> &propertyList, PropertyChangeFlags) override;
|
void bindingPropertiesChanged(const QList<BindingProperty> &propertyList, PropertyChangeFlags) override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void changeSelection(const QItemSelection &selected, const QItemSelection &deselected);
|
void changeSelection(const QItemSelection &selected, const QItemSelection &deselected);
|
||||||
void updateItemSelection();
|
void updateItemSelection();
|
||||||
void changeToComponent(const QModelIndex &index);
|
void changeToComponent(const QModelIndex &index);
|
||||||
|
@@ -82,25 +82,25 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
|
|||||||
buttons.last()->setIcon(Icons::ARROW_LEFT.icon());
|
buttons.last()->setIcon(Icons::ARROW_LEFT.icon());
|
||||||
buttons.last()->setToolTip(tr("Become last sibling of parent (CTRL + Left)."));
|
buttons.last()->setToolTip(tr("Become last sibling of parent (CTRL + Left)."));
|
||||||
buttons.last()->setShortcut(QKeySequence(Qt::Key_Left | Qt::CTRL));
|
buttons.last()->setShortcut(QKeySequence(Qt::Key_Left | Qt::CTRL));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(leftButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &NavigatorWidget::leftButtonClicked);
|
||||||
|
|
||||||
buttons.append(new QToolButton());
|
buttons.append(new QToolButton());
|
||||||
buttons.last()->setIcon(Icons::ARROW_RIGHT.icon());
|
buttons.last()->setIcon(Icons::ARROW_RIGHT.icon());
|
||||||
buttons.last()->setToolTip(tr("Become child of last sibling (CTRL + Right)."));
|
buttons.last()->setToolTip(tr("Become child of last sibling (CTRL + Right)."));
|
||||||
buttons.last()->setShortcut(QKeySequence(Qt::Key_Right | Qt::CTRL));
|
buttons.last()->setShortcut(QKeySequence(Qt::Key_Right | Qt::CTRL));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(rightButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &NavigatorWidget::rightButtonClicked);
|
||||||
|
|
||||||
buttons.append(new QToolButton());
|
buttons.append(new QToolButton());
|
||||||
buttons.last()->setIcon(Icons::ARROW_DOWN.icon());
|
buttons.last()->setIcon(Icons::ARROW_DOWN.icon());
|
||||||
buttons.last()->setToolTip(tr("Move down (CTRL + Down)."));
|
buttons.last()->setToolTip(tr("Move down (CTRL + Down)."));
|
||||||
buttons.last()->setShortcut(QKeySequence(Qt::Key_Down | Qt::CTRL));
|
buttons.last()->setShortcut(QKeySequence(Qt::Key_Down | Qt::CTRL));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(downButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &NavigatorWidget::downButtonClicked);
|
||||||
|
|
||||||
buttons.append(new QToolButton());
|
buttons.append(new QToolButton());
|
||||||
buttons.last()->setIcon(Icons::ARROW_UP.icon());
|
buttons.last()->setIcon(Icons::ARROW_UP.icon());
|
||||||
buttons.last()->setToolTip(tr("Move up (CTRL + Up)."));
|
buttons.last()->setToolTip(tr("Move up (CTRL + Up)."));
|
||||||
buttons.last()->setShortcut(QKeySequence(Qt::Key_Up | Qt::CTRL));
|
buttons.last()->setShortcut(QKeySequence(Qt::Key_Up | Qt::CTRL));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SIGNAL(upButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &NavigatorWidget::upButtonClicked);
|
||||||
|
|
||||||
return buttons;
|
return buttons;
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,6 @@ signals:
|
|||||||
void modelNodeBackendChanged();
|
void modelNodeBackendChanged();
|
||||||
void fileModelChanged();
|
void fileModelChanged();
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariant modelNodeBackend() const;
|
QVariant modelNodeBackend() const;
|
||||||
|
|
||||||
|
@@ -69,8 +69,6 @@ signals:
|
|||||||
void anchorBackendChanged();
|
void anchorBackendChanged();
|
||||||
void hasGradientChanged();
|
void hasGradientChanged();
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupModel();
|
void setupModel();
|
||||||
void setAnchorBackend(const QVariant &anchorBackend);
|
void setAnchorBackend(const QVariant &anchorBackend);
|
||||||
|
@@ -106,7 +106,8 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE
|
|||||||
m_contextObject->setModel(propertyEditor->model());
|
m_contextObject->setModel(propertyEditor->model());
|
||||||
m_contextObject->insertInQmlContext(context());
|
m_contextObject->insertInQmlContext(context());
|
||||||
|
|
||||||
QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged, propertyEditor, &PropertyEditorView::changeValue);
|
QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged,
|
||||||
|
propertyEditor, &PropertyEditorView::changeValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyEditorQmlBackend::~PropertyEditorQmlBackend()
|
PropertyEditorQmlBackend::~PropertyEditorQmlBackend()
|
||||||
|
@@ -35,9 +35,9 @@ class PropertyEditorTransaction : public QObject
|
|||||||
public:
|
public:
|
||||||
PropertyEditorTransaction(QmlDesigner::PropertyEditorView *propertyEditor);
|
PropertyEditorTransaction(QmlDesigner::PropertyEditorView *propertyEditor);
|
||||||
|
|
||||||
public slots:
|
Q_INVOKABLE void start();
|
||||||
void start();
|
Q_INVOKABLE void end();
|
||||||
void end();
|
|
||||||
protected:
|
protected:
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent *event);
|
||||||
|
|
||||||
|
@@ -355,7 +355,7 @@ void PropertyEditorValue::registerDeclarativeTypes()
|
|||||||
PropertyEditorNodeWrapper::PropertyEditorNodeWrapper(PropertyEditorValue* parent) : QObject(parent), m_valuesPropertyMap(this)
|
PropertyEditorNodeWrapper::PropertyEditorNodeWrapper(PropertyEditorValue* parent) : QObject(parent), m_valuesPropertyMap(this)
|
||||||
{
|
{
|
||||||
m_editorValue = parent;
|
m_editorValue = parent;
|
||||||
connect(m_editorValue, SIGNAL(modelNodeChanged()), this, SLOT(update()));
|
connect(m_editorValue, &PropertyEditorValue::modelNodeChanged, this, &PropertyEditorNodeWrapper::update);
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyEditorNodeWrapper::PropertyEditorNodeWrapper(QObject *parent) : QObject(parent), m_editorValue(NULL)
|
PropertyEditorNodeWrapper::PropertyEditorNodeWrapper(QObject *parent) : QObject(parent), m_editorValue(NULL)
|
||||||
@@ -466,12 +466,12 @@ void PropertyEditorNodeWrapper::setup()
|
|||||||
PropertyEditorValue *valueObject = new PropertyEditorValue(&m_valuesPropertyMap);
|
PropertyEditorValue *valueObject = new PropertyEditorValue(&m_valuesPropertyMap);
|
||||||
valueObject->setName(propertyName);
|
valueObject->setName(propertyName);
|
||||||
valueObject->setValue(qmlObjectNode.instanceValue(propertyName));
|
valueObject->setValue(qmlObjectNode.instanceValue(propertyName));
|
||||||
connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)));
|
connect(valueObject, &PropertyEditorValue::valueChanged, &m_valuesPropertyMap, &QQmlPropertyMap::valueChanged);
|
||||||
m_valuesPropertyMap.insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject));
|
m_valuesPropertyMap.insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
connect(&m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), this, SLOT(changeValue(QString)));
|
connect(&m_valuesPropertyMap, &QQmlPropertyMap::valueChanged, this, &PropertyEditorNodeWrapper::changeValue);
|
||||||
|
|
||||||
emit propertiesChanged();
|
emit propertiesChanged();
|
||||||
emit existsChanged();
|
emit existsChanged();
|
||||||
|
@@ -80,13 +80,13 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) :
|
|||||||
m_qmlDir = PropertyEditorQmlBackend::propertyEditorResourcesPath();
|
m_qmlDir = PropertyEditorQmlBackend::propertyEditorResourcesPath();
|
||||||
|
|
||||||
m_updateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F3), m_stackedWidget);
|
m_updateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F3), m_stackedWidget);
|
||||||
connect(m_updateShortcut, SIGNAL(activated()), this, SLOT(reloadQml()));
|
connect(m_updateShortcut, &QShortcut::activated, this, &PropertyEditorView::reloadQml);
|
||||||
|
|
||||||
m_stackedWidget->setStyleSheet(Theme::replaceCssColors(
|
m_stackedWidget->setStyleSheet(Theme::replaceCssColors(
|
||||||
QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css")))));
|
QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css")))));
|
||||||
m_stackedWidget->setMinimumWidth(320);
|
m_stackedWidget->setMinimumWidth(320);
|
||||||
m_stackedWidget->move(0, 0);
|
m_stackedWidget->move(0, 0);
|
||||||
connect(m_stackedWidget, SIGNAL(resized()), this, SLOT(updateSize()));
|
connect(m_stackedWidget, &PropertyEditorWidget::resized, this, &PropertyEditorView::updateSize);
|
||||||
|
|
||||||
m_stackedWidget->insertWidget(0, new QWidget(m_stackedWidget));
|
m_stackedWidget->insertWidget(0, new QWidget(m_stackedWidget));
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ void PropertyEditorView::modelAttached(Model *model)
|
|||||||
if (!m_setupCompleted) {
|
if (!m_setupCompleted) {
|
||||||
m_singleShotTimer->setSingleShot(true);
|
m_singleShotTimer->setSingleShot(true);
|
||||||
m_singleShotTimer->setInterval(100);
|
m_singleShotTimer->setInterval(100);
|
||||||
connect(m_singleShotTimer, SIGNAL(timeout()), this, SLOT(setupPanes()));
|
connect(m_singleShotTimer, &QTimer::timeout, this, &PropertyEditorView::setupPanes);
|
||||||
m_singleShotTimer->start();
|
m_singleShotTimer->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -87,7 +87,6 @@ public:
|
|||||||
const NodeAbstractProperty &oldPropertyParent,
|
const NodeAbstractProperty &oldPropertyParent,
|
||||||
AbstractView::PropertyChangeFlags propertyChange) override;
|
AbstractView::PropertyChangeFlags propertyChange) override;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void changeValue(const QString &name);
|
void changeValue(const QString &name);
|
||||||
void changeExpression(const QString &name);
|
void changeExpression(const QString &name);
|
||||||
void exportPopertyAsAlias(const QString &name);
|
void exportPopertyAsAlias(const QString &name);
|
||||||
@@ -98,13 +97,11 @@ protected:
|
|||||||
void setupPane(const TypeName &typeName);
|
void setupPane(const TypeName &typeName);
|
||||||
void setValue(const QmlObjectNode &fxObjectNode, const PropertyName &name, const QVariant &value);
|
void setValue(const QmlObjectNode &fxObjectNode, const PropertyName &name, const QVariant &value);
|
||||||
|
|
||||||
private slots:
|
private: //functions
|
||||||
void reloadQml();
|
void reloadQml();
|
||||||
void updateSize();
|
void updateSize();
|
||||||
void setupPanes();
|
void setupPanes();
|
||||||
|
|
||||||
private: //functions
|
|
||||||
|
|
||||||
void select(const ModelNode& node);
|
void select(const ModelNode& node);
|
||||||
|
|
||||||
void delayedResetView();
|
void delayedResetView();
|
||||||
|
@@ -56,8 +56,6 @@ signals:
|
|||||||
void selectionToBeChanged();
|
void selectionToBeChanged();
|
||||||
void selectionChanged();
|
void selectionChanged();
|
||||||
|
|
||||||
public slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QmlItemNode m_qmlItemNode;
|
QmlItemNode m_qmlItemNode;
|
||||||
};
|
};
|
||||||
|
@@ -91,7 +91,7 @@ StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, State
|
|||||||
engine()->addImportPath(qmlSourcesPath());
|
engine()->addImportPath(qmlSourcesPath());
|
||||||
|
|
||||||
m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F4), this);
|
m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F4), this);
|
||||||
connect(m_qmlSourceUpdateShortcut, SIGNAL(activated()), this, SLOT(reloadQmlSource()));
|
connect(m_qmlSourceUpdateShortcut, &QShortcut::activated, this, &StatesEditorWidget::reloadQmlSource);
|
||||||
|
|
||||||
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
@@ -61,9 +61,9 @@ public:
|
|||||||
|
|
||||||
void toggleStatesViewExpanded();
|
void toggleStatesViewExpanded();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void reloadQmlSource();
|
void reloadQmlSource();
|
||||||
void handleExpandedChanged();
|
Q_SLOT void handleExpandedChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointer<StatesEditorView> m_statesEditorView;
|
QPointer<StatesEditorView> m_statesEditorView;
|
||||||
|
@@ -57,7 +57,7 @@ bool isTabAndParentIsTabView(const ModelNode &modelNode)
|
|||||||
AddTabDesignerAction::AddTabDesignerAction()
|
AddTabDesignerAction::AddTabDesignerAction()
|
||||||
: AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
: AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
|
||||||
{
|
{
|
||||||
connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
|
connect(action(), &QAction::triggered, this, &AddTabDesignerAction::addNewTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AddTabDesignerAction::category() const
|
QByteArray AddTabDesignerAction::category() const
|
||||||
|
@@ -44,7 +44,7 @@ protected:
|
|||||||
bool isVisible(const SelectionContext &selectionContext) const;
|
bool isVisible(const SelectionContext &selectionContext) const;
|
||||||
bool isEnabled(const SelectionContext &selectionContext) const;
|
bool isEnabled(const SelectionContext &selectionContext) const;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void addNewTab();
|
void addNewTab();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ public:
|
|||||||
: DefaultAction(description)
|
: DefaultAction(description)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public /*slots*/:
|
public:
|
||||||
void actionTriggered(bool) override
|
void actionTriggered(bool) override
|
||||||
{
|
{
|
||||||
DocumentManager::goIntoComponent(m_selectionContext.targetNode());
|
DocumentManager::goIntoComponent(m_selectionContext.targetNode());
|
||||||
|
@@ -61,9 +61,6 @@ public:
|
|||||||
bool moveToComponent(int /* nodeOffset */) override
|
bool moveToComponent(int /* nodeOffset */) override
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
public slots:
|
|
||||||
void contentsChange(int position, int charsRemoved, int charsAdded);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TextModifier *m_originalModifier;
|
TextModifier *m_originalModifier;
|
||||||
int m_componentStartOffset;
|
int m_componentStartOffset;
|
||||||
|
@@ -183,7 +183,7 @@ private: // functions
|
|||||||
void restartProcess();
|
void restartProcess();
|
||||||
void delayedRestartProcess();
|
void delayedRestartProcess();
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleCrash();
|
void handleCrash();
|
||||||
|
|
||||||
private: //variables
|
private: //variables
|
||||||
|
@@ -80,10 +80,8 @@ protected:
|
|||||||
QPlainTextEdit *plainTextEdit() const
|
QPlainTextEdit *plainTextEdit() const
|
||||||
{ return m_textEdit; }
|
{ return m_textEdit; }
|
||||||
|
|
||||||
private slots:
|
|
||||||
void textEditChanged();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void textEditChanged();
|
||||||
void runRewriting(Utils::ChangeSet *writer);
|
void runRewriting(Utils::ChangeSet *writer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -159,7 +159,6 @@ public:
|
|||||||
|
|
||||||
void setWidgetStatusCallback(std::function<void(bool)> setWidgetStatusCallback);
|
void setWidgetStatusCallback(std::function<void(bool)> setWidgetStatusCallback);
|
||||||
|
|
||||||
public slots:
|
|
||||||
void qmlTextChanged();
|
void qmlTextChanged();
|
||||||
void delayedSetup();
|
void delayedSetup();
|
||||||
|
|
||||||
|
@@ -52,12 +52,11 @@ public:
|
|||||||
QStringList qmlFiles() const;
|
QStringList qmlFiles() const;
|
||||||
QStringList directories() const;
|
QStringList directories() const;
|
||||||
|
|
||||||
private slots:
|
private: // functions
|
||||||
void parseDirectory(const QString &canonicalDirPath, bool addToLibrary = true, const TypeName &qualification = TypeName());
|
void parseDirectory(const QString &canonicalDirPath, bool addToLibrary = true, const TypeName &qualification = TypeName());
|
||||||
void parseFile(const QString &canonicalFilePath, bool addToLibrary, const QString&);
|
void parseFile(const QString &canonicalFilePath, bool addToLibrary, const QString&);
|
||||||
void parseFile(const QString &canonicalFilePath);
|
void parseFile(const QString &canonicalFilePath);
|
||||||
|
|
||||||
private: // functions
|
|
||||||
void addImport(int pos, const Import &import);
|
void addImport(int pos, const Import &import);
|
||||||
void removeImport(int pos);
|
void removeImport(int pos);
|
||||||
void parseDirectories();
|
void parseDirectories();
|
||||||
|
@@ -172,7 +172,8 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
|
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_firstSocket = m_localServer->nextPendingConnection();
|
m_firstSocket = m_localServer->nextPendingConnection();
|
||||||
connect(m_firstSocket.data(), SIGNAL(readyRead()), this, SLOT(readFirstDataStream()));
|
connect(m_firstSocket.data(), &QIODevice::readyRead, this,
|
||||||
|
&NodeInstanceServerProxy::readFirstDataStream);
|
||||||
|
|
||||||
if (runModus == NormalModus) {
|
if (runModus == NormalModus) {
|
||||||
if (!m_localServer->hasPendingConnections())
|
if (!m_localServer->hasPendingConnections())
|
||||||
@@ -180,7 +181,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
|
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_secondSocket = m_localServer->nextPendingConnection();
|
m_secondSocket = m_localServer->nextPendingConnection();
|
||||||
connect(m_secondSocket.data(), SIGNAL(readyRead()), this, SLOT(readSecondDataStream()));
|
connect(m_secondSocket.data(), &QIODevice::readyRead, this, &NodeInstanceServerProxy::readSecondDataStream);
|
||||||
|
|
||||||
if (!m_localServer->hasPendingConnections())
|
if (!m_localServer->hasPendingConnections())
|
||||||
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
|
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
|
||||||
@@ -188,7 +189,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
qCInfo(instanceViewBenchmark) << "puppets connected:" << m_benchmarkTimer.elapsed();
|
qCInfo(instanceViewBenchmark) << "puppets connected:" << m_benchmarkTimer.elapsed();
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_thirdSocket = m_localServer->nextPendingConnection();
|
m_thirdSocket = m_localServer->nextPendingConnection();
|
||||||
connect(m_thirdSocket.data(), SIGNAL(readyRead()), this, SLOT(readThirdDataStream()));
|
connect(m_thirdSocket.data(), &QIODevice::readyRead, this, &NodeInstanceServerProxy::readThirdDataStream);
|
||||||
} else {
|
} else {
|
||||||
showCannotConnectToPuppetWarningAndSwitchToEditMode();
|
showCannotConnectToPuppetWarningAndSwitchToEditMode();
|
||||||
}
|
}
|
||||||
@@ -252,18 +253,18 @@ NodeInstanceServerProxy::~NodeInstanceServerProxy()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_qmlPuppetEditorProcess) {
|
if (m_qmlPuppetEditorProcess) {
|
||||||
QTimer::singleShot(3000, m_qmlPuppetEditorProcess.data(), SLOT(terminate()));
|
QTimer::singleShot(3000, m_qmlPuppetEditorProcess.data(), &QProcess::terminate);
|
||||||
QTimer::singleShot(6000, m_qmlPuppetEditorProcess.data(), SLOT(kill()));
|
QTimer::singleShot(6000, m_qmlPuppetEditorProcess.data(), &QProcess::kill);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_qmlPuppetPreviewProcess) {
|
if (m_qmlPuppetPreviewProcess) {
|
||||||
QTimer::singleShot(3000, m_qmlPuppetPreviewProcess.data(), SLOT(terminate()));
|
QTimer::singleShot(3000, m_qmlPuppetPreviewProcess.data(), &QProcess::terminate);
|
||||||
QTimer::singleShot(6000, m_qmlPuppetPreviewProcess.data(), SLOT(kill()));
|
QTimer::singleShot(6000, m_qmlPuppetPreviewProcess.data(), &QProcess::kill);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_qmlPuppetRenderProcess) {
|
if (m_qmlPuppetRenderProcess) {
|
||||||
QTimer::singleShot(3000, m_qmlPuppetRenderProcess.data(), SLOT(terminate()));
|
QTimer::singleShot(3000, m_qmlPuppetRenderProcess.data(), &QProcess::terminate);
|
||||||
QTimer::singleShot(6000, m_qmlPuppetRenderProcess.data(), SLOT(kill()));
|
QTimer::singleShot(6000, m_qmlPuppetRenderProcess.data(), &QProcess::kill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -151,9 +151,10 @@ bool isSkippedNode(const ModelNode &node)
|
|||||||
void NodeInstanceView::modelAttached(Model *model)
|
void NodeInstanceView::modelAttached(Model *model)
|
||||||
{
|
{
|
||||||
AbstractView::modelAttached(model);
|
AbstractView::modelAttached(model);
|
||||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
|
auto server = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
|
||||||
|
m_nodeInstanceServer = server;
|
||||||
m_lastCrashTime.start();
|
m_lastCrashTime.start();
|
||||||
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleCrash()));
|
connect(server, &NodeInstanceServerProxy::processCrashed, this, &NodeInstanceView::handleCrash);
|
||||||
|
|
||||||
if (!isSkippedRootNode(rootModelNode()))
|
if (!isSkippedRootNode(rootModelNode()))
|
||||||
nodeInstanceServer()->createScene(createCreateSceneCommand());
|
nodeInstanceServer()->createScene(createCreateSceneCommand());
|
||||||
@@ -204,8 +205,9 @@ void NodeInstanceView::restartProcess()
|
|||||||
if (model()) {
|
if (model()) {
|
||||||
delete nodeInstanceServer();
|
delete nodeInstanceServer();
|
||||||
|
|
||||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
|
auto server = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
|
||||||
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleCrash()));
|
m_nodeInstanceServer = server;
|
||||||
|
connect(server, &NodeInstanceServerProxy::processCrashed, this, &NodeInstanceView::handleCrash);
|
||||||
|
|
||||||
if (!isSkippedRootNode(rootModelNode()))
|
if (!isSkippedRootNode(rootModelNode()))
|
||||||
nodeInstanceServer()->createScene(createCreateSceneCommand());
|
nodeInstanceServer()->createScene(createCreateSceneCommand());
|
||||||
|
@@ -43,7 +43,7 @@ PuppetBuildProgressDialog::PuppetBuildProgressDialog() :
|
|||||||
setWindowModality(Qt::ApplicationModal);
|
setWindowModality(Qt::ApplicationModal);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->buildProgressBar->setMaximum(85);
|
ui->buildProgressBar->setMaximum(85);
|
||||||
connect(ui->useFallbackPuppetPushButton, SIGNAL(clicked()), this, SLOT(setUseFallbackPuppet()));
|
connect(ui->useFallbackPuppetPushButton, &QAbstractButton::clicked, this, &PuppetBuildProgressDialog::setUseFallbackPuppet);
|
||||||
}
|
}
|
||||||
|
|
||||||
PuppetBuildProgressDialog::~PuppetBuildProgressDialog()
|
PuppetBuildProgressDialog::~PuppetBuildProgressDialog()
|
||||||
@@ -71,7 +71,7 @@ void PuppetBuildProgressDialog::setErrorMessage(const QString &message)
|
|||||||
{
|
{
|
||||||
ui->label->setText(QString::fromLatin1("<font color='red'>%1</font>").arg(message));
|
ui->label->setText(QString::fromLatin1("<font color='red'>%1</font>").arg(message));
|
||||||
ui->useFallbackPuppetPushButton->setText(tr("OK"));
|
ui->useFallbackPuppetPushButton->setText(tr("OK"));
|
||||||
connect(ui->useFallbackPuppetPushButton, SIGNAL(clicked()), this, SLOT(accept()));
|
connect(ui->useFallbackPuppetPushButton, &QAbstractButton::clicked, this, &QDialog::accept);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuppetBuildProgressDialog::setUseFallbackPuppet()
|
void PuppetBuildProgressDialog::setUseFallbackPuppet()
|
||||||
|
@@ -48,7 +48,7 @@ public:
|
|||||||
void setErrorOutputFile(const QString &filePath);
|
void setErrorOutputFile(const QString &filePath);
|
||||||
void setErrorMessage(const QString &message);
|
void setErrorMessage(const QString &message);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void setUseFallbackPuppet();
|
void setUseFallbackPuppet();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -197,7 +197,7 @@ QProcess *PuppetCreator::puppetProcess(const QString &puppetPath,
|
|||||||
puppetProcess->setObjectName(puppetMode);
|
puppetProcess->setObjectName(puppetMode);
|
||||||
puppetProcess->setProcessEnvironment(processEnvironment());
|
puppetProcess->setProcessEnvironment(processEnvironment());
|
||||||
|
|
||||||
QObject::connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), puppetProcess, SLOT(kill()));
|
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, puppetProcess, &QProcess::kill);
|
||||||
QObject::connect(puppetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), handlerObject, finishSlot);
|
QObject::connect(puppetProcess, SIGNAL(finished(int,QProcess::ExitStatus)), handlerObject, finishSlot);
|
||||||
|
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
@@ -63,7 +63,8 @@ SubComponentManager::SubComponentManager(Model *model, QObject *parent)
|
|||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_model(model)
|
m_model(model)
|
||||||
{
|
{
|
||||||
connect(&m_watcher, SIGNAL(directoryChanged(QString)), this, SLOT(parseDirectory(QString)));
|
connect(&m_watcher, &QFileSystemWatcher::directoryChanged,
|
||||||
|
this, [this](const QString &path) { parseDirectory(path); });
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubComponentManager::addImport(int pos, const Import &import)
|
void SubComponentManager::addImport(int pos, const Import &import)
|
||||||
|
@@ -33,10 +33,10 @@ ComponentTextModifier::ComponentTextModifier(TextModifier *originalModifier, int
|
|||||||
m_componentEndOffset(componentEndOffset),
|
m_componentEndOffset(componentEndOffset),
|
||||||
m_rootStartOffset(rootStartOffset)
|
m_rootStartOffset(rootStartOffset)
|
||||||
{
|
{
|
||||||
connect(m_originalModifier, SIGNAL(textChanged()), this, SIGNAL(textChanged()));
|
connect(m_originalModifier, &TextModifier::textChanged, this, &TextModifier::textChanged);
|
||||||
|
|
||||||
connect(m_originalModifier, SIGNAL(replaced(int,int,int)), this, SIGNAL(replaced(int,int,int)));
|
connect(m_originalModifier, &TextModifier::replaced, this, &TextModifier::replaced);
|
||||||
connect(m_originalModifier, SIGNAL(moved(TextModifier::MoveInfo)), this, SIGNAL(moved(TextModifier::MoveInfo)));
|
connect(m_originalModifier, &TextModifier::moved, this, &TextModifier::moved);
|
||||||
}
|
}
|
||||||
|
|
||||||
ComponentTextModifier::~ComponentTextModifier()
|
ComponentTextModifier::~ComponentTextModifier()
|
||||||
@@ -148,7 +148,3 @@ void ComponentTextModifier::reactivateChangeSignals()
|
|||||||
{
|
{
|
||||||
m_originalModifier->reactivateChangeSignals();
|
m_originalModifier->reactivateChangeSignals();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentTextModifier::contentsChange(int /*position*/, int /*charsRemoved*/, int /*charsAdded*/)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
@@ -34,8 +34,8 @@ void ModelNodePositionRecalculator::connectTo(TextModifier *textModifier)
|
|||||||
{
|
{
|
||||||
Q_ASSERT(textModifier);
|
Q_ASSERT(textModifier);
|
||||||
|
|
||||||
connect(textModifier, SIGNAL(moved(TextModifier::MoveInfo)), this, SLOT(moved(TextModifier::MoveInfo)));
|
connect(textModifier, &TextModifier::moved, this, &ModelNodePositionRecalculator::moved);
|
||||||
connect(textModifier, SIGNAL(replaced(int,int,int)), this, SLOT(replaced(int,int,int)));
|
connect(textModifier, &TextModifier::replaced, this, &ModelNodePositionRecalculator::replaced);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModelNodePositionRecalculator::moved(const TextModifier::MoveInfo &moveInfo)
|
void ModelNodePositionRecalculator::moved(const TextModifier::MoveInfo &moveInfo)
|
||||||
|
@@ -49,7 +49,6 @@ public:
|
|||||||
QMap<int,int> dirtyAreas() const
|
QMap<int,int> dirtyAreas() const
|
||||||
{ return m_dirtyAreas; }
|
{ return m_dirtyAreas; }
|
||||||
|
|
||||||
public slots:
|
|
||||||
void replaced(int offset, int oldLength, int newLength);
|
void replaced(int offset, int oldLength, int newLength);
|
||||||
void moved(const TextModifier::MoveInfo &moveInfo);
|
void moved(const TextModifier::MoveInfo &moveInfo);
|
||||||
|
|
||||||
|
@@ -44,8 +44,8 @@ PlainTextEditModifier::PlainTextEditModifier(QPlainTextEdit *textEdit):
|
|||||||
{
|
{
|
||||||
Q_ASSERT(textEdit);
|
Q_ASSERT(textEdit);
|
||||||
|
|
||||||
connect(m_textEdit, SIGNAL(textChanged()),
|
connect(m_textEdit, &QPlainTextEdit::textChanged,
|
||||||
this, SLOT(textEditChanged()));
|
this, &PlainTextEditModifier::textEditChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlainTextEditModifier::~PlainTextEditModifier()
|
PlainTextEditModifier::~PlainTextEditModifier()
|
||||||
|
@@ -344,12 +344,12 @@ TextModifier *RewriterView::textModifier() const
|
|||||||
void RewriterView::setTextModifier(TextModifier *textModifier)
|
void RewriterView::setTextModifier(TextModifier *textModifier)
|
||||||
{
|
{
|
||||||
if (m_textModifier)
|
if (m_textModifier)
|
||||||
disconnect(m_textModifier, SIGNAL(textChanged()), this, SLOT(qmlTextChanged()));
|
disconnect(m_textModifier, &TextModifier::textChanged, this, &RewriterView::qmlTextChanged);
|
||||||
|
|
||||||
m_textModifier = textModifier;
|
m_textModifier = textModifier;
|
||||||
|
|
||||||
if (m_textModifier)
|
if (m_textModifier)
|
||||||
connect(m_textModifier, SIGNAL(textChanged()), this, SLOT(qmlTextChanged()));
|
connect(m_textModifier, &TextModifier::textChanged, this, &RewriterView::qmlTextChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString RewriterView::textModifierContent() const
|
QString RewriterView::textModifierContent() const
|
||||||
|
@@ -713,7 +713,7 @@ TextToModelMerger::TextToModelMerger(RewriterView *reWriterView) :
|
|||||||
{
|
{
|
||||||
Q_ASSERT(reWriterView);
|
Q_ASSERT(reWriterView);
|
||||||
m_setupTimer.setSingleShot(true);
|
m_setupTimer.setSingleShot(true);
|
||||||
RewriterView::connect(&m_setupTimer, SIGNAL(timeout()), reWriterView, SLOT(delayedSetup()));
|
RewriterView::connect(&m_setupTimer, &QTimer::timeout, reWriterView, &RewriterView::delayedSetup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextToModelMerger::setActive(bool active)
|
void TextToModelMerger::setActive(bool active)
|
||||||
|
@@ -214,14 +214,18 @@ void ViewManager::detachAdditionalViews()
|
|||||||
void ViewManager::attachComponentView()
|
void ViewManager::attachComponentView()
|
||||||
{
|
{
|
||||||
documentModel()->attachView(&d->componentView);
|
documentModel()->attachView(&d->componentView);
|
||||||
QObject::connect(d->componentView.action(), SIGNAL(currentComponentChanged(ModelNode)), currentDesignDocument(), SLOT(changeToSubComponent(ModelNode)));
|
QObject::connect(d->componentView.action(), &ComponentAction::currentComponentChanged,
|
||||||
QObject::connect(d->componentView.action(), SIGNAL(changedToMaster()), currentDesignDocument(), SLOT(changeToMaster()));
|
currentDesignDocument(), &DesignDocument::changeToSubComponent);
|
||||||
|
QObject::connect(d->componentView.action(), &ComponentAction::changedToMaster,
|
||||||
|
currentDesignDocument(), &DesignDocument::changeToMaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewManager::detachComponentView()
|
void ViewManager::detachComponentView()
|
||||||
{
|
{
|
||||||
QObject::disconnect(d->componentView.action(), SIGNAL(currentComponentChanged(ModelNode)), currentDesignDocument(), SLOT(changeToSubComponent(ModelNode)));
|
QObject::disconnect(d->componentView.action(), &ComponentAction::currentComponentChanged,
|
||||||
QObject::disconnect(d->componentView.action(), SIGNAL(changedToMaster()), currentDesignDocument(), SLOT(changeToMaster()));
|
currentDesignDocument(), &DesignDocument::changeToSubComponent);
|
||||||
|
QObject::disconnect(d->componentView.action(), &ComponentAction::changedToMaster,
|
||||||
|
currentDesignDocument(), &DesignDocument::changeToMaster);
|
||||||
|
|
||||||
documentModel()->detachView(&d->componentView);
|
documentModel()->detachView(&d->componentView);
|
||||||
}
|
}
|
||||||
|
@@ -84,19 +84,17 @@ public:
|
|||||||
CrumbleBar* crumbleBar() const;
|
CrumbleBar* crumbleBar() const;
|
||||||
void showInternalTextEditor();
|
void showInternalTextEditor();
|
||||||
|
|
||||||
public slots:
|
|
||||||
void restoreDefaultView();
|
void restoreDefaultView();
|
||||||
void toggleSidebars();
|
void toggleSidebars();
|
||||||
void toggleLeftSidebar();
|
void toggleLeftSidebar();
|
||||||
void toggleRightSidebar();
|
void toggleRightSidebar();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void toolBarOnGoBackClicked();
|
|
||||||
void toolBarOnGoForwardClicked();
|
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
enum InitializeStatus { NotInitialized, Initializing, Initialized };
|
enum InitializeStatus { NotInitialized, Initializing, Initialized };
|
||||||
|
|
||||||
|
void toolBarOnGoBackClicked();
|
||||||
|
void toolBarOnGoForwardClicked();
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
bool isInNodeDefinition(int nodeOffset, int nodeLength, int cursorPos) const;
|
bool isInNodeDefinition(int nodeOffset, int nodeLength, int cursorPos) const;
|
||||||
QmlDesigner::ModelNode nodeForPosition(int cursorPos) const;
|
QmlDesigner::ModelNode nodeForPosition(int cursorPos) const;
|
||||||
|
@@ -178,9 +178,9 @@ void ColorTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList)
|
|||||||
m_colorDialog = new QColorDialog(view()->formEditorWidget()->parentWidget());
|
m_colorDialog = new QColorDialog(view()->formEditorWidget()->parentWidget());
|
||||||
m_colorDialog.data()->setCurrentColor(m_oldColor);
|
m_colorDialog.data()->setCurrentColor(m_oldColor);
|
||||||
|
|
||||||
connect(m_colorDialog.data(), SIGNAL(accepted()), SLOT(colorDialogAccepted()));
|
connect(m_colorDialog.data(), &QDialog::accepted, this, &ColorTool::colorDialogAccepted);
|
||||||
connect(m_colorDialog.data(), SIGNAL(rejected()), SLOT(colorDialogRejected()));
|
connect(m_colorDialog.data(), &QDialog::rejected, this, &ColorTool::colorDialogRejected);
|
||||||
connect(m_colorDialog.data(), SIGNAL(currentColorChanged(QColor)), SLOT(currentColorChanged(QColor)));
|
connect(m_colorDialog.data(), &QColorDialog::currentColorChanged, this, &ColorTool::currentColorChanged);
|
||||||
|
|
||||||
m_colorDialog.data()->exec();
|
m_colorDialog.data()->exec();
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
|
|
||||||
QString name() const override;
|
QString name() const override;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void colorDialogAccepted();
|
void colorDialogAccepted();
|
||||||
void colorDialogRejected();
|
void colorDialogRejected();
|
||||||
void currentColorChanged(const QColor &color);
|
void currentColorChanged(const QColor &color);
|
||||||
|
@@ -61,7 +61,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void updatePropertyName(int rowNumber);
|
void updatePropertyName(int rowNumber);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -228,7 +228,7 @@ void BindingModel::addBindingForCurrentNode()
|
|||||||
modelNode.bindingProperty(unusedProperty(modelNode)).setExpression(QLatin1String("none.none"));
|
modelNode.bindingProperty(unusedProperty(modelNode)).setExpression(QLatin1String("none.none"));
|
||||||
} catch (RewritingException &e) {
|
} catch (RewritingException &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &BindingModel::handleException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -309,7 +309,7 @@ void BindingModel::updateExpression(int row)
|
|||||||
transaction.commit(); //committing in the try block
|
transaction.commit(); //committing in the try block
|
||||||
} catch (Exception &e) {
|
} catch (Exception &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &BindingModel::handleException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +335,7 @@ void BindingModel::updatePropertyName(int rowNumber)
|
|||||||
transaction.commit(); //committing in the try block
|
transaction.commit(); //committing in the try block
|
||||||
} catch (Exception &e) { //better save then sorry
|
} catch (Exception &e) { //better save then sorry
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &BindingModel::handleException);
|
||||||
}
|
}
|
||||||
|
|
||||||
QStandardItem* idItem = item(rowNumber, 0);
|
QStandardItem* idItem = item(rowNumber, 0);
|
||||||
|
@@ -75,7 +75,7 @@ protected:
|
|||||||
|
|
||||||
void updateDisplayRole(int row, int columns, const QString &string);
|
void updateDisplayRole(int row, int columns, const QString &string);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
||||||
void handleException();
|
void handleException();
|
||||||
|
|
||||||
|
@@ -174,7 +174,7 @@ void ConnectionModel::updateSource(int row)
|
|||||||
}
|
}
|
||||||
catch (Exception &e) {
|
catch (Exception &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &ConnectionModel::handleException);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ protected:
|
|||||||
void updateCustomData(QStandardItem *item, const SignalHandlerProperty &signalHandlerProperty);
|
void updateCustomData(QStandardItem *item, const SignalHandlerProperty &signalHandlerProperty);
|
||||||
QStringList getPossibleSignalsForConnection(const ModelNode &connection) const;
|
QStringList getPossibleSignalsForConnection(const ModelNode &connection) const;
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
||||||
void handleException();
|
void handleException();
|
||||||
|
|
||||||
|
@@ -81,11 +81,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
|
|||||||
ui->backendView->setStyleSheet(Theme::replaceCssColors(
|
ui->backendView->setStyleSheet(Theme::replaceCssColors(
|
||||||
QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
|
QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
|
||||||
|
|
||||||
connect(ui->tabBar, SIGNAL(currentChanged(int)),
|
connect(ui->tabBar, &QTabBar::currentChanged,
|
||||||
ui->stackedWidget, SLOT(setCurrentIndex(int)));
|
ui->stackedWidget, &QStackedWidget::setCurrentIndex);
|
||||||
|
|
||||||
connect(ui->tabBar, SIGNAL(currentChanged(int)),
|
connect(ui->tabBar, &QTabBar::currentChanged,
|
||||||
this, SLOT(handleTabChanged(int)));
|
this, &ConnectionViewWidget::handleTabChanged);
|
||||||
|
|
||||||
ui->stackedWidget->setCurrentIndex(0);
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
@@ -145,15 +145,15 @@ QList<QToolButton *> ConnectionViewWidget::createToolBarWidgets()
|
|||||||
buttons << new QToolButton();
|
buttons << new QToolButton();
|
||||||
buttons.last()->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
buttons.last()->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
||||||
buttons.last()->setToolTip(tr("Add binding or connection."));
|
buttons.last()->setToolTip(tr("Add binding or connection."));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SLOT(addButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &ConnectionViewWidget::addButtonClicked);
|
||||||
connect(this, SIGNAL(setEnabledAddButton(bool)), buttons.last(), SLOT(setEnabled(bool)));
|
connect(this, &ConnectionViewWidget::setEnabledAddButton, buttons.last(), &QWidget::setEnabled);
|
||||||
|
|
||||||
buttons << new QToolButton();
|
buttons << new QToolButton();
|
||||||
buttons.last()->setIcon(Utils::Icons::MINUS.icon());
|
buttons.last()->setIcon(Utils::Icons::MINUS.icon());
|
||||||
buttons.last()->setToolTip(tr("Remove selected binding or connection."));
|
buttons.last()->setToolTip(tr("Remove selected binding or connection."));
|
||||||
buttons.last()->setShortcut(QKeySequence(Qt::Key_Delete));
|
buttons.last()->setShortcut(QKeySequence(Qt::Key_Delete));
|
||||||
connect(buttons.last(), SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
|
connect(buttons.last(), &QAbstractButton::clicked, this, &ConnectionViewWidget::removeButtonClicked);
|
||||||
connect(this, SIGNAL(setEnabledRemoveButton(bool)), buttons.last(), SLOT(setEnabled(bool)));
|
connect(this, &ConnectionViewWidget::setEnabledRemoveButton, buttons.last(), &QWidget::setEnabled);
|
||||||
|
|
||||||
return buttons;
|
return buttons;
|
||||||
}
|
}
|
||||||
|
@@ -79,7 +79,6 @@ public:
|
|||||||
QTableView *dynamicPropertiesTableView() const;
|
QTableView *dynamicPropertiesTableView() const;
|
||||||
QTableView *backendView() const;
|
QTableView *backendView() const;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void bindingTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void bindingTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
void connectionTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void connectionTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
void dynamicPropertiesTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void dynamicPropertiesTableViewSelectionChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
@@ -89,7 +88,7 @@ signals:
|
|||||||
void setEnabledAddButton(bool enabled);
|
void setEnabledAddButton(bool enabled);
|
||||||
void setEnabledRemoveButton(bool enabled);
|
void setEnabledRemoveButton(bool enabled);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleTabChanged(int i);
|
void handleTabChanged(int i);
|
||||||
void removeButtonClicked();
|
void removeButtonClicked();
|
||||||
void addButtonClicked();
|
void addButtonClicked();
|
||||||
|
@@ -271,7 +271,7 @@ void DynamicPropertiesModel::addDynamicPropertyForCurrentNode()
|
|||||||
modelNode.variantProperty(unusedProperty(modelNode)).setDynamicTypeNameAndValue("string", QLatin1String("none.none"));
|
modelNode.variantProperty(unusedProperty(modelNode)).setDynamicTypeNameAndValue("string", QLatin1String("none.none"));
|
||||||
} catch (RewritingException &e) {
|
} catch (RewritingException &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -437,7 +437,7 @@ void DynamicPropertiesModel::updateValue(int row)
|
|||||||
transaction.commit(); //committing in the try block
|
transaction.commit(); //committing in the try block
|
||||||
} catch (Exception &e) {
|
} catch (Exception &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -453,7 +453,7 @@ void DynamicPropertiesModel::updateValue(int row)
|
|||||||
transaction.commit(); //committing in the try block
|
transaction.commit(); //committing in the try block
|
||||||
} catch (Exception &e) {
|
} catch (Exception &e) {
|
||||||
m_exceptionError = e.description();
|
m_exceptionError = e.description();
|
||||||
QTimer::singleShot(200, this, SLOT(handleException()));
|
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ protected:
|
|||||||
|
|
||||||
void updateDisplayRole(int row, int columns, const QString &string);
|
void updateDisplayRole(int row, int columns, const QString &string);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
|
||||||
void handleException();
|
void handleException();
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
|||||||
QmlDesignerPlugin::instance()->mainWidget(),
|
QmlDesignerPlugin::instance()->mainWidget(),
|
||||||
&Internal::DesignModeWidget::restoreDefaultView);
|
&Internal::DesignModeWidget::restoreDefaultView);
|
||||||
|
|
||||||
connect(&m_goIntoComponentAction, SIGNAL(triggered()), SLOT(goIntoComponent()));
|
connect(&m_goIntoComponentAction, &QAction::triggered, this, &ShortCutManager::goIntoComponent);
|
||||||
|
|
||||||
connect(&m_toggleLeftSidebarAction,
|
connect(&m_toggleLeftSidebarAction,
|
||||||
&QAction::triggered,
|
&QAction::triggered,
|
||||||
@@ -371,16 +371,16 @@ void ShortCutManager::toggleRightSidebar()
|
|||||||
void ShortCutManager::connectUndoActions(DesignDocument *designDocument)
|
void ShortCutManager::connectUndoActions(DesignDocument *designDocument)
|
||||||
{
|
{
|
||||||
if (designDocument) {
|
if (designDocument) {
|
||||||
connect(designDocument, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool)));
|
connect(designDocument, &DesignDocument::undoAvailable, this, &ShortCutManager::undoAvailable);
|
||||||
connect(designDocument, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool)));
|
connect(designDocument, &DesignDocument::redoAvailable, this, &ShortCutManager::redoAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortCutManager::disconnectUndoActions(DesignDocument *designDocument)
|
void ShortCutManager::disconnectUndoActions(DesignDocument *designDocument)
|
||||||
{
|
{
|
||||||
if (currentDesignDocument()) {
|
if (currentDesignDocument()) {
|
||||||
disconnect(designDocument, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool)));
|
disconnect(designDocument, &DesignDocument::undoAvailable, this, &ShortCutManager::undoAvailable);
|
||||||
disconnect(designDocument, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool)));
|
disconnect(designDocument, &DesignDocument::redoAvailable, this, &ShortCutManager::redoAvailable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -54,10 +54,9 @@ public:
|
|||||||
void updateUndoActions(DesignDocument *designDocument);
|
void updateUndoActions(DesignDocument *designDocument);
|
||||||
DesignDocument *currentDesignDocument() const;
|
DesignDocument *currentDesignDocument() const;
|
||||||
|
|
||||||
public slots:
|
|
||||||
void updateActions(Core::IEditor* editor);
|
void updateActions(Core::IEditor* editor);
|
||||||
|
|
||||||
private slots:
|
private:
|
||||||
void undo();
|
void undo();
|
||||||
void redo();
|
void redo();
|
||||||
void deleteSelected();
|
void deleteSelected();
|
||||||
|
Reference in New Issue
Block a user