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:
Orgad Shaneh
2017-03-19 00:19:33 +02:00
committed by Orgad Shaneh
parent f87c1eba68
commit 5221d5f06a
82 changed files with 168 additions and 197 deletions

View File

@@ -76,7 +76,7 @@ SelectionContext AbstractAction::selectionContext() const
DefaultAction::DefaultAction(const QString &description)
: QAction(description, 0)
{
connect(this, SIGNAL(triggered(bool)), this, SLOT(actionTriggered(bool)));
connect(this, &DefaultAction::triggered, this, &DefaultAction::actionTriggered);
}
void DefaultAction::actionTriggered(bool enable)

View File

@@ -39,13 +39,13 @@ class QMLDESIGNERCORE_EXPORT DefaultAction : public QAction
public:
DefaultAction(const QString &description);
signals:
void triggered(bool checked, const SelectionContext &selectionContext);
public slots: //virtual function instead of slot
// virtual function instead of slot
virtual void actionTriggered(bool enable);
void setSelectionContext(const SelectionContext &selectionContext);
signals:
void triggered(bool checked, const SelectionContext &selectionContext);
protected:
SelectionContext m_selectionContext;
};

View File

@@ -46,10 +46,8 @@ public:
Utils::CrumblePath *crumblePath();
private slots:
void onCrumblePathElementClicked(const QVariant &data);
private:
void onCrumblePathElementClicked(const QVariant &data);
void updateVisibility();
void showSaveDialog();

View File

@@ -107,7 +107,6 @@ public:
: DefaultAction(description), m_action(action)
{ }
public /*slots*/:
virtual void actionTriggered(bool b)
{
m_selectionContext.setToggled(b);

View File

@@ -36,7 +36,8 @@ namespace Internal {
DebugViewWidget::DebugViewWidget(QWidget *parent) : QWidget(parent)
{
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)

View File

@@ -45,7 +45,6 @@ public:
void setDebugViewEnabled(bool b);
public slots:
void enabledCheckBoxToggled(bool b);
private:

View File

@@ -64,7 +64,8 @@ QWidget *BackgroundAction::createWidget(QWidget *parent)
}
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->setToolTip(tr("Set the color of the canvas."));

View File

@@ -46,7 +46,7 @@ signals:
protected:
QWidget *createWidget(QWidget *parent);
private slots:
private:
void emitBackgroundChanged(int index);
private:

View File

@@ -84,7 +84,6 @@ public:
void highlightBoundingRect(FormEditorItem *formEditorItem);
public slots:
void setShowBoundingRects(bool show);
bool showBoundingRects() const;

View File

@@ -607,7 +607,7 @@ bool FormEditorView::isMoveToolAvailable() const
void FormEditorView::reset()
{
QTimer::singleShot(200, this, SLOT(delayedReset()));
QTimer::singleShot(200, this, &FormEditorView::delayedReset);
}
void FormEditorView::delayedReset()

View File

@@ -120,8 +120,6 @@ public:
protected:
void reset();
protected slots:
void delayedReset();
bool isMoveToolAvailable() const;

View File

@@ -120,13 +120,15 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
m_rootWidthAction = new LineEditAction(tr("Override Width"), this);
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());
upperActions.append(m_rootWidthAction.data());
m_rootHeightAction = new LineEditAction(tr("Override Height"), this);
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());
upperActions.append(m_rootHeightAction.data());
@@ -150,7 +152,8 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
m_toolBox->addRightSideAction(m_backgroundAction.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());
upperActions.append(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->setShortcutContext(Qt::WidgetWithChildrenShortcut);
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());
upperActions.append(m_resetAction.data());
m_toolBox->addRightSideAction(m_resetAction.data());

View File

@@ -88,7 +88,7 @@ protected:
QActionGroup *toolActionGroup() const;
DocumentWarningWidget *errorWidget();
private slots:
private:
void changeTransformTool(bool checked);
void setZoomLevel(double zoomLevel);
void changeRootItemWidth(const QString &widthText);

View File

@@ -57,9 +57,9 @@ QWidget *LineEditAction::createWidget(QWidget *parent)
lineEdit->setFont(font);
lineEdit->setValidator(new QIntValidator(0, 4096, this));
connect(lineEdit, SIGNAL(textEdited(QString)), this, SIGNAL(textChanged(QString)));
connect(this, SIGNAL(lineEditTextClear()), lineEdit, SLOT(clear()));
connect(this, SIGNAL(lineEditTextChange(QString)), lineEdit, SLOT(setText(QString)));
connect(lineEdit, &QLineEdit::textEdited, this, &LineEditAction::textChanged);
connect(this, &LineEditAction::lineEditTextClear, lineEdit, &QLineEdit::clear);
connect(this, &LineEditAction::lineEditTextChange, lineEdit, &QLineEdit::setText);
return lineEdit;
}

View File

@@ -59,7 +59,8 @@ QWidget *NumberSeriesAction::createWidget(QWidget *parent)
comboBox->setModel(m_comboBoxModel.data());
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;
}

View File

@@ -50,7 +50,7 @@ protected:
signals:
void valueChanged(const QVariant &value);
private slots:
private:
void emitValueChanged(int index);
private:

View File

@@ -91,8 +91,9 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
}
comboBox->setCurrentIndex(8);
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitZoomLevelChanged(int)));
connect(this, SIGNAL(indexChanged(int)), comboBox, SLOT(setCurrentIndex(int)));
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &ZoomAction::emitZoomLevelChanged);
connect(this, &ZoomAction::indexChanged, comboBox, &QComboBox::setCurrentIndex);
comboBox->setProperty("hideborder", true);
return comboBox;

View File

@@ -51,7 +51,8 @@ protected:
signals:
void zoomLevelChanged(double zoom);
void indexChanged(int);
private slots:
private:
void emitZoomLevelChanged(int index);
private:

View File

@@ -47,7 +47,7 @@ ImportLabel::ImportLabel(QWidget *parent) :
m_removeButton->setFocusPolicy(Qt::NoFocus);
m_removeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
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);
m_importLabel = new QLabel(this);
@@ -75,9 +75,4 @@ void ImportLabel::setReadOnly(bool readOnly) const
: Utils::Icons::CLOSE_TOOLBAR.icon());
}
void ImportLabel::emitRemoveImport()
{
emit removeImport(m_import);
}
} // namespace QmlDesigner

View File

@@ -45,9 +45,6 @@ public:
signals:
void removeImport(const Import &import);
private slots:
void emitRemoveImport();
private:
Import m_import;
QLabel *m_importLabel;

View File

@@ -52,8 +52,8 @@ WidgetInfo ImportManagerView::widgetInfo()
{
if (m_importsWidget == 0) {
m_importsWidget = new ImportsWidget;
connect(m_importsWidget, SIGNAL(removeImport(Import)), this, SLOT(removeImport(Import)));
connect(m_importsWidget, SIGNAL(addImport(Import)), this, SLOT(addImport(Import)));
connect(m_importsWidget.data(), &ImportsWidget::removeImport, this, &ImportManagerView::removeImport);
connect(m_importsWidget.data(), &ImportsWidget::addImport, this, &ImportManagerView::addImport);
if (model())
m_importsWidget->setImports(model()->imports());

View File

@@ -50,7 +50,7 @@ public:
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) override;
private slots:
private:
void removeImport(const Import &import);
void addImport(const Import &import);

View File

@@ -39,7 +39,8 @@ ImportsWidget::ImportsWidget(QWidget *parent) :
{
setWindowTitle(tr("Import Manager"));
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()
@@ -126,7 +127,7 @@ void ImportsWidget::setImports(const QList<Import> &imports)
ImportLabel *importLabel = new ImportLabel(this);
importLabel->setImport(import);
m_importLabels.append(importLabel);
connect(importLabel, SIGNAL(removeImport(Import)), this, SIGNAL(removeImport(Import)));
connect(importLabel, &ImportLabel::removeImport, this, &ImportsWidget::removeImport);
}
updateLayout();

View File

@@ -59,7 +59,7 @@ signals:
protected:
void updateLayout();
private slots:
private:
void addSelectedImport(int addImportComboBoxIndex);
private:

View File

@@ -53,8 +53,9 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
comboBox->setToolTip(tr("Edit sub components defined in this file."));
comboBox->setModel(m_componentView->standardItemModel());
comboBox->setCurrentIndex(-1);
connect(comboBox, SIGNAL(activated(int)), SLOT(emitCurrentComponentChanged(int)));
connect(this, SIGNAL(currentIndexChanged(int)), comboBox, SLOT(setCurrentIndex(int)));
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),
this, &ComponentAction::emitCurrentComponentChanged);
connect(this, &ComponentAction::currentIndexChanged, comboBox, &QComboBox::setCurrentIndex);
return comboBox;
}

View File

@@ -44,7 +44,7 @@ class ComponentAction : public QWidgetAction
public:
ComponentAction(ComponentView *componentView);
void setCurrentIndex(int index);
void emitCurrentComponentChanged(int index);
protected:
QWidget *createWidget(QWidget *parent);
@@ -54,9 +54,6 @@ signals:
void changedToMaster();
void currentIndexChanged(int index);
public slots:
void emitCurrentComponentChanged(int index);
private:
QPointer<ComponentView> m_componentView;
bool dontEmitCurrentComponentChanged;

View File

@@ -235,12 +235,12 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit)
{
Q_CHECK_PTR(edit);
connect(edit, SIGNAL(undoAvailable(bool)),
this, SIGNAL(undoAvailable(bool)));
connect(edit, SIGNAL(redoAvailable(bool)),
this, SIGNAL(redoAvailable(bool)));
connect(edit, SIGNAL(modificationChanged(bool)),
this, SIGNAL(dirtyStateChanged(bool)));
connect(edit, &QPlainTextEdit::undoAvailable,
this, &DesignDocument::undoAvailable);
connect(edit, &QPlainTextEdit::redoAvailable,
this, &DesignDocument::redoAvailable);
connect(edit, &QPlainTextEdit::modificationChanged,
this, &DesignDocument::dirtyStateChanged);
m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit())));

View File

@@ -106,7 +106,7 @@ signals:
void designDocumentClosed();
void qmlErrorsChanged(const QList<DocumentMessage> &errors);
public slots:
public:
void deleteSelected();
void copySelected();
void cutSelected();
@@ -119,10 +119,9 @@ public slots:
void changeToSubComponent(const ModelNode &componentNode);
void changeToMaster();
private slots:
private: // functions
void updateFileName(const Utils::FileName &oldFileName, const Utils::FileName &newFileName);
private: // functions
void changeToInFileComponentModel(ComponentTextModifier *textModifer);
void updateQrcFiles();

View File

@@ -43,7 +43,6 @@ class StackedUtilityPanelController : public UtilityPanelController
public:
StackedUtilityPanelController(QObject* parent = 0);
public slots:
void show(DesignDocument* DesignDocument);
void close(DesignDocument* DesignDocument);

View File

@@ -69,7 +69,6 @@ public:
ItemLibrarySection *sectionByName(const QString &sectionName);
public slots:
void setSearchText(const QString &searchText);
void setExpanded(bool, const QString &section);

View File

@@ -100,8 +100,8 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
tabBar->addTab(tr("Resources", "Title of library resources view"));
tabBar->addTab(tr("Imports", "Title of library imports view"));
tabBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(setCurrentIndexOfStackedWidget(int)));
connect(tabBar, SIGNAL(currentChanged(int)), this, SLOT(updateSearch()));
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::setCurrentIndexOfStackedWidget);
connect(tabBar, &QTabBar::currentChanged, this, &ItemLibraryWidget::updateSearch);
m_filterLineEdit = new Utils::FancyLineEdit(this);
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->addWidget(m_filterLineEdit.data(), 1, 1, 1, 1);
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);
@@ -145,9 +145,9 @@ ItemLibraryWidget::ItemLibraryWidget(QWidget *parent) :
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);
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
reloadQmlSource();
@@ -159,12 +159,12 @@ void ItemLibraryWidget::setItemLibraryInfo(ItemLibraryInfo *itemLibraryInfo)
return;
if (m_itemLibraryInfo)
disconnect(m_itemLibraryInfo.data(), SIGNAL(entriesChanged()),
this, SLOT(delayedUpdateModel()));
disconnect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
this, &ItemLibraryWidget::delayedUpdateModel);
m_itemLibraryInfo = itemLibraryInfo;
if (itemLibraryInfo)
connect(m_itemLibraryInfo.data(), SIGNAL(entriesChanged()),
this, SLOT(delayedUpdateModel()));
connect(m_itemLibraryInfo.data(), &ItemLibraryInfo::entriesChanged,
this, &ItemLibraryWidget::delayedUpdateModel);
delayedUpdateModel();
}

View File

@@ -75,7 +75,6 @@ public:
static QString qmlSourcesPath();
void clearSearchFilter();
public slots:
void setSearchFilter(const QString &searchFilter);
void delayedUpdateModel();
void updateModel();
@@ -94,7 +93,7 @@ protected:
signals:
void itemActivated(const QString& itemName);
private slots:
private:
void setCurrentIndexOfStackedWidget(int index);
void reloadQmlSource();

View File

@@ -115,8 +115,8 @@ NavigatorTreeModel::NavigatorTreeModel(QObject *parent)
setColumnCount(2);
# endif
connect(this, SIGNAL(itemChanged(QStandardItem*)),
this, SLOT(handleChangedItem(QStandardItem*)));
connect(this, &QStandardItemModel::itemChanged,
this, &NavigatorTreeModel::handleChangedItem);
}
NavigatorTreeModel::~NavigatorTreeModel()

View File

@@ -123,10 +123,9 @@ public:
ItemRow itemRowForNode(const ModelNode &node);
bool blockItemChangedSignal(bool block);
private slots:
private:
void handleChangedItem(QStandardItem *item);
private:
ItemRow createItemRow(const ModelNode &node);
void updateItemRow(const ModelNode &node, ItemRow row);
void handleChangedIdItem(QStandardItem *idItem, ModelNode &modelNode);

View File

@@ -74,12 +74,12 @@ NavigatorView::NavigatorView(QObject* parent) :
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(), SIGNAL(rightButtonClicked()), this, SLOT(rightButtonClicked()));
connect(m_widget.data(), SIGNAL(downButtonClicked()), this, SLOT(downButtonClicked()));
connect(m_widget.data(), SIGNAL(upButtonClicked()), this, SLOT(upButtonClicked()));
connect(m_widget.data(), &NavigatorWidget::leftButtonClicked, this, &NavigatorView::leftButtonClicked);
connect(m_widget.data(), &NavigatorWidget::rightButtonClicked, this, &NavigatorView::rightButtonClicked);
connect(m_widget.data(), &NavigatorWidget::downButtonClicked, this, &NavigatorView::downButtonClicked);
connect(m_widget.data(), &NavigatorWidget::upButtonClicked, this, &NavigatorView::upButtonClicked);
treeWidget()->setIndentation(treeWidget()->indentation() * 0.5);

View File

@@ -74,7 +74,7 @@ public:
void bindingPropertiesChanged(const QList<BindingProperty> &propertyList, PropertyChangeFlags) override;
private slots:
private:
void changeSelection(const QItemSelection &selected, const QItemSelection &deselected);
void updateItemSelection();
void changeToComponent(const QModelIndex &index);

View File

@@ -82,25 +82,25 @@ QList<QToolButton *> NavigatorWidget::createToolBarWidgets()
buttons.last()->setIcon(Icons::ARROW_LEFT.icon());
buttons.last()->setToolTip(tr("Become last sibling of parent (CTRL + Left)."));
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.last()->setIcon(Icons::ARROW_RIGHT.icon());
buttons.last()->setToolTip(tr("Become child of last sibling (CTRL + Right)."));
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.last()->setIcon(Icons::ARROW_DOWN.icon());
buttons.last()->setToolTip(tr("Move down (CTRL + Down)."));
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.last()->setIcon(Icons::ARROW_UP.icon());
buttons.last()->setToolTip(tr("Move up (CTRL + Up)."));
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;
}

View File

@@ -65,8 +65,6 @@ signals:
void modelNodeBackendChanged();
void fileModelChanged();
public slots:
private:
QVariant modelNodeBackend() const;

View File

@@ -69,8 +69,6 @@ signals:
void anchorBackendChanged();
void hasGradientChanged();
public slots:
private:
void setupModel();
void setAnchorBackend(const QVariant &anchorBackend);

View File

@@ -106,7 +106,8 @@ PropertyEditorQmlBackend::PropertyEditorQmlBackend(PropertyEditorView *propertyE
m_contextObject->setModel(propertyEditor->model());
m_contextObject->insertInQmlContext(context());
QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged, propertyEditor, &PropertyEditorView::changeValue);
QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged,
propertyEditor, &PropertyEditorView::changeValue);
}
PropertyEditorQmlBackend::~PropertyEditorQmlBackend()

View File

@@ -35,9 +35,9 @@ class PropertyEditorTransaction : public QObject
public:
PropertyEditorTransaction(QmlDesigner::PropertyEditorView *propertyEditor);
public slots:
void start();
void end();
Q_INVOKABLE void start();
Q_INVOKABLE void end();
protected:
void timerEvent(QTimerEvent *event);

View File

@@ -355,7 +355,7 @@ void PropertyEditorValue::registerDeclarativeTypes()
PropertyEditorNodeWrapper::PropertyEditorNodeWrapper(PropertyEditorValue* parent) : QObject(parent), m_valuesPropertyMap(this)
{
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)
@@ -466,12 +466,12 @@ void PropertyEditorNodeWrapper::setup()
PropertyEditorValue *valueObject = new PropertyEditorValue(&m_valuesPropertyMap);
valueObject->setName(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));
}
}
}
connect(&m_valuesPropertyMap, SIGNAL(valueChanged(QString,QVariant)), this, SLOT(changeValue(QString)));
connect(&m_valuesPropertyMap, &QQmlPropertyMap::valueChanged, this, &PropertyEditorNodeWrapper::changeValue);
emit propertiesChanged();
emit existsChanged();

View File

@@ -80,13 +80,13 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) :
m_qmlDir = PropertyEditorQmlBackend::propertyEditorResourcesPath();
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(
QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css")))));
m_stackedWidget->setMinimumWidth(320);
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));
@@ -531,7 +531,7 @@ void PropertyEditorView::modelAttached(Model *model)
if (!m_setupCompleted) {
m_singleShotTimer->setSingleShot(true);
m_singleShotTimer->setInterval(100);
connect(m_singleShotTimer, SIGNAL(timeout()), this, SLOT(setupPanes()));
connect(m_singleShotTimer, &QTimer::timeout, this, &PropertyEditorView::setupPanes);
m_singleShotTimer->start();
}

View File

@@ -87,7 +87,6 @@ public:
const NodeAbstractProperty &oldPropertyParent,
AbstractView::PropertyChangeFlags propertyChange) override;
public slots:
void changeValue(const QString &name);
void changeExpression(const QString &name);
void exportPopertyAsAlias(const QString &name);
@@ -98,13 +97,11 @@ protected:
void setupPane(const TypeName &typeName);
void setValue(const QmlObjectNode &fxObjectNode, const PropertyName &name, const QVariant &value);
private slots:
private: //functions
void reloadQml();
void updateSize();
void setupPanes();
private: //functions
void select(const ModelNode& node);
void delayedResetView();

View File

@@ -56,8 +56,6 @@ signals:
void selectionToBeChanged();
void selectionChanged();
public slots:
private:
QmlItemNode m_qmlItemNode;
};

View File

@@ -91,7 +91,7 @@ StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, State
engine()->addImportPath(qmlSourcesPath());
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);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

View File

@@ -61,9 +61,9 @@ public:
void toggleStatesViewExpanded();
private slots:
private:
void reloadQmlSource();
void handleExpandedChanged();
Q_SLOT void handleExpandedChanged();
private:
QPointer<StatesEditorView> m_statesEditorView;

View File

@@ -57,7 +57,7 @@ bool isTabAndParentIsTabView(const ModelNode &modelNode)
AddTabDesignerAction::AddTabDesignerAction()
: AbstractAction(QCoreApplication::translate("TabViewToolAction","Add Tab..."))
{
connect(action(), SIGNAL(triggered()), this, SLOT(addNewTab()));
connect(action(), &QAction::triggered, this, &AddTabDesignerAction::addNewTab);
}
QByteArray AddTabDesignerAction::category() const

View File

@@ -44,7 +44,7 @@ protected:
bool isVisible(const SelectionContext &selectionContext) const;
bool isEnabled(const SelectionContext &selectionContext) const;
private slots:
private:
void addNewTab();
};

View File

@@ -44,7 +44,7 @@ public:
: DefaultAction(description)
{ }
public /*slots*/:
public:
void actionTriggered(bool) override
{
DocumentManager::goIntoComponent(m_selectionContext.targetNode());

View File

@@ -61,9 +61,6 @@ public:
bool moveToComponent(int /* nodeOffset */) override
{ return false; }
public slots:
void contentsChange(int position, int charsRemoved, int charsAdded);
private:
TextModifier *m_originalModifier;
int m_componentStartOffset;

View File

@@ -183,7 +183,7 @@ private: // functions
void restartProcess();
void delayedRestartProcess();
private slots:
private:
void handleCrash();
private: //variables

View File

@@ -80,10 +80,8 @@ protected:
QPlainTextEdit *plainTextEdit() const
{ return m_textEdit; }
private slots:
void textEditChanged();
private:
void textEditChanged();
void runRewriting(Utils::ChangeSet *writer);
private:

View File

@@ -159,7 +159,6 @@ public:
void setWidgetStatusCallback(std::function<void(bool)> setWidgetStatusCallback);
public slots:
void qmlTextChanged();
void delayedSetup();

View File

@@ -52,12 +52,11 @@ public:
QStringList qmlFiles() const;
QStringList directories() const;
private slots:
private: // functions
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);
private: // functions
void addImport(int pos, const Import &import);
void removeImport(int pos);
void parseDirectories();

View File

@@ -172,7 +172,8 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
if (connectedToPuppet) {
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 (!m_localServer->hasPendingConnections())
@@ -180,7 +181,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
if (connectedToPuppet) {
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())
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
@@ -188,7 +189,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
qCInfo(instanceViewBenchmark) << "puppets connected:" << m_benchmarkTimer.elapsed();
if (connectedToPuppet) {
m_thirdSocket = m_localServer->nextPendingConnection();
connect(m_thirdSocket.data(), SIGNAL(readyRead()), this, SLOT(readThirdDataStream()));
connect(m_thirdSocket.data(), &QIODevice::readyRead, this, &NodeInstanceServerProxy::readThirdDataStream);
} else {
showCannotConnectToPuppetWarningAndSwitchToEditMode();
}
@@ -252,18 +253,18 @@ NodeInstanceServerProxy::~NodeInstanceServerProxy()
}
if (m_qmlPuppetEditorProcess) {
QTimer::singleShot(3000, m_qmlPuppetEditorProcess.data(), SLOT(terminate()));
QTimer::singleShot(6000, m_qmlPuppetEditorProcess.data(), SLOT(kill()));
QTimer::singleShot(3000, m_qmlPuppetEditorProcess.data(), &QProcess::terminate);
QTimer::singleShot(6000, m_qmlPuppetEditorProcess.data(), &QProcess::kill);
}
if (m_qmlPuppetPreviewProcess) {
QTimer::singleShot(3000, m_qmlPuppetPreviewProcess.data(), SLOT(terminate()));
QTimer::singleShot(6000, m_qmlPuppetPreviewProcess.data(), SLOT(kill()));
QTimer::singleShot(3000, m_qmlPuppetPreviewProcess.data(), &QProcess::terminate);
QTimer::singleShot(6000, m_qmlPuppetPreviewProcess.data(), &QProcess::kill);
}
if (m_qmlPuppetRenderProcess) {
QTimer::singleShot(3000, m_qmlPuppetRenderProcess.data(), SLOT(terminate()));
QTimer::singleShot(6000, m_qmlPuppetRenderProcess.data(), SLOT(kill()));
QTimer::singleShot(3000, m_qmlPuppetRenderProcess.data(), &QProcess::terminate);
QTimer::singleShot(6000, m_qmlPuppetRenderProcess.data(), &QProcess::kill);
}
}

View File

@@ -151,9 +151,10 @@ bool isSkippedNode(const ModelNode &node)
void NodeInstanceView::modelAttached(Model *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();
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleCrash()));
connect(server, &NodeInstanceServerProxy::processCrashed, this, &NodeInstanceView::handleCrash);
if (!isSkippedRootNode(rootModelNode()))
nodeInstanceServer()->createScene(createCreateSceneCommand());
@@ -204,8 +205,9 @@ void NodeInstanceView::restartProcess()
if (model()) {
delete nodeInstanceServer();
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleCrash()));
auto server = new NodeInstanceServerProxy(this, m_runModus, m_currentKit, m_currentProject);
m_nodeInstanceServer = server;
connect(server, &NodeInstanceServerProxy::processCrashed, this, &NodeInstanceView::handleCrash);
if (!isSkippedRootNode(rootModelNode()))
nodeInstanceServer()->createScene(createCreateSceneCommand());

View File

@@ -43,7 +43,7 @@ PuppetBuildProgressDialog::PuppetBuildProgressDialog() :
setWindowModality(Qt::ApplicationModal);
ui->setupUi(this);
ui->buildProgressBar->setMaximum(85);
connect(ui->useFallbackPuppetPushButton, SIGNAL(clicked()), this, SLOT(setUseFallbackPuppet()));
connect(ui->useFallbackPuppetPushButton, &QAbstractButton::clicked, this, &PuppetBuildProgressDialog::setUseFallbackPuppet);
}
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->useFallbackPuppetPushButton->setText(tr("OK"));
connect(ui->useFallbackPuppetPushButton, SIGNAL(clicked()), this, SLOT(accept()));
connect(ui->useFallbackPuppetPushButton, &QAbstractButton::clicked, this, &QDialog::accept);
}
void PuppetBuildProgressDialog::setUseFallbackPuppet()

View File

@@ -48,7 +48,7 @@ public:
void setErrorOutputFile(const QString &filePath);
void setErrorMessage(const QString &message);
private slots:
private:
void setUseFallbackPuppet();
private:

View File

@@ -197,7 +197,7 @@ QProcess *PuppetCreator::puppetProcess(const QString &puppetPath,
puppetProcess->setObjectName(puppetMode);
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);
#ifndef QMLDESIGNER_TEST

View File

@@ -63,7 +63,8 @@ SubComponentManager::SubComponentManager(Model *model, QObject *parent)
: QObject(parent),
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)

View File

@@ -33,10 +33,10 @@ ComponentTextModifier::ComponentTextModifier(TextModifier *originalModifier, int
m_componentEndOffset(componentEndOffset),
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, SIGNAL(moved(TextModifier::MoveInfo)), this, SIGNAL(moved(TextModifier::MoveInfo)));
connect(m_originalModifier, &TextModifier::replaced, this, &TextModifier::replaced);
connect(m_originalModifier, &TextModifier::moved, this, &TextModifier::moved);
}
ComponentTextModifier::~ComponentTextModifier()
@@ -148,7 +148,3 @@ void ComponentTextModifier::reactivateChangeSignals()
{
m_originalModifier->reactivateChangeSignals();
}
void ComponentTextModifier::contentsChange(int /*position*/, int /*charsRemoved*/, int /*charsAdded*/)
{
}

View File

@@ -34,8 +34,8 @@ void ModelNodePositionRecalculator::connectTo(TextModifier *textModifier)
{
Q_ASSERT(textModifier);
connect(textModifier, SIGNAL(moved(TextModifier::MoveInfo)), this, SLOT(moved(TextModifier::MoveInfo)));
connect(textModifier, SIGNAL(replaced(int,int,int)), this, SLOT(replaced(int,int,int)));
connect(textModifier, &TextModifier::moved, this, &ModelNodePositionRecalculator::moved);
connect(textModifier, &TextModifier::replaced, this, &ModelNodePositionRecalculator::replaced);
}
void ModelNodePositionRecalculator::moved(const TextModifier::MoveInfo &moveInfo)

View File

@@ -49,7 +49,6 @@ public:
QMap<int,int> dirtyAreas() const
{ return m_dirtyAreas; }
public slots:
void replaced(int offset, int oldLength, int newLength);
void moved(const TextModifier::MoveInfo &moveInfo);

View File

@@ -44,8 +44,8 @@ PlainTextEditModifier::PlainTextEditModifier(QPlainTextEdit *textEdit):
{
Q_ASSERT(textEdit);
connect(m_textEdit, SIGNAL(textChanged()),
this, SLOT(textEditChanged()));
connect(m_textEdit, &QPlainTextEdit::textChanged,
this, &PlainTextEditModifier::textEditChanged);
}
PlainTextEditModifier::~PlainTextEditModifier()

View File

@@ -344,12 +344,12 @@ TextModifier *RewriterView::textModifier() const
void RewriterView::setTextModifier(TextModifier *textModifier)
{
if (m_textModifier)
disconnect(m_textModifier, SIGNAL(textChanged()), this, SLOT(qmlTextChanged()));
disconnect(m_textModifier, &TextModifier::textChanged, this, &RewriterView::qmlTextChanged);
m_textModifier = textModifier;
if (m_textModifier)
connect(m_textModifier, SIGNAL(textChanged()), this, SLOT(qmlTextChanged()));
connect(m_textModifier, &TextModifier::textChanged, this, &RewriterView::qmlTextChanged);
}
QString RewriterView::textModifierContent() const

View File

@@ -713,7 +713,7 @@ TextToModelMerger::TextToModelMerger(RewriterView *reWriterView) :
{
Q_ASSERT(reWriterView);
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)

View File

@@ -214,14 +214,18 @@ void ViewManager::detachAdditionalViews()
void ViewManager::attachComponentView()
{
documentModel()->attachView(&d->componentView);
QObject::connect(d->componentView.action(), SIGNAL(currentComponentChanged(ModelNode)), currentDesignDocument(), SLOT(changeToSubComponent(ModelNode)));
QObject::connect(d->componentView.action(), SIGNAL(changedToMaster()), currentDesignDocument(), SLOT(changeToMaster()));
QObject::connect(d->componentView.action(), &ComponentAction::currentComponentChanged,
currentDesignDocument(), &DesignDocument::changeToSubComponent);
QObject::connect(d->componentView.action(), &ComponentAction::changedToMaster,
currentDesignDocument(), &DesignDocument::changeToMaster);
}
void ViewManager::detachComponentView()
{
QObject::disconnect(d->componentView.action(), SIGNAL(currentComponentChanged(ModelNode)), currentDesignDocument(), SLOT(changeToSubComponent(ModelNode)));
QObject::disconnect(d->componentView.action(), SIGNAL(changedToMaster()), currentDesignDocument(), SLOT(changeToMaster()));
QObject::disconnect(d->componentView.action(), &ComponentAction::currentComponentChanged,
currentDesignDocument(), &DesignDocument::changeToSubComponent);
QObject::disconnect(d->componentView.action(), &ComponentAction::changedToMaster,
currentDesignDocument(), &DesignDocument::changeToMaster);
documentModel()->detachView(&d->componentView);
}

View File

@@ -84,19 +84,17 @@ public:
CrumbleBar* crumbleBar() const;
void showInternalTextEditor();
public slots:
void restoreDefaultView();
void toggleSidebars();
void toggleLeftSidebar();
void toggleRightSidebar();
private slots:
void toolBarOnGoBackClicked();
void toolBarOnGoForwardClicked();
private: // functions
enum InitializeStatus { NotInitialized, Initializing, Initialized };
void toolBarOnGoBackClicked();
void toolBarOnGoForwardClicked();
void setup();
bool isInNodeDefinition(int nodeOffset, int nodeLength, int cursorPos) const;
QmlDesigner::ModelNode nodeForPosition(int cursorPos) const;

View File

@@ -178,9 +178,9 @@ void ColorTool::selectedItemsChanged(const QList<FormEditorItem*> &itemList)
m_colorDialog = new QColorDialog(view()->formEditorWidget()->parentWidget());
m_colorDialog.data()->setCurrentColor(m_oldColor);
connect(m_colorDialog.data(), SIGNAL(accepted()), SLOT(colorDialogAccepted()));
connect(m_colorDialog.data(), SIGNAL(rejected()), SLOT(colorDialogRejected()));
connect(m_colorDialog.data(), SIGNAL(currentColorChanged(QColor)), SLOT(currentColorChanged(QColor)));
connect(m_colorDialog.data(), &QDialog::accepted, this, &ColorTool::colorDialogAccepted);
connect(m_colorDialog.data(), &QDialog::rejected, this, &ColorTool::colorDialogRejected);
connect(m_colorDialog.data(), &QColorDialog::currentColorChanged, this, &ColorTool::currentColorChanged);
m_colorDialog.data()->exec();
}

View File

@@ -75,7 +75,7 @@ public:
QString name() const override;
private slots:
private:
void colorDialogAccepted();
void colorDialogRejected();
void currentColorChanged(const QColor &color);

View File

@@ -61,7 +61,7 @@ public:
protected:
void updatePropertyName(int rowNumber);
private slots:
private:
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
private:

View File

@@ -228,7 +228,7 @@ void BindingModel::addBindingForCurrentNode()
modelNode.bindingProperty(unusedProperty(modelNode)).setExpression(QLatin1String("none.none"));
} catch (RewritingException &e) {
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &BindingModel::handleException);
}
}
} else {
@@ -309,7 +309,7 @@ void BindingModel::updateExpression(int row)
transaction.commit(); //committing in the try block
} catch (Exception &e) {
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
} catch (Exception &e) { //better save then sorry
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &BindingModel::handleException);
}
QStandardItem* idItem = item(rowNumber, 0);

View File

@@ -75,7 +75,7 @@ protected:
void updateDisplayRole(int row, int columns, const QString &string);
private slots:
private:
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
void handleException();

View File

@@ -174,7 +174,7 @@ void ConnectionModel::updateSource(int row)
}
catch (Exception &e) {
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &ConnectionModel::handleException);
}
}

View File

@@ -74,7 +74,7 @@ protected:
void updateCustomData(QStandardItem *item, const SignalHandlerProperty &signalHandlerProperty);
QStringList getPossibleSignalsForConnection(const ModelNode &connection) const;
private slots:
private:
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
void handleException();

View File

@@ -81,11 +81,11 @@ ConnectionViewWidget::ConnectionViewWidget(QWidget *parent) :
ui->backendView->setStyleSheet(Theme::replaceCssColors(
QLatin1String(Utils::FileReader::fetchQrc(QLatin1String(":/qmldesigner/scrollbar.css")))));
connect(ui->tabBar, SIGNAL(currentChanged(int)),
ui->stackedWidget, SLOT(setCurrentIndex(int)));
connect(ui->tabBar, &QTabBar::currentChanged,
ui->stackedWidget, &QStackedWidget::setCurrentIndex);
connect(ui->tabBar, SIGNAL(currentChanged(int)),
this, SLOT(handleTabChanged(int)));
connect(ui->tabBar, &QTabBar::currentChanged,
this, &ConnectionViewWidget::handleTabChanged);
ui->stackedWidget->setCurrentIndex(0);
}
@@ -145,15 +145,15 @@ QList<QToolButton *> ConnectionViewWidget::createToolBarWidgets()
buttons << new QToolButton();
buttons.last()->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
buttons.last()->setToolTip(tr("Add binding or connection."));
connect(buttons.last(), SIGNAL(clicked()), this, SLOT(addButtonClicked()));
connect(this, SIGNAL(setEnabledAddButton(bool)), buttons.last(), SLOT(setEnabled(bool)));
connect(buttons.last(), &QAbstractButton::clicked, this, &ConnectionViewWidget::addButtonClicked);
connect(this, &ConnectionViewWidget::setEnabledAddButton, buttons.last(), &QWidget::setEnabled);
buttons << new QToolButton();
buttons.last()->setIcon(Utils::Icons::MINUS.icon());
buttons.last()->setToolTip(tr("Remove selected binding or connection."));
buttons.last()->setShortcut(QKeySequence(Qt::Key_Delete));
connect(buttons.last(), SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
connect(this, SIGNAL(setEnabledRemoveButton(bool)), buttons.last(), SLOT(setEnabled(bool)));
connect(buttons.last(), &QAbstractButton::clicked, this, &ConnectionViewWidget::removeButtonClicked);
connect(this, &ConnectionViewWidget::setEnabledRemoveButton, buttons.last(), &QWidget::setEnabled);
return buttons;
}

View File

@@ -79,7 +79,6 @@ public:
QTableView *dynamicPropertiesTableView() const;
QTableView *backendView() const;
public slots:
void bindingTableViewSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
void connectionTableViewSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
void dynamicPropertiesTableViewSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
@@ -89,7 +88,7 @@ signals:
void setEnabledAddButton(bool enabled);
void setEnabledRemoveButton(bool enabled);
private slots:
private:
void handleTabChanged(int i);
void removeButtonClicked();
void addButtonClicked();

View File

@@ -271,7 +271,7 @@ void DynamicPropertiesModel::addDynamicPropertyForCurrentNode()
modelNode.variantProperty(unusedProperty(modelNode)).setDynamicTypeNameAndValue("string", QLatin1String("none.none"));
} catch (RewritingException &e) {
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
}
}
} else {
@@ -437,7 +437,7 @@ void DynamicPropertiesModel::updateValue(int row)
transaction.commit(); //committing in the try block
} catch (Exception &e) {
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
}
return;
}
@@ -453,7 +453,7 @@ void DynamicPropertiesModel::updateValue(int row)
transaction.commit(); //committing in the try block
} catch (Exception &e) {
m_exceptionError = e.description();
QTimer::singleShot(200, this, SLOT(handleException()));
QTimer::singleShot(200, this, &DynamicPropertiesModel::handleException);
}
}
}

View File

@@ -87,7 +87,7 @@ protected:
void updateDisplayRole(int row, int columns, const QString &string);
private slots:
private:
void handleDataChanged(const QModelIndex &topLeft, const QModelIndex& bottomRight);
void handleException();

View File

@@ -122,7 +122,7 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
QmlDesignerPlugin::instance()->mainWidget(),
&Internal::DesignModeWidget::restoreDefaultView);
connect(&m_goIntoComponentAction, SIGNAL(triggered()), SLOT(goIntoComponent()));
connect(&m_goIntoComponentAction, &QAction::triggered, this, &ShortCutManager::goIntoComponent);
connect(&m_toggleLeftSidebarAction,
&QAction::triggered,
@@ -371,16 +371,16 @@ void ShortCutManager::toggleRightSidebar()
void ShortCutManager::connectUndoActions(DesignDocument *designDocument)
{
if (designDocument) {
connect(designDocument, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool)));
connect(designDocument, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool)));
connect(designDocument, &DesignDocument::undoAvailable, this, &ShortCutManager::undoAvailable);
connect(designDocument, &DesignDocument::redoAvailable, this, &ShortCutManager::redoAvailable);
}
}
void ShortCutManager::disconnectUndoActions(DesignDocument *designDocument)
{
if (currentDesignDocument()) {
disconnect(designDocument, SIGNAL(undoAvailable(bool)), this, SLOT(undoAvailable(bool)));
disconnect(designDocument, SIGNAL(redoAvailable(bool)), this, SLOT(redoAvailable(bool)));
disconnect(designDocument, &DesignDocument::undoAvailable, this, &ShortCutManager::undoAvailable);
disconnect(designDocument, &DesignDocument::redoAvailable, this, &ShortCutManager::redoAvailable);
}
}

View File

@@ -54,10 +54,9 @@ public:
void updateUndoActions(DesignDocument *designDocument);
DesignDocument *currentDesignDocument() const;
public slots:
void updateActions(Core::IEditor* editor);
private slots:
private:
void undo();
void redo();
void deleteSelected();