diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index 0fe7f5d2288..15d2aa5dafb 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -126,7 +126,7 @@ QVariant fixResourcePaths(const QVariant &value) if (QFileInfo(fixedPath).exists()) { fixedPath.replace(QLatin1String("//"), QLatin1String("/")); fixedPath.replace(QLatin1Char('\\'), QLatin1Char('/')); - return fixedPath; + return QUrl::fromLocalFile(fixedPath); } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/UrlChooser.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/UrlChooser.qml index 2c2e4087c60..74320b4dbbc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/UrlChooser.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/UrlChooser.qml @@ -54,9 +54,20 @@ RowLayout { property bool isComplete: false - property string textValue: backendValue.value + function setCurrentText(text) { + if (text === "") + return + + + var index = comboBox.find(textValue) + if (index === -1) + currentIndex = -1 + editText = textValue + } + + property string textValue: backendValue.valueToString onTextValueChanged: { - comboBox.editText = textValue + setCurrentText(textValue) } Layout.fillWidth: true @@ -72,7 +83,7 @@ RowLayout { if (!comboBox.isComplete) return; - editText = backendValue.valueToString + setCurrentText(textValue) } onCurrentTextChanged: { @@ -95,7 +106,7 @@ RowLayout { } } comboBox.isComplete = true - editText = backendValue.valueToString + setCurrentText(textValue) } } diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index 6756e7b2ed3..26b5b3ff19b 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -820,7 +820,8 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId, const QString typeName = getRightMostIdentifier(typeId)->name.toString(); - if (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("State")) + if (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("State") + && typeId->name.toString() != "PropertyChanges") addMessage(StateCannotHaveChildItem, typeErrorLocation, typeName); if (checkTypeForDesignerSupport(typeId)) diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 606475a35be..d9f21183f4f 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -426,13 +426,8 @@ bool LinkPrivate::importLibrary(Document::Ptr doc, QString libraryPath = libraryPath_; LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath); - if (!libraryInfo.isValid()) { - // try canonical path - libraryPath = QFileInfo(libraryPath).canonicalFilePath(); - libraryInfo = snapshot.libraryInfo(libraryPath); - if (!libraryInfo.isValid()) - return false; - } + if (!libraryInfo.isValid()) + return false; import->libraryPath = libraryPath; diff --git a/src/libs/utils/consoleprocess.h b/src/libs/utils/consoleprocess.h index 59a51d98cf1..4e9de860fd1 100644 --- a/src/libs/utils/consoleprocess.h +++ b/src/libs/utils/consoleprocess.h @@ -103,7 +103,7 @@ signals: void stubStarted(); void stubStopped(); -private slots: +private: void stubConnectionAvailable(); void readStubOutput(); void stubExited(); @@ -111,7 +111,6 @@ private slots: void inferiorExited(); #endif -private: static QString modeOption(Mode m); static QString msgCommChannelFailed(const QString &error); static QString msgPromptToClose(); diff --git a/src/libs/utils/crumblepath.h b/src/libs/utils/crumblepath.h index d3d1962535b..434252ae37b 100644 --- a/src/libs/utils/crumblepath.h +++ b/src/libs/utils/crumblepath.h @@ -60,10 +60,8 @@ signals: protected: void resizeEvent(QResizeEvent *); -private slots: - void emitElementClicked(); - private: + void emitElementClicked(); void resizeButtons(); void setBackgroundStyle(); diff --git a/src/libs/utils/detailswidget.h b/src/libs/utils/detailswidget.h index 5ce8c04f5d2..0c69d6f3f08 100644 --- a/src/libs/utils/detailswidget.h +++ b/src/libs/utils/detailswidget.h @@ -87,7 +87,7 @@ signals: void linkActivated(const QString &link); void expanded(bool); -private slots: +private: void setExpanded(bool); protected: diff --git a/src/libs/utils/dropsupport.cpp b/src/libs/utils/dropsupport.cpp index 805a20c0546..9527a2f1e40 100644 --- a/src/libs/utils/dropsupport.cpp +++ b/src/libs/utils/dropsupport.cpp @@ -140,7 +140,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event) // after the drag operation. // If we do not do this, e.g. dragging from Outline view crashes if the editor and // the selected item changes - QTimer::singleShot(100, this, SLOT(emitFilesDropped())); + QTimer::singleShot(100, this, &DropSupport::emitFilesDropped); } } if (fileDropMimeData && !fileDropMimeData->values().isEmpty()) { @@ -150,7 +150,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event) m_values.append(fileDropMimeData->values()); m_dropPos = de->pos(); if (needToScheduleEmit) - QTimer::singleShot(100, this, SLOT(emitValuesDropped())); + QTimer::singleShot(100, this, &DropSupport::emitValuesDropped); } } if (!accepted) { diff --git a/src/libs/utils/dropsupport.h b/src/libs/utils/dropsupport.h index c91f2c5c8ae..979089f0908 100644 --- a/src/libs/utils/dropsupport.h +++ b/src/libs/utils/dropsupport.h @@ -68,11 +68,10 @@ public: protected: bool eventFilter(QObject *obj, QEvent *event); -private slots: +private: void emitFilesDropped(); void emitValuesDropped(); -private: DropFilterFunction m_filterFunction; QList m_files; QList m_values; diff --git a/src/libs/utils/fadingindicator.cpp b/src/libs/utils/fadingindicator.cpp index 0910aa3c850..6799465829d 100644 --- a/src/libs/utils/fadingindicator.cpp +++ b/src/libs/utils/fadingindicator.cpp @@ -87,7 +87,7 @@ public: { show(); raise(); - QTimer::singleShot(ms, this, SLOT(runInternal())); + QTimer::singleShot(ms, this, &FadingIndicatorPrivate::runInternal); } protected: @@ -104,7 +104,7 @@ protected: } } -private slots: +private: void runInternal() { QPropertyAnimation *anim = new QPropertyAnimation(m_effect, "opacity", this); @@ -114,7 +114,6 @@ private slots: anim->start(QAbstractAnimation::DeleteWhenStopped); } -private: QGraphicsOpacityEffect *m_effect; QLabel *m_label; QPixmap m_pixmap; diff --git a/src/libs/utils/fancymainwindow.h b/src/libs/utils/fancymainwindow.h index 1960bea3842..f66287e6cf1 100644 --- a/src/libs/utils/fancymainwindow.h +++ b/src/libs/utils/fancymainwindow.h @@ -79,10 +79,9 @@ protected: void showEvent(QShowEvent *event); void contextMenuEvent(QContextMenuEvent *event); -private slots: +private: void onDockActionTriggered(); -private: void handleVisibilityChanged(bool visible); FancyMainWindowPrivate *d; diff --git a/src/libs/utils/filesystemwatcher.h b/src/libs/utils/filesystemwatcher.h index 59f5938204b..c40c6dae800 100644 --- a/src/libs/utils/filesystemwatcher.h +++ b/src/libs/utils/filesystemwatcher.h @@ -66,16 +66,14 @@ public: bool watchesDirectory(const QString &file) const; QStringList directories() const; -private slots: - void slotFileChanged(const QString &path); - void slotDirectoryChanged(const QString &path); - signals: void fileChanged(const QString &path); void directoryChanged(const QString &path); private: void init(); + void slotFileChanged(const QString &path); + void slotDirectoryChanged(const QString &path); FileSystemWatcherPrivate *d; }; diff --git a/src/libs/utils/filewizardpage.h b/src/libs/utils/filewizardpage.h index e0f19d03db4..12897e782da 100644 --- a/src/libs/utils/filewizardpage.h +++ b/src/libs/utils/filewizardpage.h @@ -65,11 +65,10 @@ public slots: void setPath(const QString &path); void setFileName(const QString &name); -private slots: +private: void slotValidChanged(); void slotActivated(); -private: FileWizardPagePrivate *d; }; diff --git a/src/libs/utils/newclasswidget.h b/src/libs/utils/newclasswidget.h index 18a5029f5bc..e91ff6a13af 100644 --- a/src/libs/utils/newclasswidget.h +++ b/src/libs/utils/newclasswidget.h @@ -149,15 +149,13 @@ public slots: */ void suggestClassNameFromBase(); -private slots: +private: void slotUpdateFileNames(const QString &t); void slotValidChanged(); void slotActivated(); void classNameEdited(); void slotFormInputChecked(); void slotBaseClassEdited(const QString &); - -private: void setFormInputCheckable(bool checkable, bool force); QString fixSuffix(const QString &suffix); diff --git a/src/libs/utils/projectintropage.h b/src/libs/utils/projectintropage.h index eb26a839c20..da34f550e30 100644 --- a/src/libs/utils/projectintropage.h +++ b/src/libs/utils/projectintropage.h @@ -73,11 +73,10 @@ public slots: void setUseAsDefaultPath(bool u); void setProjectNameRegularExpression(const QRegularExpression ®Ex); -private slots: +private: void slotChanged(); void slotActivated(); -private: enum StatusLabelMode { Error, Warning, Hint }; bool validate(); diff --git a/src/libs/utils/proxyaction.h b/src/libs/utils/proxyaction.h index 3307a0c0ae8..a5c423098ef 100644 --- a/src/libs/utils/proxyaction.h +++ b/src/libs/utils/proxyaction.h @@ -60,12 +60,10 @@ public: static QString stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut); static ProxyAction *proxyActionWithIcon(QAction *original, const QIcon &newIcon); -private slots: +private: void actionChanged(); void updateState(); void updateToolTipWithKeySequence(); - -private: void disconnectAction(); void connectAction(); void update(QAction *action, bool initialize); diff --git a/src/libs/utils/settingsselector.h b/src/libs/utils/settingsselector.h index 6df875a6e4a..7c5220afadc 100644 --- a/src/libs/utils/settingsselector.h +++ b/src/libs/utils/settingsselector.h @@ -67,12 +67,11 @@ signals: void rename(int index, const QString &newName); void currentChanged(int index); -private slots: +private: void removeButtonClicked(); void renameButtonClicked(); void updateButtonState(); -private: QLabel *m_label; QComboBox *m_configurationCombo; QPushButton *m_addButton; diff --git a/src/libs/utils/statuslabel.h b/src/libs/utils/statuslabel.h index 8531a66d1b7..8a2ffc22328 100644 --- a/src/libs/utils/statuslabel.h +++ b/src/libs/utils/statuslabel.h @@ -43,10 +43,8 @@ public slots: void showStatusMessage(const QString &message, int timeoutMS = 5000); void clearStatusMessage(); -private slots: - void slotTimeout(); - private: + void slotTimeout(); void stopTimer(); QTimer *m_timer; diff --git a/src/libs/utils/synchronousprocess.h b/src/libs/utils/synchronousprocess.h index 40c6aea5bf8..5c4f8bc7608 100644 --- a/src/libs/utils/synchronousprocess.h +++ b/src/libs/utils/synchronousprocess.h @@ -155,14 +155,12 @@ signals: public slots: bool terminate(); -private slots: +private: void slotTimeout(); void finished(int exitCode, QProcess::ExitStatus e); void error(QProcess::ProcessError); void stdOutReady(); void stdErrReady(); - -private: void processStdOut(bool emitSignals); void processStdErr(bool emitSignals); QString convertOutput(const QByteArray &, QTextCodec::ConverterState *state) const; diff --git a/src/libs/utils/textfieldcheckbox.h b/src/libs/utils/textfieldcheckbox.h index 456e156370d..9bcc17c9ad6 100644 --- a/src/libs/utils/textfieldcheckbox.h +++ b/src/libs/utils/textfieldcheckbox.h @@ -51,10 +51,9 @@ public: signals: void textChanged(const QString &); -private slots: +private: void slotStateChanged(int); -private: QString m_trueText; QString m_falseText; }; diff --git a/src/libs/utils/textfieldcombobox.h b/src/libs/utils/textfieldcombobox.h index 943e7a677c2..136b85de3c7 100644 --- a/src/libs/utils/textfieldcombobox.h +++ b/src/libs/utils/textfieldcombobox.h @@ -46,10 +46,9 @@ public: signals: void text4Changed(const QString &); // Do not conflict with Qt 3 compat signal. -private slots: +private: void slotCurrentIndexChanged(int); -private: inline QString valueAt(int) const; }; diff --git a/src/libs/utils/wizard.cpp b/src/libs/utils/wizard.cpp index 81fc5a18478..8e747ab0b1d 100644 --- a/src/libs/utils/wizard.cpp +++ b/src/libs/utils/wizard.cpp @@ -99,7 +99,7 @@ class LinearProgressWidget : public QWidget public: LinearProgressWidget(WizardProgress *progress, QWidget *parent = 0); -private slots: +private: void slotItemAdded(WizardProgressItem *item); void slotItemRemoved(WizardProgressItem *item); void slotItemChanged(WizardProgressItem *item); @@ -107,8 +107,6 @@ private slots: void slotNextShownItemChanged(WizardProgressItem *item, WizardProgressItem *nextItem); void slotStartItemChanged(WizardProgressItem *item); void slotCurrentItemChanged(WizardProgressItem *item); - -private: void recreateLayout(); void updateProgress(); void disableUpdates(); diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 857c16b25f3..7e6e0b3c3c4 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -143,7 +143,7 @@ void TestCodeParser::emitUpdateTestTree() qCDebug(LOG) << "adding singleShot"; m_singleShotScheduled = true; - QTimer::singleShot(1000, this, SLOT(updateTestTree())); + QTimer::singleShot(1000, this, &TestCodeParser::updateTestTree); } void TestCodeParser::updateTestTree() diff --git a/src/plugins/autotest/testcodeparser.h b/src/plugins/autotest/testcodeparser.h index 9bb1480b0a7..19b58dfa468 100644 --- a/src/plugins/autotest/testcodeparser.h +++ b/src/plugins/autotest/testcodeparser.h @@ -70,7 +70,7 @@ signals: void parsingFinished(); void parsingFailed(); -public slots: +public: void emitUpdateTestTree(); void updateTestTree(); void onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document); diff --git a/src/plugins/autotest/testnavigationwidget.h b/src/plugins/autotest/testnavigationwidget.h index d64bf661e95..b52eeb941a1 100644 --- a/src/plugins/autotest/testnavigationwidget.h +++ b/src/plugins/autotest/testnavigationwidget.h @@ -65,16 +65,12 @@ public: signals: -public slots: - -private slots: +private: void onItemActivated(const QModelIndex &index); void onSortClicked(); void onFilterMenuTriggered(QAction *action); void onParsingStarted(); void onParsingFinished(); - -private: void initializeFilterMenu(); void onRunThisTestTriggered(TestRunner::Mode runMode); diff --git a/src/plugins/autotest/testresultdelegate.h b/src/plugins/autotest/testresultdelegate.h index c01c156f10a..5d1c713ff01 100644 --- a/src/plugins/autotest/testresultdelegate.h +++ b/src/plugins/autotest/testresultdelegate.h @@ -41,8 +41,6 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; - -public slots: void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); private: diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index 4955783f894..a226e8df44d 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -87,20 +87,17 @@ public: void goToNext(); void goToPrev(); -signals: - -public slots: void addTestResult(const TestResultPtr &result); -private slots: +private: + explicit TestResultsPane(QObject *parent = 0); + void onItemActivated(const QModelIndex &index); void onRunAllTriggered(); void onRunSelectedTriggered(); void enableAllFilter(); void filterMenuTriggered(QAction *action); -private: - explicit TestResultsPane(QObject *parent = 0); void initializeFilterMenu(); void updateSummaryLabel(); void createToolButtons(); diff --git a/src/plugins/autotest/testrunner.h b/src/plugins/autotest/testrunner.h index b79840b2653..2e3621b29d0 100644 --- a/src/plugins/autotest/testrunner.h +++ b/src/plugins/autotest/testrunner.h @@ -56,21 +56,19 @@ public: void setSelectedTests(const QList &selected); bool isTestRunning() const { return m_executingTests; } + void prepareToRunTests(Mode mode); + signals: void testRunStarted(); void testRunFinished(); void requestStopTestRun(); void testResultReady(const TestResultPtr &result); -public slots: - void prepareToRunTests(Mode mode); - -private slots: +private: void buildProject(ProjectExplorer::Project *project); void buildFinished(bool success); void onFinished(); -private: void runTests(); void debugTests(); void runOrDebugTests(); diff --git a/src/plugins/autotest/testtreemodel.h b/src/plugins/autotest/testtreemodel.h index d2c3467ce32..71291019375 100644 --- a/src/plugins/autotest/testtreemodel.h +++ b/src/plugins/autotest/testtreemodel.h @@ -83,8 +83,6 @@ signals: void sweepingDone(); #endif -public slots: - private: void onParseResultReady(const TestParseResultPtr result); void handleParseResult(const TestParseResult *result, TestTreeItem *rootNode); diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp index 0e3d70ec9dd..71afe79bf17 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp @@ -352,13 +352,17 @@ void ClangDiagnosticManager::addFixItAvailableMarker( QSet &lineNumbersWithFixItMarker) { for (auto &&diagnostic : diagnostics) { - const int line = int(diagnostic.location().line()); - if (!diagnostic.fixIts().isEmpty() && !lineNumbersWithFixItMarker.contains(line)) { - const TextEditor::RefactorMarker marker - = createFixItAvailableMarker(m_textDocument->document(), line); + for (auto &&fixit : diagnostic.fixIts()) { + const ClangBackEnd::SourceLocationContainer location = fixit.range().start(); + const int line = int(location.line()); - lineNumbersWithFixItMarker.insert(line); - m_fixItAvailableMarkers.append(marker); + if (location.filePath() == filePath() && !lineNumbersWithFixItMarker.contains(line)) { + const TextEditor::RefactorMarker marker + = createFixItAvailableMarker(m_textDocument->document(), line); + + lineNumbersWithFixItMarker.insert(line); + m_fixItAvailableMarkers.append(marker); + } } addFixItAvailableMarker(diagnostic.children(), lineNumbersWithFixItMarker); diff --git a/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp b/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp index 08983d2dab2..7203e18dcb0 100644 --- a/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp +++ b/src/plugins/clangcodemodel/clangfixitoperationsextractor.cpp @@ -27,6 +27,8 @@ #include "clangfixitoperation.h" +#include + #include using ClangBackEnd::DiagnosticContainer; @@ -75,13 +77,16 @@ QString tweakedDiagnosticText(const QString &diagnosticText) return tweakedText; } -bool isDiagnosticFromFileAtLine(const DiagnosticContainer &diagnosticContainer, - const QString &filePath, - int line) +bool hasFixItAt(const QVector &fixits, + const Utf8String &filePath, + int line) { - const auto location = diagnosticContainer.location(); - return location.filePath().toString() == filePath - && location.line() == uint(line); + const auto isFixitForLocation = [filePath, line] (const ClangBackEnd::FixItContainer &fixit) { + const ClangBackEnd::SourceLocationContainer location = fixit.range().start(); + return location.filePath() == filePath && location.line() == uint(line); + }; + + return Utils::anyOf(fixits, isFixitForLocation); } } // anonymous namespace @@ -103,17 +108,17 @@ ClangFixItOperationsExtractor::extract(const QString &filePath, int line) return operations; } -void ClangFixItOperationsExtractor::appendFixitOperationsFromDiagnostic( +void ClangFixItOperationsExtractor::appendFixitOperation( const QString &filePath, - const DiagnosticContainer &diagnosticContainer) + const QString &diagnosticText, + const QVector &fixits) { - const auto fixIts = diagnosticContainer.fixIts(); - if (!fixIts.isEmpty()) { - const QString diagnosticText = tweakedDiagnosticText(diagnosticContainer.text().toString()); + if (!fixits.isEmpty()) { + const QString diagnosticTextTweaked = tweakedDiagnosticText(diagnosticText); TextEditor::QuickFixOperation::Ptr operation( new ClangFixItOperation(filePath, - diagnosticText, - fixIts)); + diagnosticTextTweaked, + fixits)); operations.append(operation); } } @@ -123,8 +128,9 @@ void ClangFixItOperationsExtractor::extractFromDiagnostic( const QString &filePath, int line) { - if (isDiagnosticFromFileAtLine(diagnosticContainer, filePath, line)) { - appendFixitOperationsFromDiagnostic(filePath, diagnosticContainer); + const QVector fixIts = diagnosticContainer.fixIts(); + if (hasFixItAt(fixIts, filePath, line)) { + appendFixitOperation(filePath, diagnosticContainer.text().toString(), fixIts); foreach (const auto &child, diagnosticContainer.children()) extractFromDiagnostic(child, filePath, line); diff --git a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h index e504d27dea8..6c49a3da181 100644 --- a/src/plugins/clangcodemodel/clangfixitoperationsextractor.h +++ b/src/plugins/clangcodemodel/clangfixitoperationsextractor.h @@ -42,8 +42,9 @@ private: void extractFromDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnosticContainer, const QString &filePath, int line); - void appendFixitOperationsFromDiagnostic(const QString &filePath, - const ClangBackEnd::DiagnosticContainer &diagnosticContainer); + void appendFixitOperation(const QString &filePath, + const QString &diagnosticText, + const QVector &fixits); private: const QVector &diagnosticContainers; diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 35b682bfc43..823a750b91c 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -259,44 +259,6 @@ BreakHandler::BreakHandler() << tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads")); } -QIcon BreakHandler::breakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT.icon(); - return icon; -} - -QIcon BreakHandler::disabledBreakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT_DISABLED.icon(); - return icon; -} - -QIcon BreakHandler::pendingBreakpointIcon() -{ - static QIcon icon = Icons::BREAKPOINT_PENDING.icon(); - return icon; -} - -QIcon BreakHandler::watchpointIcon() -{ - static QIcon icon = Icons::WATCHPOINT.icon(); - return icon; -} - -QIcon BreakHandler::tracepointIcon() -{ - static QIcon icon = Icons::TRACEPOINT.icon(); - return icon; -} - -QIcon BreakHandler::emptyIcon() -{ - static QIcon icon = Icons::BREAKPOINT_PENDING.icon(); - //static QIcon icon = Icons::WATCHPOINT.icon(); - //static QIcon icon = Icons::EMPTY.icon(); - return icon; -} - static inline bool fileNameMatch(const QString &f1, const QString &f2) { if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive) @@ -1401,16 +1363,16 @@ QIcon BreakpointItem::icon() const // FIXME: This seems to be called on each cursor blink as soon as the // cursor is near a line with a breakpoint marker (+/- 2 lines or so). if (m_params.isTracepoint()) - return BreakHandler::tracepointIcon(); + return Icons::TRACEPOINT.icon(); if (m_params.type == WatchpointAtAddress) - return BreakHandler::watchpointIcon(); + return Icons::WATCHPOINT.icon(); if (m_params.type == WatchpointAtExpression) - return BreakHandler::watchpointIcon(); + return Icons::WATCHPOINT.icon(); if (!m_params.enabled) - return BreakHandler::disabledBreakpointIcon(); + return Icons::BREAKPOINT_DISABLED.icon(); if (m_state == BreakpointInserted && !m_response.pending) - return BreakHandler::breakpointIcon(); - return BreakHandler::pendingBreakpointIcon(); + return Icons::BREAKPOINT.icon(); + return Icons::BREAKPOINT_PENDING.icon(); } QString BreakpointItem::toToolTip() const diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 7fda24c4c1c..97d16f6fa8f 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -187,13 +187,6 @@ public: Breakpoints findBreakpointsByIndex(const QList &list) const; void updateMarkers(); - static QIcon breakpointIcon(); - static QIcon disabledBreakpointIcon(); - static QIcon pendingBreakpointIcon(); - static QIcon emptyIcon(); - static QIcon watchpointIcon(); - static QIcon tracepointIcon(); - Breakpoint findBreakpointByFileAndLine(const QString &fileName, int lineNumber, bool useMarkerPosition = true); Breakpoint findBreakpointByAddress(quint64 address) const; diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro index a09fbb72321..e3a95138142 100644 --- a/src/plugins/debugger/debugger.pro +++ b/src/plugins/debugger/debugger.pro @@ -123,7 +123,8 @@ SOURCES += \ localsandexpressionswindow.cpp \ imageviewer.cpp \ simplifytype.cpp \ - unstartedappwatcherdialog.cpp + unstartedappwatcherdialog.cpp \ + debuggericons.cpp RESOURCES += debugger.qrc diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 351cd076fad..581424113aa 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -49,7 +49,7 @@ Project { "debugger_global.h", "debuggeractions.cpp", "debuggeractions.h", "debuggerconstants.h", - "debuggericons.h", + "debuggericons.h", "debuggericons.cpp", "debuggercore.h", "debuggerdialogs.cpp", "debuggerdialogs.h", "debuggerengine.cpp", "debuggerengine.h", diff --git a/src/plugins/debugger/debuggercore.h b/src/plugins/debugger/debuggercore.h index c8398a7a14b..11237e2712f 100644 --- a/src/plugins/debugger/debuggercore.h +++ b/src/plugins/debugger/debuggercore.h @@ -61,7 +61,6 @@ enum TestCases // Some convenience. void updateState(DebuggerEngine *engine); void updateWatchersWindow(bool showWatch, bool showReturn); -QIcon locationMarkIcon(); const CPlusPlus::Snapshot &cppCodeModelSnapshot(); bool hasSnapshots(); void openTextEditor(const QString &titlePattern, const QString &contents); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 8cb0ea8a2d1..e1e89e17c25 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -28,6 +28,7 @@ #include "debuggerinternalconstants.h" #include "debuggeractions.h" #include "debuggercore.h" +#include "debuggericons.h" #include "debuggerruncontrol.h" #include "debuggerstartparameters.h" #include "debuggertooltipmanager.h" @@ -37,7 +38,6 @@ #include "logwindow.h" #include "memoryagent.h" #include "moduleshandler.h" -#include "gdb/gdbengine.h" // REMOVE #include "registerhandler.h" #include "sourcefileshandler.h" #include "sourceutils.h" @@ -132,7 +132,7 @@ Location::Location(const StackFrame &frame, bool marker) LocationMark::LocationMark(DebuggerEngine *engine, const QString &file, int line) : TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine) { - setIcon(Internal::locationMarkIcon()); + setIcon(Icons::LOCATION.icon()); setPriority(TextMark::HighPriority); } @@ -564,7 +564,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid)); if (isNativeMixedActive()) - d->m_runParameters.inferior.environment.set(QLatin1String("QV4_FORCE_INTERPRETER"), QLatin1String("1")); + d->m_runParameters.inferior.environment.set("QV4_FORCE_INTERPRETER", "1"); action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability)); @@ -609,7 +609,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) } if (loc.fileName().isEmpty()) { - showMessage(QLatin1String("CANNOT GO TO THIS LOCATION")); + showMessage("CANNOT GO TO THIS LOCATION"); return; } const QString file = QDir::cleanPath(loc.fileName()); @@ -633,7 +633,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) // Called from RunControl. void DebuggerEngine::handleStartFailed() { - showMessage(QLatin1String("HANDLE RUNCONTROL START FAILED")); + showMessage("HANDLE RUNCONTROL START FAILED"); d->m_runControl = 0; d->m_progress.setProgressValue(900); d->m_progress.reportCanceled(); @@ -643,7 +643,7 @@ void DebuggerEngine::handleStartFailed() // Called from RunControl. void DebuggerEngine::handleFinished() { - showMessage(QLatin1String("HANDLE RUNCONTROL FINISHED")); + showMessage("HANDLE RUNCONTROL FINISHED"); d->m_runControl = 0; d->m_progress.setProgressValue(1000); d->m_progress.reportFinished(); @@ -905,7 +905,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re if (result.gdbServerPort.isValid()) { QString &rc = d->m_runParameters.remoteChannel; - const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); + const int sepIndex = rc.lastIndexOf(':'); if (sepIndex != -1) { rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, QString::number(result.gdbServerPort.number())); @@ -1785,9 +1785,9 @@ QString DebuggerEngine::msgInterrupted() void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) { if (name.isEmpty()) - name = QLatin1Char(' ') + tr("", "name") + QLatin1Char(' '); + name = ' ' + tr("", "name") + ' '; if (meaning.isEmpty()) - meaning = QLatin1Char(' ') + tr("", "meaning") + QLatin1Char(' '); + meaning = ' ' + tr("", "meaning") + ' '; const QString msg = tr("

The inferior stopped because it received a " "signal from the operating system.

" "" @@ -1856,14 +1856,14 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp) "experience for this binary format."); return; } else if (warnOnRelease) { - if (!symbolFile.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) - symbolFile.append(QLatin1String(".exe")); + if (!symbolFile.endsWith(".exe", Qt::CaseInsensitive)) + symbolFile.append(".exe"); QString errorMessage; QStringList rc; if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty()) return; if (!errorMessage.isEmpty()) { - detailedWarning.append(QLatin1Char('\n')); + detailedWarning.append('\n'); detailedWarning.append(errorMessage); } } else { @@ -1979,12 +1979,12 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp) tr("The selected debugger may be inappropiate for the inferior.\n" "Examining symbols and setting breakpoints by file name and line number " "may fail.\n") - + QLatin1Char('\n') + detailedWarning); + + '\n' + detailedWarning); } else if (warnOnRelease) { AsynchronousMessageBox::information(tr("Warning"), tr("This does not seem to be a \"Debug\" build.\n" "Setting breakpoints by file name and line number may fail.") - + QLatin1Char('\n') + detailedWarning); + + '\n' + detailedWarning); } } @@ -2007,7 +2007,7 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all) static int count = 0; showMessage(QString("") .arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput); - showStatusMessage(GdbEngine::tr("Finished retrieving data"), 400); // FIXME: String + showStatusMessage(tr("Finished retrieving data"), 400); DebuggerToolTipManager::updateEngine(this); diff --git a/src/plugins/debugger/debuggericons.cpp b/src/plugins/debugger/debuggericons.cpp new file mode 100644 index 00000000000..af974ac38bc --- /dev/null +++ b/src/plugins/debugger/debuggericons.cpp @@ -0,0 +1,128 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "debuggericons.h" + +using namespace Utils; + +namespace Debugger { +namespace Icons { + +const Icon BREAKPOINT({ + {":/debugger/images/breakpoint.png", Theme::IconsErrorColor}}, Icon::Tint); +const Icon BREAKPOINT_DISABLED({ + {":/debugger/images/breakpoint_disabled.png", Theme::IconsErrorColor}}, Icon::Tint); +const Icon BREAKPOINT_PENDING({ + {":/debugger/images/breakpoint.png", Theme::IconsErrorColor}, + {":/debugger/images/breakpoint_pending_overlay.png", Theme::PanelTextColorDark}}, Icon::IconStyleOptions(Icon::Tint | Icon::PunchEdges)); +const Icon BREAKPOINTS( + ":/debugger/images/debugger_breakpoints.png"); +const Icon WATCHPOINT({ + {":/core/images/eye_open.png", Theme::TextColorNormal}}, Icon::Tint); +const Icon TRACEPOINT({ + {":/core/images/eye_open.png", Theme::TextColorNormal}, + {":/debugger/images/tracepointoverlay.png", Theme::TextColorNormal}}, Icon::Tint | Icon::PunchEdges); +const Icon CONTINUE( + ":/debugger/images/debugger_continue.png"); +const Icon CONTINUE_FLAT({ + {":/debugger/images/debugger_continue_1_mask.png", Theme::IconsInterruptToolBarColor}, + {":/debugger/images/debugger_continue_2_mask.png", Theme::IconsRunToolBarColor}, + {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); +const Icon DEBUG_CONTINUE_SMALL({ + {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptColor}, + {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_CONTINUE_SMALL_TOOLBAR({ + {":/projectexplorer/images/continue_1_small.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/continue_2_small.png", Theme::IconsRunToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon INTERRUPT( + ":/debugger/images/debugger_interrupt.png"); +const Icon INTERRUPT_FLAT({ + {":/debugger/images/debugger_interrupt_mask.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/debugger_beetle_mask.png", Theme::IconsDebugColor}}); +const Icon DEBUG_INTERRUPT_SMALL({ + {":/core/images/interrupt_small.png", Theme::IconsInterruptColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({ + {":/core/images/interrupt_small.png", Theme::IconsInterruptToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon DEBUG_EXIT_SMALL({ + {":/core/images/stop_small.png", Theme::IconsStopColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon DEBUG_EXIT_SMALL_TOOLBAR({ + {":/core/images/stop_small.png", Theme::IconsStopToolBarColor}, + {":/projectexplorer/images/debugger_overlay_small.png", Theme::IconsDebugColor}}); +const Icon LOCATION({ + {":/debugger/images/location_background.png", Theme::IconsCodeModelOverlayForegroundColor}, + {":/debugger/images/location.png", Theme::IconsWarningToolBarColor}}, Icon::Tint); +const Icon REVERSE_MODE({ + {":/debugger/images/debugger_reversemode_background.png", Theme::IconsCodeModelOverlayForegroundColor}, + {":/debugger/images/debugger_reversemode.png", Theme::IconsInfoColor}}, Icon::Tint); +const Icon APP_ON_TOP({ + {":/debugger/images/qml/app-on-top.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon APP_ON_TOP_TOOLBAR({ + {":/debugger/images/qml/app-on-top.png", Theme::IconsBaseColor}}); +const Icon SELECT({ + {":/debugger/images/qml/select.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon SELECT_TOOLBAR({ + {":/debugger/images/qml/select.png", Theme::IconsBaseColor}}); +const Icon EMPTY( + ":/debugger/images/debugger_empty_14.png"); +const Icon RECORD_ON({ + {":/debugger/images/recordfill.png", Theme::IconsStopColor}, + {":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow); +const Icon RECORD_OFF({ + {":/debugger/images/recordfill.png", Theme::IconsDisabledColor}, + {":/debugger/images/recordoutline.png", Theme::IconsBaseColor}}, Icon::Tint | Icon::DropShadow); + +const Icon STEP_OVER({ + {":/debugger/images/debugger_stepover_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_OVER_TOOLBAR({ + {":/debugger/images/debugger_stepover_small.png", Theme::IconsBaseColor}}); +const Icon STEP_INTO({ + {":/debugger/images/debugger_stepinto_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_INTO_TOOLBAR({ + {":/debugger/images/debugger_stepinto_small.png", Theme::IconsBaseColor}}); +const Icon STEP_OUT({ + {":/debugger/images/debugger_stepout_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon STEP_OUT_TOOLBAR({ + {":/debugger/images/debugger_stepout_small.png", Theme::IconsBaseColor}}); +const Icon RESTART({ + {":/debugger/images/debugger_restart_small.png", Theme::PanelTextColorMid}}, Icon::MenuTintedStyle); +const Icon RESTART_TOOLBAR({ + {":/debugger/images/debugger_restart_small.png", Theme::IconsRunToolBarColor}}); +const Icon SINGLE_INSTRUCTION_MODE({ + {":/debugger/images/debugger_singleinstructionmode.png", Theme::IconsBaseColor}}); + +const Icon MODE_DEBUGGER_CLASSIC( + ":/debugger/images/mode_debug.png"); +const Icon MODE_DEBUGGER_FLAT({ + {":/debugger/images/mode_debug_mask.png", Theme::IconsBaseColor}}); +const Icon MODE_DEBUGGER_FLAT_ACTIVE({ + {":/debugger/images/mode_debug_mask.png", Theme::IconsModeDebugActiveColor}}); + +} // namespace Icons +} // namespace Debugger diff --git a/src/plugins/debugger/debuggericons.h b/src/plugins/debugger/debuggericons.h index 220b06fe4ca..7306ce920af 100644 --- a/src/plugins/debugger/debuggericons.h +++ b/src/plugins/debugger/debuggericons.h @@ -25,104 +25,54 @@ #pragma once +#include "debugger_global.h" + #include namespace Debugger { namespace Icons { -const Utils::Icon BREAKPOINT({ - {QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint); -const Utils::Icon BREAKPOINT_DISABLED({ - {QLatin1String(":/debugger/images/breakpoint_disabled.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint); -const Utils::Icon BREAKPOINT_PENDING({ - {QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}, - {QLatin1String(":/debugger/images/breakpoint_pending_overlay.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::IconStyleOptions(Utils::Icon::Tint | Utils::Icon::PunchEdges)); -const Utils::Icon BREAKPOINTS( - QLatin1String(":/debugger/images/debugger_breakpoints.png")); -const Utils::Icon WATCHPOINT({ - {QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint); -const Utils::Icon TRACEPOINT({ - {QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal}, - {QLatin1String(":/debugger/images/tracepointoverlay.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint | Utils::Icon::PunchEdges); -const Utils::Icon CONTINUE( - QLatin1String(":/debugger/images/debugger_continue.png")); -const Utils::Icon CONTINUE_FLAT({ - {QLatin1String(":/debugger/images/debugger_continue_1_mask.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/debugger/images/debugger_continue_2_mask.png"), Utils::Theme::IconsRunToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_CONTINUE_SMALL({ - {QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptColor}, - {QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR({ - {QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon INTERRUPT( - QLatin1String(":/debugger/images/debugger_interrupt.png")); -const Utils::Icon INTERRUPT_FLAT({ - {QLatin1String(":/debugger/images/debugger_interrupt_mask.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_INTERRUPT_SMALL({ - {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({ - {QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon DEBUG_EXIT_SMALL({ - {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR({ - {QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopToolBarColor}, - {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); -const Utils::Icon LOCATION({ - {QLatin1String(":/debugger/images/location_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor}, - {QLatin1String(":/debugger/images/location.png"), Utils::Theme::IconsWarningToolBarColor}}, Utils::Icon::Tint); -const Utils::Icon REVERSE_MODE({ - {QLatin1String(":/debugger/images/debugger_reversemode_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor}, - {QLatin1String(":/debugger/images/debugger_reversemode.png"), Utils::Theme::IconsInfoColor}}, Utils::Icon::Tint); -const Utils::Icon APP_ON_TOP({ - {QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon APP_ON_TOP_TOOLBAR({ - {QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon SELECT({ - {QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon SELECT_TOOLBAR({ - {QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon EMPTY( - QLatin1String(":/debugger/images/debugger_empty_14.png")); -const Utils::Icon RECORD_ON({ - {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsStopColor}, - {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); -const Utils::Icon RECORD_OFF({ - {QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsDisabledColor}, - {QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow); +// Used in QmlProfiler. +DEBUGGER_EXPORT extern const Utils::Icon RECORD_ON; +DEBUGGER_EXPORT extern const Utils::Icon RECORD_OFF; -const Utils::Icon STEP_OVER({ - {QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_OVER_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon STEP_INTO({ - {QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_INTO_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon STEP_OUT({ - {QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon STEP_OUT_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon RESTART({ - {QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); -const Utils::Icon RESTART_TOOLBAR({ - {QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::IconsRunToolBarColor}}); -const Utils::Icon SINGLE_INSTRUCTION_MODE({ - {QLatin1String(":/debugger/images/debugger_singleinstructionmode.png"), Utils::Theme::IconsBaseColor}}); +extern const Utils::Icon BREAKPOINT; +extern const Utils::Icon BREAKPOINT_DISABLED; +extern const Utils::Icon BREAKPOINT_PENDING; +extern const Utils::Icon BREAKPOINTS; +extern const Utils::Icon WATCHPOINT; +extern const Utils::Icon TRACEPOINT; +extern const Utils::Icon CONTINUE; +extern const Utils::Icon CONTINUE_FLAT; +extern const Utils::Icon DEBUG_CONTINUE_SMALL; +extern const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR; +extern const Utils::Icon INTERRUPT; +extern const Utils::Icon INTERRUPT_FLAT; +extern const Utils::Icon DEBUG_INTERRUPT_SMALL; +extern const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR; +extern const Utils::Icon DEBUG_EXIT_SMALL; +extern const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR; +extern const Utils::Icon LOCATION; +extern const Utils::Icon REVERSE_MODE; +extern const Utils::Icon APP_ON_TOP; +extern const Utils::Icon APP_ON_TOP_TOOLBAR; +extern const Utils::Icon SELECT; +extern const Utils::Icon SELECT_TOOLBAR; +extern const Utils::Icon EMPTY; -const Utils::Icon MODE_DEBUGGER_CLASSIC( - QLatin1String(":/debugger/images/mode_debug.png")); -const Utils::Icon MODE_DEBUGGER_FLAT({ - {QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsBaseColor}}); -const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE({ - {QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsModeDebugActiveColor}}); +extern const Utils::Icon STEP_OVER; +extern const Utils::Icon STEP_OVER_TOOLBAR; +extern const Utils::Icon STEP_INTO; +extern const Utils::Icon STEP_INTO_TOOLBAR; +extern const Utils::Icon STEP_OUT; +extern const Utils::Icon STEP_OUT_TOOLBAR; +extern const Utils::Icon RESTART; +extern const Utils::Icon RESTART_TOOLBAR; +extern const Utils::Icon SINGLE_INSTRUCTION_MODE; + +extern const Utils::Icon MODE_DEBUGGER_CLASSIC; +extern const Utils::Icon MODE_DEBUGGER_FLAT; +extern const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE; } // namespace Icons } // namespace Debugger diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index c8213bed9fd..8ef07a30bf5 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -998,8 +998,6 @@ public: QToolButton *m_reverseToolButton = 0; - QIcon m_locationMarkIcon; - QLabel *m_threadLabel = 0; QComboBox *m_threadBox = 0; @@ -1310,8 +1308,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, const Context cppDebuggercontext(C_CPPDEBUGGER); const Context cppeditorcontext(CppEditor::Constants::CPPEDITOR_ID); - m_locationMarkIcon = Icons::LOCATION.icon(); - m_busy = false; m_logWindow = new LogWindow; @@ -3107,11 +3103,6 @@ void updateWatchersWindow(bool showWatch, bool showReturn) dd->m_returnWindow->setVisible(showReturn); } -QIcon locationMarkIcon() -{ - return dd->m_locationMarkIcon; -} - bool hasSnapshots() { return dd->m_snapshotHandler->size(); diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index 6d3749b45f9..e96532e60ed 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -562,9 +562,8 @@ void RegisterHandler::setNumberFormat(const QString &name, RegisterFormat format RegisterMap RegisterHandler::registerMap() const { RegisterMap result; - Utils::TreeItem *root = rootItem(); - for (int i = 0, n = root->rowCount(); i != n; ++i) { - RegisterItem *reg = static_cast(root->child(i)); + for (int i = 0, n = rootItem()->childCount(); i != n; ++i) { + RegisterItem *reg = rootItem()->childAt(i); quint64 value = reg->addressValue(); if (value) result.insert(value, reg->m_reg.name); diff --git a/src/plugins/debugger/registerhandler.h b/src/plugins/debugger/registerhandler.h index 96293cfa1e0..5394eee00ed 100644 --- a/src/plugins/debugger/registerhandler.h +++ b/src/plugins/debugger/registerhandler.h @@ -115,9 +115,13 @@ public: }; class RegisterItem; +class RegisterSubItem; +using RegisterRootItem = Utils::TypedTreeItem; + typedef QMap RegisterMap; -class RegisterHandler : public Utils::TreeModel +class RegisterHandler + : public Utils::LeveledTreeModel { Q_OBJECT diff --git a/src/plugins/debugger/snapshothandler.cpp b/src/plugins/debugger/snapshothandler.cpp index 7bf37a5e568..d5b161582b9 100644 --- a/src/plugins/debugger/snapshothandler.cpp +++ b/src/plugins/debugger/snapshothandler.cpp @@ -119,8 +119,6 @@ QDebug operator<<(QDebug d, const SnapshotData &f) */ SnapshotHandler::SnapshotHandler() - : m_positionIcon(Icons::LOCATION.icon()), - m_emptyIcon(Icons::EMPTY.icon()) { m_currentIndex = -1; } @@ -178,8 +176,7 @@ QVariant SnapshotHandler::data(const QModelIndex &index, int role) const case Qt::DecorationRole: // Return icon that indicates whether this is the active stack frame. if (index.column() == 0) - return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon; - break; + return (index.row() == m_currentIndex) ? Icons::LOCATION.icon() : Icons::EMPTY.icon(); default: break; diff --git a/src/plugins/debugger/snapshothandler.h b/src/plugins/debugger/snapshothandler.h index b17a498867d..acecb0531d6 100644 --- a/src/plugins/debugger/snapshothandler.h +++ b/src/plugins/debugger/snapshothandler.h @@ -65,8 +65,6 @@ private: int m_currentIndex; QList< QPointer > m_snapshots; - const QVariant m_positionIcon; - const QVariant m_emptyIcon; }; } // namespace Internal diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp index f04bf49960c..1d9042d16ec 100644 --- a/src/plugins/debugger/sourceagent.cpp +++ b/src/plugins/debugger/sourceagent.cpp @@ -26,8 +26,8 @@ #include "sourceagent.h" #include "debuggerengine.h" +#include "debuggericons.h" #include "debuggerinternalconstants.h" -#include "debuggercore.h" #include "stackhandler.h" #include @@ -141,7 +141,7 @@ void SourceAgent::updateLocationMarker() d->locationMark = new TextMark(QString(), lineNumber, Constants::TEXT_MARK_CATEGORY_LOCATION); - d->locationMark->setIcon(locationMarkIcon()); + d->locationMark->setIcon(Icons::LOCATION.icon()); d->locationMark->setPriority(TextMark::HighPriority); d->editor->textDocument()->addMark(d->locationMark); diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 8ab60b86753..ffcb003d3be 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -54,9 +54,7 @@ namespace Internal { */ StackHandler::StackHandler(DebuggerEngine *engine) - : m_engine(engine), - m_positionIcon(Icons::LOCATION.icon()), - m_emptyIcon(Icons::EMPTY.icon()) + : m_engine(engine) { setObjectName(QLatin1String("StackModel")); m_resetLocationScheduled = false; @@ -93,7 +91,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const if (role == Qt::DisplayRole && index.column() == StackFunctionNameColumn) return tr(""); if (role == Qt::DecorationRole && index.column() == StackLevelColumn) - return m_emptyIcon; + return Icons::EMPTY.icon(); return QVariant(); } @@ -120,7 +118,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const if (role == Qt::DecorationRole && index.column() == StackLevelColumn) { // Return icon that indicates whether this is the active stack frame return (m_contentsValid && index.row() == m_currentIndex) - ? m_positionIcon : m_emptyIcon; + ? Icons::LOCATION.icon() : Icons::EMPTY.icon(); } if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInStackView)) diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h index cbc298bb045..6f88b1c3f28 100644 --- a/src/plugins/debugger/stackhandler.h +++ b/src/plugins/debugger/stackhandler.h @@ -88,8 +88,6 @@ private: DebuggerEngine *m_engine; StackFrames m_stackFrames; int m_currentIndex; - const QVariant m_positionIcon; - const QVariant m_emptyIcon; bool m_canExpand; bool m_resetLocationScheduled; bool m_contentsValid; diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp index 306cd6146bf..f387a9ae974 100644 --- a/src/plugins/debugger/threadshandler.cpp +++ b/src/plugins/debugger/threadshandler.cpp @@ -48,18 +48,6 @@ namespace Internal { // /////////////////////////////////////////////////////////////////////// -static const QIcon &positionIcon() -{ - static QIcon icon = Icons::LOCATION.icon(); - return icon; -} - -static const QIcon &emptyIcon() -{ - static QIcon icon = Icons::EMPTY.icon(); - return icon; -} - class ThreadItem : public TreeItem { Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::ThreadsHandler) @@ -79,7 +67,8 @@ public: case Qt::DecorationRole: // Return icon that indicates whether this is the active stack frame. if (column == 0) - return threadData.id == handler->currentThread() ? positionIcon() : emptyIcon(); + return threadData.id == handler->currentThread() ? Icons::LOCATION.icon() + : Icons::EMPTY.icon(); break; case ThreadData::IdRole: return threadData.id.raw(); @@ -266,9 +255,9 @@ int ThreadsHandler::currentThreadIndex() const void ThreadsHandler::sort(int column, Qt::SortOrder order) { - rootItem()->sortChildren([order, column](const TreeItem *item1, const TreeItem *item2) -> bool { - const QVariant v1 = static_cast(item1)->threadPart(column); - const QVariant v2 = static_cast(item2)->threadPart(column); + rootItem()->sortChildren([order, column](const ThreadItem *item1, const ThreadItem *item2) -> bool { + const QVariant v1 = item1->threadPart(column); + const QVariant v2 = item2->threadPart(column); if (v1 == v2) return false; if (column == 0) @@ -286,7 +275,7 @@ ThreadId ThreadsHandler::currentThread() const ThreadId ThreadsHandler::threadAt(int index) const { QTC_ASSERT(index >= 0 && index < rootItem()->childCount(), return ThreadId()); - return static_cast(rootItem()->childAt(index))->threadData.id; + return rootItem()->childAt(index)->threadData.id; } void ThreadsHandler::setCurrentThread(ThreadId id) diff --git a/src/plugins/debugger/threadshandler.h b/src/plugins/debugger/threadshandler.h index 9a29b5314e7..feeb57aa174 100644 --- a/src/plugins/debugger/threadshandler.h +++ b/src/plugins/debugger/threadshandler.h @@ -41,7 +41,7 @@ namespace Internal { class GdbMi; class ThreadItem; -class ThreadsHandler : public Utils::LeveledTreeModel +class ThreadsHandler : public Utils::LeveledTreeModel, ThreadItem> { Q_OBJECT diff --git a/src/plugins/genericprojectmanager/genericmakestep.cpp b/src/plugins/genericprojectmanager/genericmakestep.cpp index 0e581fa1552..c12ba79dd72 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.cpp +++ b/src/plugins/genericprojectmanager/genericmakestep.cpp @@ -239,13 +239,13 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt connect(m_ui->makeArgumentsLineEdit, &QLineEdit::textEdited, this, &GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited); - connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), - this, SLOT(updateMakeOverrrideLabel())); - connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), - this, SLOT(updateDetails())); + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, + this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel); + connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged, + this, &GenericMakeStepConfigWidget::updateDetails); - connect(m_makeStep->target(), SIGNAL(kitChanged()), - this, SLOT(updateMakeOverrrideLabel())); + connect(m_makeStep->target(), &Target::kitChanged, + this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel); connect(pro, &GenericProject::environmentChanged, this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel); diff --git a/src/plugins/genericprojectmanager/genericmakestep.h b/src/plugins/genericprojectmanager/genericmakestep.h index 031366dfa2f..e36315c87bf 100644 --- a/src/plugins/genericprojectmanager/genericmakestep.h +++ b/src/plugins/genericprojectmanager/genericmakestep.h @@ -87,14 +87,13 @@ public: QString displayName() const override; QString summaryText() const override; -private slots: +private: void itemChanged(QListWidgetItem *item); void makeLineEditTextEdited(); void makeArgumentsLineEditTextEdited(); void updateMakeOverrrideLabel(); void updateDetails(); -private: Ui::GenericMakeStep *m_ui; GenericMakeStep *m_makeStep; QString m_summaryText; diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 53337230d8f..782a0c6cb36 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -195,7 +195,7 @@ public: void operator=(Runnable other) { d = std::move(other.d); } template bool is() const { - return d.get()->typeId() == T::staticTypeId; + return d.get() && (d.get()->typeId() == T::staticTypeId); } template const T &as() const { @@ -235,7 +235,7 @@ public: void operator=(Connection other) { d = std::move(other.d); } template bool is() const { - return d.get()->typeId() == T::staticTypeId; + return d.get() && (d.get()->typeId() == T::staticTypeId); } template const T &as() const { diff --git a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp index ea5c3a2404f..649ca978567 100644 --- a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp +++ b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp @@ -51,10 +51,12 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti m_ui->propertiesTable->setItem(currentRow, 1, valueItem); ++currentRow; } - connect(m_ui->addButton, SIGNAL(clicked()), SLOT(addProperty())); - connect(m_ui->removeButton, SIGNAL(clicked()), SLOT(removeSelectedProperty())); - connect(m_ui->propertiesTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), - SLOT(handleCurrentItemChanged())); + connect(m_ui->addButton, &QAbstractButton::clicked, + this, &CustomQbsPropertiesDialog::addProperty); + connect(m_ui->removeButton, &QAbstractButton::clicked, + this, &CustomQbsPropertiesDialog::removeSelectedProperty); + connect(m_ui->propertiesTable, &QTableWidget::currentItemChanged, + this, &CustomQbsPropertiesDialog::handleCurrentItemChanged); handleCurrentItemChanged(); } diff --git a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h index 0668f77720e..cbbc757945d 100644 --- a/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h +++ b/src/plugins/qbsprojectmanager/customqbspropertiesdialog.h @@ -42,7 +42,7 @@ public: QVariantMap properties() const; ~CustomQbsPropertiesDialog(); -private slots: +private: void addProperty(); void removeSelectedProperty(); void handleCurrentItemChanged(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h index 1dd37792bcc..c399e14fffa 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.h @@ -86,10 +86,9 @@ protected: QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id); bool fromMap(const QVariantMap &map) override; -private slots: +private: void buildStepInserted(int pos); -private: static QbsBuildConfiguration *setup(ProjectExplorer::Target *t, const QString &defaultDisplayName, const QString &displayName, diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h b/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h index b8309ede833..bdb6f6352b8 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h +++ b/src/plugins/qbsprojectmanager/qbsbuildconfigurationwidget.h @@ -43,7 +43,7 @@ class QbsBuildConfigurationWidget : public ProjectExplorer::NamedWidget public: QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc); -private slots: +private: void buildDirEdited(); // Changes triggered from creator diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index ae589981ead..20221d42a92 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -112,8 +112,10 @@ bool QbsBuildStep::init(QList &earlierSteps) m_activeFileTags = bc->activeFileTags(); m_products = bc->products(); - connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), - this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat))); + connect(m_parser, &ProjectExplorer::IOutputParser::addOutput, + this, [this](const QString &string, ProjectExplorer::BuildStep::OutputFormat format) { + emit addOutput(string, format); + }); connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask); return true; @@ -259,7 +261,7 @@ void QbsBuildStep::buildingDone(bool success) void QbsBuildStep::reparsingDone(bool success) { - disconnect(qbsProject(), SIGNAL(projectParsingDone(bool)), this, SLOT(reparsingDone(bool))); + disconnect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone); m_parsingProject = false; if (m_job) { // This was a scheduled reparsing after building. finish(); @@ -398,7 +400,7 @@ void QbsBuildStep::setCleanInstallRoot(bool clean) void QbsBuildStep::parseProject() { m_parsingProject = true; - connect(qbsProject(), SIGNAL(projectParsingDone(bool)), SLOT(reparsingDone(bool))); + connect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone); qbsProject()->parseCurrentBuildConfiguration(); } @@ -419,15 +421,15 @@ void QbsBuildStep::build() m_progressBase = 0; - connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(buildingDone(bool))); - connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), - this, SLOT(handleTaskStarted(QString,int))); - connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), - this, SLOT(handleProgress(int))); - connect(m_job, SIGNAL(reportCommandDescription(QString,QString)), - this, SLOT(handleCommandDescriptionReport(QString,QString))); - connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)), - this, SLOT(handleProcessResultReport(qbs::ProcessResult))); + connect(m_job, &qbs::AbstractJob::finished, this, &QbsBuildStep::buildingDone); + connect(m_job, &qbs::AbstractJob::taskStarted, + this, &QbsBuildStep::handleTaskStarted); + connect(m_job, &qbs::AbstractJob::taskProgress, + this, &QbsBuildStep::handleProgress); + connect(m_job, &qbs::BuildJob::reportCommandDescription, + this, &QbsBuildStep::handleCommandDescriptionReport); + connect(m_job, &qbs::BuildJob::reportProcessResult, + this, &QbsBuildStep::handleProcessResultReport); } @@ -455,9 +457,12 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : m_step(step), m_ignoreChange(false) { - connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); - connect(m_step, SIGNAL(qbsConfigurationChanged()), this, SLOT(updateState())); - connect(m_step, SIGNAL(qbsBuildOptionsChanged()), this, SLOT(updateState())); + connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged, + this, &QbsBuildStepConfigWidget::updateState); + connect(m_step, &QbsBuildStep::qbsConfigurationChanged, + this, &QbsBuildStepConfigWidget::updateState); + connect(m_step, &QbsBuildStep::qbsBuildOptionsChanged, + this, &QbsBuildStepConfigWidget::updateState); connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged, this, &QbsBuildStepConfigWidget::updateState); connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged, @@ -474,10 +479,13 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : }); m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap()); - connect(m_ui->buildVariantComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(changeBuildVariant(int))); - connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); - connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int))); + connect(m_ui->buildVariantComboBox, + static_cast(&QComboBox::currentIndexChanged), + this, &QbsBuildStepConfigWidget::changeBuildVariant); + connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled, + this, &QbsBuildStepConfigWidget::changeKeepGoing); + connect(m_ui->jobSpinBox, static_cast(&QSpinBox::valueChanged), + this, &QbsBuildStepConfigWidget::changeJobCount); connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this, &QbsBuildStepConfigWidget::changeShowCommandLines); connect(m_ui->installCheckBox, &QCheckBox::toggled, this, @@ -486,10 +494,10 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) : &QbsBuildStepConfigWidget::changeCleanInstallRoot); connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this, &QbsBuildStepConfigWidget::changeForceProbes); - connect(m_ui->qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)), - this, SLOT(linkQmlDebuggingLibraryChecked(bool))); - connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)), - this, SLOT(updateQmlDebuggingOption())); + connect(m_ui->qmlDebuggingLibraryCheckBox, &QAbstractButton::toggled, + this, &QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked); + connect(QtSupport::QtVersionManager::instance(), &QtSupport::QtVersionManager::dumpUpdatedFor, + this, &QbsBuildStepConfigWidget::updateQmlDebuggingOption); updateState(); } diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index e45e7b9ac57..5264b2fa35b 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -80,7 +80,7 @@ signals: void qbsConfigurationChanged(); void qbsBuildOptionsChanged(); -private slots: +private: void buildingDone(bool success); void reparsingDone(bool success); void handleTaskStarted(const QString &desciption, int max); @@ -88,7 +88,6 @@ private slots: void handleCommandDescriptionReport(const QString &highlight, const QString &message); void handleProcessResultReport(const qbs::ProcessResult &result); -private: void createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line); @@ -137,7 +136,7 @@ public: QString summaryText() const; QString displayName() const; -private slots: +private: void updateState(); void updateQmlDebuggingOption(); void updatePropertyEdit(const QVariantMap &data); @@ -154,7 +153,6 @@ private slots: // QML debugging: void linkQmlDebuggingLibraryChecked(bool checked); -private: bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage); Ui::QbsBuildStepConfigWidget *m_ui; diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index 363f1ceeb27..faaf2a04e4d 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -106,11 +106,11 @@ void QbsCleanStep::run(QFutureInterface &fi) m_progressBase = 0; - connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(cleaningDone(bool))); - connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), - this, SLOT(handleTaskStarted(QString,int))); - connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), - this, SLOT(handleProgress(int))); + connect(m_job, &qbs::AbstractJob::finished, this, &QbsCleanStep::cleaningDone); + connect(m_job, &qbs::AbstractJob::taskStarted, + this, &QbsCleanStep::handleTaskStarted); + connect(m_job, &qbs::AbstractJob::taskProgress, + this, &QbsCleanStep::handleProgress); } ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget() @@ -233,16 +233,20 @@ void QbsCleanStep::setMaxJobs(int jobcount) QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) : m_step(step) { - connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); - connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); + connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged, + this, &QbsCleanStepConfigWidget::updateState); + connect(m_step, &QbsCleanStep::changed, + this, &QbsCleanStepConfigWidget::updateState); setContentsMargins(0, 0, 0, 0); m_ui = new Ui::QbsCleanStepConfigWidget; m_ui->setupUi(this); - connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); - connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); + connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled, + this, &QbsCleanStepConfigWidget::changeDryRun); + connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled, + this, &QbsCleanStepConfigWidget::changeKeepGoing); updateState(); } diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.h b/src/plugins/qbsprojectmanager/qbscleanstep.h index 433ba50598a..f8814cbcb69 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.h +++ b/src/plugins/qbsprojectmanager/qbscleanstep.h @@ -65,12 +65,11 @@ public: signals: void changed(); -private slots: +private: void cleaningDone(bool success); void handleTaskStarted(const QString &desciption, int max); void handleProgress(int value); -private: void createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line); @@ -100,14 +99,13 @@ public: QString summaryText() const; QString displayName() const; -private slots: +private: void updateState(); void changeDryRun(bool dr); void changeKeepGoing(bool kg); void changeJobCount(int jobcount); -private: Ui::QbsCleanStepConfigWidget *m_ui; QbsCleanStep *m_step; diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index 8e75d2d0a56..14687dac63d 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -99,11 +99,11 @@ void QbsInstallStep::run(QFutureInterface &fi) m_progressBase = 0; - connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(installDone(bool))); - connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), - this, SLOT(handleTaskStarted(QString,int))); - connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), - this, SLOT(handleProgress(int))); + connect(m_job, &qbs::AbstractJob::finished, this, &QbsInstallStep::installDone); + connect(m_job, &qbs::AbstractJob::taskStarted, + this, &QbsInstallStep::handleTaskStarted); + connect(m_job, &qbs::AbstractJob::taskProgress, + this, &QbsInstallStep::handleProgress); } ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget() @@ -261,8 +261,10 @@ void QbsInstallStep::setKeepGoing(bool kg) QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) : m_step(step), m_ignoreChange(false) { - connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); - connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); + connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged, + this, &QbsInstallStepConfigWidget::updateState); + connect(m_step, &QbsInstallStep::changed, + this, &QbsInstallStepConfigWidget::updateState); setContentsMargins(0, 0, 0, 0); @@ -275,13 +277,17 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) : m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory); m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History")); - connect(m_ui->installRootChooser, SIGNAL(rawPathChanged(QString)), this, - SLOT(changeInstallRoot())); - connect(m_ui->removeFirstCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeRemoveFirst(bool))); - connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); - connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); + connect(m_ui->installRootChooser, &Utils::PathChooser::rawPathChanged, this, + &QbsInstallStepConfigWidget::changeInstallRoot); + connect(m_ui->removeFirstCheckBox, &QAbstractButton::toggled, + this, &QbsInstallStepConfigWidget::changeRemoveFirst); + connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled, + this, &QbsInstallStepConfigWidget::changeDryRun); + connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled, + this, &QbsInstallStepConfigWidget::changeKeepGoing); - connect(project, SIGNAL(projectParsingDone(bool)), this, SLOT(updateState())); + connect(project, &QbsProject::projectParsingDone, + this, &QbsInstallStepConfigWidget::updateState); updateState(); } diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.h b/src/plugins/qbsprojectmanager/qbsinstallstep.h index 8ec22fbe924..609a2099dc1 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.h +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.h @@ -68,12 +68,11 @@ public: signals: void changed(); -private slots: +private: void installDone(bool success); void handleTaskStarted(const QString &desciption, int max); void handleProgress(int value); -private: void createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line); @@ -104,7 +103,7 @@ public: QString summaryText() const; QString displayName() const; -private slots: +private: void updateState(); void changeInstallRoot(); diff --git a/src/plugins/qbsprojectmanager/qbslogsink.cpp b/src/plugins/qbsprojectmanager/qbslogsink.cpp index 326076e9618..c9a2f28d641 100644 --- a/src/plugins/qbsprojectmanager/qbslogsink.cpp +++ b/src/plugins/qbsprojectmanager/qbslogsink.cpp @@ -36,6 +36,8 @@ #include #include +using namespace ProjectExplorer; + namespace QbsProjectManager { namespace Internal { @@ -45,9 +47,9 @@ namespace Internal { QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent) { - connect(this, SIGNAL(newTask(ProjectExplorer::Task)), - ProjectExplorer::TaskHub::instance(), - SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection); + connect(this, &QbsLogSink::newTask, + TaskHub::instance(), + [](const Task &task) { TaskHub::addTask(task); }, Qt::QueuedConnection); } void QbsLogSink::sendMessages() @@ -66,11 +68,11 @@ void QbsLogSink::sendMessages() void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning) { foreach (const qbs::ErrorItem &item, warning.items()) - emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, - item.description(), - Utils::FileName::fromString(item.codeLocation().filePath()), - item.codeLocation().line(), - ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + emit newTask(Task(Task::Warning, + item.description(), + Utils::FileName::fromString(item.codeLocation().filePath()), + item.codeLocation().line(), + Constants::TASK_CATEGORY_BUILDSYSTEM)); } void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag) diff --git a/src/plugins/qbsprojectmanager/qbslogsink.h b/src/plugins/qbsprojectmanager/qbslogsink.h index f17c4833e1b..f3f07f6513c 100644 --- a/src/plugins/qbsprojectmanager/qbslogsink.h +++ b/src/plugins/qbsprojectmanager/qbslogsink.h @@ -45,10 +45,9 @@ public: signals: void newTask(const ProjectExplorer::Task &task); -private slots: - void sendMessages(); - private: + Q_INVOKABLE void sendMessages(); + void doPrintWarning(const qbs::ErrorInfo &warning); void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag); diff --git a/src/plugins/qbsprojectmanager/qbsparser.h b/src/plugins/qbsprojectmanager/qbsparser.h index 6fa8a86c802..22b3fd1f322 100644 --- a/src/plugins/qbsprojectmanager/qbsparser.h +++ b/src/plugins/qbsprojectmanager/qbsparser.h @@ -41,12 +41,10 @@ class QbsParser : public ProjectExplorer::IOutputParser public: explicit QbsParser(); +private: void setWorkingDirectory(const QString &workingDirectory); - -public slots: void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines); -private: QDir m_workingDirectory; }; diff --git a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp index 81de2829b79..588a645272d 100644 --- a/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp +++ b/src/plugins/qbsprojectmanager/qbsprofilessettingspage.cpp @@ -54,12 +54,10 @@ public: void apply(); -private slots: +private: void refreshKitsList(); void displayCurrentProfile(); void editProfile(); - -private: void setupCustomProperties(const ProjectExplorer::Kit *kit); void mergeCustomPropertiesIntoModel(); @@ -123,9 +121,12 @@ QbsProfilesSettingsWidget::QbsProfilesSettingsWidget(QWidget *parent) m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir()); displayCurrentProfile(); }); - connect(m_ui.expandButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(expandAll())); - connect(m_ui.collapseButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(collapseAll())); - connect(m_ui.editButton, SIGNAL(clicked()), SLOT(editProfile())); + connect(m_ui.expandButton, &QAbstractButton::clicked, + m_ui.propertiesView, &QTreeView::expandAll); + connect(m_ui.collapseButton, &QAbstractButton::clicked, + m_ui.propertiesView, &QTreeView::collapseAll); + connect(m_ui.editButton, &QAbstractButton::clicked, + this, &QbsProfilesSettingsWidget::editProfile); refreshKitsList(); } @@ -175,7 +176,9 @@ void QbsProfilesSettingsWidget::refreshKitsList() else if (hasKits) m_ui.kitsComboBox->setCurrentIndex(0); displayCurrentProfile(); - connect(m_ui.kitsComboBox, SIGNAL(currentIndexChanged(int)), SLOT(displayCurrentProfile())); + connect(m_ui.kitsComboBox, + static_cast(&QComboBox::currentIndexChanged), + this, &QbsProfilesSettingsWidget::displayCurrentProfile); } void QbsProfilesSettingsWidget::displayCurrentProfile() diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index b9f6556d108..822001a4e67 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -117,13 +117,11 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) : setProjectContext(Context(Constants::PROJECT_ID)); setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX)); - connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), - this, SLOT(changeActiveTarget(ProjectExplorer::Target*))); - connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)), - this, SLOT(targetWasAdded(ProjectExplorer::Target*))); - connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing())); + connect(this, &Project::activeTargetChanged, this, &QbsProject::changeActiveTarget); + connect(this, &Project::addedTarget, this, &QbsProject::targetWasAdded); + connect(this, &Project::environmentChanged, this, &QbsProject::delayParsing); - connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing())); + connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing); } QbsProject::~QbsProject() @@ -531,9 +529,8 @@ void QbsProject::handleRuleExecutionDone() void QbsProject::targetWasAdded(Target *t) { - connect(t, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), - this, SLOT(delayParsing())); - connect(t, SIGNAL(buildDirectoryChanged()), this, SLOT(delayParsing())); + connect(t, &Target::activeBuildConfigurationChanged, this, &QbsProject::delayParsing); + connect(t, &Target::buildDirectoryChanged, this, &QbsProject::delayParsing); } void QbsProject::changeActiveTarget(Target *t) @@ -547,11 +544,13 @@ void QbsProject::changeActiveTarget(Target *t) void QbsProject::buildConfigurationChanged(BuildConfiguration *bc) { if (m_currentBc) - disconnect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing())); + disconnect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged, + this, &QbsProject::delayParsing); m_currentBc = qobject_cast(bc); if (m_currentBc) { - connect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing())); + connect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged, + this, &QbsProject::delayParsing); delayParsing(); } else { invalidate(); @@ -640,7 +639,8 @@ void QbsProject::registerQbsProjectParser(QbsProjectParser *p) if (p) { connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone, this, &QbsProject::handleRuleExecutionDone); - connect(m_qbsProjectParser, SIGNAL(done(bool)), this, SLOT(handleQbsParsingDone(bool))); + connect(m_qbsProjectParser, &QbsProjectParser::done, + this, &QbsProject::handleQbsParsingDone); } } diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index c22a161cd89..7edbd73cbb6 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -106,7 +106,7 @@ public: const qbs::ProductData &product); static QString uniqueProductName(const qbs::ProductData &product); -public slots: +public: void invalidate(); void delayParsing(); @@ -114,7 +114,7 @@ signals: void projectParsingStarted(); void projectParsingDone(bool); -private slots: +private: void handleQbsParsingDone(bool success); void targetWasAdded(ProjectExplorer::Target *t); @@ -122,7 +122,6 @@ private slots: void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc); void startParsing(); -private: RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir); diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp index e31de7cec70..04cc9c25ae7 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.cpp @@ -127,19 +127,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext); command->setAttribute(Core::Command::CA_Hide); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); - connect(m_reparseQbs, SIGNAL(triggered()), this, SLOT(reparseCurrentProject())); + connect(m_reparseQbs, &QAction::triggered, + this, &QbsProjectManagerPlugin::reparseCurrentProject); m_reparseQbsCtx = new QAction(tr("Reparse Qbs"), this); command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext); command->setAttribute(Core::Command::CA_Hide); mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); - connect(m_reparseQbsCtx, SIGNAL(triggered()), this, SLOT(reparseSelectedProject())); + connect(m_reparseQbsCtx, &QAction::triggered, + this, &QbsProjectManagerPlugin::reparseSelectedProject); m_buildFileCtx = new QAction(tr("Build"), this); command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext); command->setAttribute(Core::Command::CA_Hide); mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); - connect(m_buildFileCtx, SIGNAL(triggered()), this, SLOT(buildFileContextMenu())); + connect(m_buildFileCtx, &QAction::triggered, + this, &QbsProjectManagerPlugin::buildFileContextMenu); m_buildFile = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); @@ -149,13 +152,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * command->setDescription(m_buildFile->text()); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B"))); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); - connect(m_buildFile, SIGNAL(triggered()), this, SLOT(buildFile())); + connect(m_buildFile, &QAction::triggered, this, &QbsProjectManagerPlugin::buildFile); m_buildProductCtx = new QAction(tr("Build"), this); command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext); command->setAttribute(Core::Command::CA_Hide); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); - connect(m_buildProductCtx, SIGNAL(triggered()), this, SLOT(buildProductContextMenu())); + connect(m_buildProductCtx, &QAction::triggered, + this, &QbsProjectManagerPlugin::buildProductContextMenu); m_buildProduct = new Utils::ParameterAction(tr("Build Product"), tr("Build Product \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); @@ -165,13 +169,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * command->setDescription(m_buildFile->text()); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B"))); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); - connect(m_buildProduct, SIGNAL(triggered()), this, SLOT(buildProduct())); + connect(m_buildProduct, &QAction::triggered, this, &QbsProjectManagerPlugin::buildProduct); m_buildSubprojectCtx = new QAction(tr("Build"), this); command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext); command->setAttribute(Core::Command::CA_Hide); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); - connect(m_buildSubprojectCtx, SIGNAL(triggered()), this, SLOT(buildSubprojectContextMenu())); + connect(m_buildSubprojectCtx, &QAction::triggered, + this, &QbsProjectManagerPlugin::buildSubprojectContextMenu); m_buildSubproject = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""), Utils::ParameterAction::AlwaysEnabled, this); @@ -181,24 +186,24 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString * command->setDescription(m_buildFile->text()); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B"))); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); - connect(m_buildSubproject, SIGNAL(triggered()), this, SLOT(buildSubproject())); + connect(m_buildSubproject, &QAction::triggered, this, &QbsProjectManagerPlugin::buildSubproject); // Connect connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged, this, &QbsProjectManagerPlugin::nodeSelectionChanged); - connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), - this, SLOT(buildStateChanged(ProjectExplorer::Project*))); + connect(BuildManager::instance(), &BuildManager::buildStateChanged, + this, &QbsProjectManagerPlugin::buildStateChanged); - connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), - this, SLOT(currentEditorChanged())); + connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged, + this, &QbsProjectManagerPlugin::currentEditorChanged); - connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)), - this, SLOT(projectWasAdded(ProjectExplorer::Project*))); - connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)), - this, SLOT(projectWasRemoved())); - connect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), - this, SLOT(currentProjectWasChanged(ProjectExplorer::Project*))); + connect(SessionManager::instance(), &SessionManager::projectAdded, + this, &QbsProjectManagerPlugin::projectWasAdded); + connect(SessionManager::instance(), &SessionManager::projectRemoved, + this, &QbsProjectManagerPlugin::projectWasRemoved); + connect(SessionManager::instance(), &SessionManager::startupProjectChanged, + this, &QbsProjectManagerPlugin::currentProjectWasChanged); // Run initial setup routines updateContextActions(); @@ -218,8 +223,10 @@ void QbsProjectManagerPlugin::projectWasAdded(Project *project) if (!qbsProject) return; - connect(qbsProject, SIGNAL(projectParsingStarted()), this, SLOT(parsingStateChanged())); - connect(qbsProject, SIGNAL(projectParsingDone(bool)), this, SLOT(parsingStateChanged())); + connect(qbsProject, &QbsProject::projectParsingStarted, + this, &QbsProjectManagerPlugin::parsingStateChanged); + connect(qbsProject, &QbsProject::projectParsingDone, + this, &QbsProjectManagerPlugin::parsingStateChanged); } void QbsProjectManagerPlugin::currentProjectWasChanged(Project *project) diff --git a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h index eb54681c7df..89df5183441 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h +++ b/src/plugins/qbsprojectmanager/qbsprojectmanagerplugin.h @@ -58,7 +58,7 @@ public: void extensionsInitialized(); -private slots: +private: void projectWasAdded(ProjectExplorer::Project *project); void currentProjectWasChanged(ProjectExplorer::Project *project); void projectWasRemoved(); @@ -78,7 +78,6 @@ private slots: void reparseCurrentProject(); void reparseProject(QbsProject *project); -private: void updateContextActions(); void updateReparseQbsAction(); void updateBuildActions(); diff --git a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp index 4137eeed4cf..d823ddeb465 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectparser.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectparser.cpp @@ -111,12 +111,12 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env, m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0); - connect(m_qbsSetupProjectJob, SIGNAL(finished(bool,qbs::AbstractJob*)), - this, SLOT(handleQbsParsingDone(bool))); - connect(m_qbsSetupProjectJob, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), - this, SLOT(handleQbsParsingTaskSetup(QString,int))); - connect(m_qbsSetupProjectJob, SIGNAL(taskProgress(int,qbs::AbstractJob*)), - this, SLOT(handleQbsParsingProgress(int))); + connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished, + this, &QbsProjectParser::handleQbsParsingDone); + connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskStarted, + this, &QbsProjectParser::handleQbsParsingTaskSetup); + connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskProgress, + this, &QbsProjectParser::handleQbsParsingProgress); } void QbsProjectParser::cancel() diff --git a/src/plugins/qbsprojectmanager/qbsprojectparser.h b/src/plugins/qbsprojectmanager/qbsprojectparser.h index 82b45196d7b..0d140233f68 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectparser.h +++ b/src/plugins/qbsprojectmanager/qbsprojectparser.h @@ -57,12 +57,11 @@ signals: void done(bool success); void ruleExecutionDone(); -private slots: +private: void handleQbsParsingDone(bool success); void handleQbsParsingProgress(int progress); void handleQbsParsingTaskSetup(const QString &description, int maximumProgressValue); -private: QString pluginsBaseDirectory() const; QString resourcesBaseDirectory() const; QString libExecDirectory() const; diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h index 9351d30ac3d..51c2f2f384a 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h @@ -85,11 +85,9 @@ signals: protected: QbsRunConfiguration(ProjectExplorer::Target *parent, QbsRunConfiguration *source); -private slots: +private: void installStepChanged(); void installStepToBeRemoved(int pos); - -private: QString baseWorkingDirectory() const; QString defaultDisplayName(); qbs::InstallOptions installOptions() const; diff --git a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h index 233dc87f6cf..cac7462d75f 100644 --- a/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h +++ b/src/plugins/qmldesigner/components/componentcore/componentcore_constants.h @@ -72,6 +72,7 @@ const char resetPositionDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMen const char goIntoComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go into Component"); const char goToImplementationDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go to Implementation"); +const char addSignalHandlerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Add New Signal Handler"); const char moveToComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Move to Component"); const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set Id"); diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 57f1ca61da6..ea79b5c62e8 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -509,10 +509,11 @@ void DesignerActionManager::createDefaultDesignerActions() addDesignerAction(new ModelNodeAction (goIntoComponentDisplayName, rootCategory, priorityGoIntoComponent, &goIntoComponent, &selectionIsComponent)); addDesignerAction(new ModelNodeAction - (goToImplementationDisplayName, rootCategory, 42, &gotoImplementation, &singleSelectedAndUiFile, &singleSelectedAndUiFile)); + (goToImplementationDisplayName, rootCategory, 42, &goImplementation, &singleSelectedAndUiFile, &singleSelectedAndUiFile)); + addDesignerAction(new ModelNodeAction + (addSignalHandlerDisplayName, rootCategory, 42, &addNewSignalHandler, &singleSelectedAndUiFile, &singleSelectedAndUiFile)); addDesignerAction(new ModelNodeAction (moveToComponentDisplayName, rootCategory, 44, &moveToComponent, &singleSelection, &singleSelection)); - } void DesignerActionManager::addDesignerAction(ActionInterface *newAction) diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index 7d3c89a2ee4..a13c86cc7c9 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -637,7 +637,7 @@ static QStringList getSortedSignalNameList(const ModelNode &modelNode) return signalNames; } -void gotoImplementation(const SelectionContext &selectionState) +void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState, bool addAlwaysNewSlot) { ModelNode modelNode; if (selectionState.singleNodeIsSelected()) @@ -687,7 +687,7 @@ void gotoImplementation(const SelectionContext &selectionState) Core::ModeManager::activateMode(Core::Constants::MODE_EDIT); - if (usages.count() == 1) { + if (usages.count() > 0 && (addAlwaysNewSlot || usages.count()< 2)) { Core::EditorManager::openEditorAt(usages.first().path, usages.first().line, usages.first().col); if (!signalNames.isEmpty()) { @@ -782,6 +782,16 @@ void moveToComponent(const SelectionContext &selectionContext) selectionContext.view()->model()->rewriterView()->moveToComponent(modelNode); } +void goImplementation(const SelectionContext &selectionState) +{ + addSignalHandlerOrGotoImplementation(selectionState, false); +} + +void addNewSignalHandler(const SelectionContext &selectionState) +{ + addSignalHandlerOrGotoImplementation(selectionState, true); +} + } // namespace Mode } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h index 560d54d218b..4c447cef23b 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.h @@ -63,7 +63,9 @@ void layoutFlowPositioner(const SelectionContext &selectionState); void layoutRowLayout(const SelectionContext &selectionState); void layoutColumnLayout(const SelectionContext &selectionState); void layoutGridLayout(const SelectionContext &selectionState); -void gotoImplementation(const SelectionContext &selectionState); +void goImplementation(const SelectionContext &selectionState); +void addNewSignalHandler(const SelectionContext &selectionState); +void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState, bool addAlwaysNewSlot); void removeLayout(const SelectionContext &selectionContext); void removePositioner(const SelectionContext &selectionContext); void moveToComponent(const SelectionContext &selectionContext); diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index e2ac7235f13..a8dc05650bf 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -46,6 +46,8 @@ #include #include +#include + #include #include #include @@ -170,7 +172,7 @@ QList DesignDocument::qmlParseWarnings() const bool DesignDocument::hasQmlParseWarnings() const { - return m_rewriterView->warnings().isEmpty(); + return !m_rewriterView->warnings().isEmpty(); } QList DesignDocument::qmlParseErrors() const @@ -180,7 +182,7 @@ QList DesignDocument::qmlParseErrors() const bool DesignDocument::hasQmlParseErrors() const { - return m_rewriterView->errors().isEmpty(); + return !m_rewriterView->errors().isEmpty(); } QString DesignDocument::displayName() const @@ -243,12 +245,17 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit) this, SIGNAL(dirtyStateChanged(bool))); m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast(plainTextEdit()))); + + connect(m_documentTextModifier.data(), &TextModifier::textChanged, this, &DesignDocument::updateQrcFiles); + m_documentModel->setTextModifier(m_documentTextModifier.data()); m_inFileComponentTextModifier.reset(); updateFileName(Utils::FileName(), fileName()); + updateQrcFiles(); + m_documentLoaded = true; } @@ -277,6 +284,18 @@ void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textMod viewManager().attachViewsExceptRewriterAndComponetView(); } +void DesignDocument::updateQrcFiles() +{ + ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName()); + + if (currentProject) { + foreach (const QString &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) { + if (fileName.endsWith(".qrc")) + QmlJS::ModelManagerInterface::instance()->updateQrcFile(fileName); + } + } +} + void DesignDocument::changeToSubComponent(const ModelNode &componentNode) { if (QmlDesignerPlugin::instance()->currentDesignDocument() != this) diff --git a/src/plugins/qmldesigner/components/integration/designdocument.h b/src/plugins/qmldesigner/components/integration/designdocument.h index 8e8e18ecb4f..e7aff639533 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.h +++ b/src/plugins/qmldesigner/components/integration/designdocument.h @@ -124,6 +124,8 @@ private slots: private: // functions void changeToInFileComponentModel(ComponentTextModifier *textModifer); + void updateQrcFiles(); + QWidget *centralWidget() const; QString pathToQt() const; diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp index 67a6840d13e..426f1560bc1 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp @@ -40,6 +40,8 @@ #include #include +#include + namespace QmlDesigner { namespace Internal { @@ -565,6 +567,9 @@ private: const CppComponentValue *getNearestCppComponentValue() const; QString fullQualifiedImportAliasType() const; + void ensureProperties() const; + void initialiseProperties(); + TypeName m_qualfiedTypeName; int m_majorVersion; int m_minorVersion; @@ -585,6 +590,8 @@ private: QPointer m_model; static QHash m_nodeMetaInfoCache; + const ObjectValue *m_objectValue = nullptr; + bool m_propertiesSetup = false; }; QHash NodeMetaInfoPrivate::m_nodeMetaInfoCache; @@ -596,16 +603,21 @@ bool NodeMetaInfoPrivate::isFileComponent() const PropertyNameList NodeMetaInfoPrivate::properties() const { + ensureProperties(); + return m_properties; } PropertyNameList NodeMetaInfoPrivate::localProperties() const { + ensureProperties(); + return m_localProperties; } PropertyNameList NodeMetaInfoPrivate::signalNames() const { + ensureProperties(); return m_signals; } @@ -670,12 +682,10 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i m_majorVersion = cppObjectValue->componentVersion().majorVersion(); m_minorVersion = cppObjectValue->componentVersion().minorVersion(); } - setupPropertyInfo(getTypes(cppObjectValue, context())); - setupLocalPropertyInfo(getTypes(cppObjectValue, context(), true)); + m_objectValue = cppObjectValue; m_defaultPropertyName = cppObjectValue->defaultPropertyName().toUtf8(); m_isValid = true; setupPrototypes(); - m_signals = getSignals(cppObjectValue, context()); } else { const ObjectValue *objectValue = getObjectValue(); if (objectValue) { @@ -699,12 +709,10 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i m_minorVersion = importInfo.version().minorVersion(); } } - setupPropertyInfo(getTypes(objectValue, context())); - setupLocalPropertyInfo(getTypes(objectValue, context(), true)); + m_objectValue = objectValue; m_defaultPropertyName = context()->defaultPropertyName(objectValue).toUtf8(); m_isValid = true; setupPrototypes(); - m_signals = getSignals(objectValue, context()); } } } @@ -803,6 +811,8 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const PropertyName &propertyName) c if (!isValid()) return false; + ensureProperties(); + if (propertyName.contains('.')) { const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); @@ -834,6 +844,8 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const if (!isValid()) return false; + ensureProperties(); + if (propertyName.contains('.')) { const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); @@ -861,6 +873,8 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) co if (!isValid()) return false; + ensureProperties(); + if (propertyName.contains('.')) { const PropertyNameList parts = propertyName.split('.'); const PropertyName objectName = parts.first(); @@ -888,6 +902,8 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const if (!isValid()) return false; + ensureProperties(); + if (propertyType(propertyName).contains("Qt::")) return true; @@ -918,6 +934,8 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName) if (!isValid()) return QString(); + ensureProperties(); + if (propertyType(propertyName).contains("Qt::")) return QStringLiteral("Qt"); @@ -1262,6 +1280,29 @@ QString NodeMetaInfoPrivate::fullQualifiedImportAliasType() const return QString::fromUtf8(m_qualfiedTypeName); } +void NodeMetaInfoPrivate::ensureProperties() const +{ + if (m_propertiesSetup) + return; + + const_cast(this)->initialiseProperties(); +} + +void NodeMetaInfoPrivate::initialiseProperties() +{ + if (!isValid()) + return; + + m_propertiesSetup = true; + + QTC_ASSERT(m_objectValue, qDebug() << qualfiedTypeName(); return); + + setupPropertyInfo(getTypes(m_objectValue, context())); + setupLocalPropertyInfo(getTypes(m_objectValue, context(), true)); + + m_signals = getSignals(m_objectValue, context()); +} + } //namespace Internal NodeMetaInfo::NodeMetaInfo() : m_privateData(new Internal::NodeMetaInfoPrivate()) diff --git a/src/plugins/qmldesigner/designercore/rewritertransaction.cpp b/src/plugins/qmldesigner/designercore/rewritertransaction.cpp index 7dbc5463772..755b667a063 100644 --- a/src/plugins/qmldesigner/designercore/rewritertransaction.cpp +++ b/src/plugins/qmldesigner/designercore/rewritertransaction.cpp @@ -27,6 +27,8 @@ #include #include +#include + #ifndef QMLDESIGNER_TEST #include #include @@ -82,13 +84,22 @@ void RewriterTransaction::commit() { if (m_valid) { m_valid = false; - bool oldSemanticChecks = view()->rewriterView()->checkSemanticErrors(); - if (m_ignoreSemanticChecks) - view()->rewriterView()->setCheckSemanticErrors(false); + + RewriterView *rewriterView = view()->rewriterView(); + + QTC_ASSERT(rewriterView, qWarning() << Q_FUNC_INFO << "No rewriter attached"); + + bool oldSemanticChecks = false; + if (rewriterView) { + oldSemanticChecks = rewriterView->checkSemanticErrors(); + if (m_ignoreSemanticChecks) + rewriterView->setCheckSemanticErrors(false); + } view()->emitRewriterEndTransaction(); - view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks); + if (rewriterView) + view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks); if (m_activeIdentifier) { qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber; diff --git a/src/plugins/qmljseditor/qmljsoutlinetreeview.cpp b/src/plugins/qmljseditor/qmljsoutlinetreeview.cpp index f20715ad506..d89b84a3b58 100644 --- a/src/plugins/qmljseditor/qmljsoutlinetreeview.cpp +++ b/src/plugins/qmljseditor/qmljsoutlinetreeview.cpp @@ -57,8 +57,10 @@ void QmlJSOutlineTreeView::contextMenuEvent(QContextMenuEvent *event) QMenu contextMenu; - contextMenu.addAction(tr("Expand All"), this, [this] { expandAll(); }); - contextMenu.addAction(tr("Collapse All"), this, [this] { collapseAllExceptRoot(); }); + connect(contextMenu.addAction(tr("Expand All")), &QAction::triggered, + this, &QmlJSOutlineTreeView::expandAll); + connect(contextMenu.addAction(tr("Collapse All")), &QAction::triggered, + this, &QmlJSOutlineTreeView::collapseAllExceptRoot); contextMenu.exec(event->globalPos()); diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 56c13bd8206..8f5ad2855a3 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -341,8 +341,14 @@ void BaseQtVersion::setupExpander() [this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_DEMOS"); }); m_expander.registerVariable("Qt:QMAKE_MKSPECS", - QtKitInformation::tr("The current Qt version's default mkspecs."), + QtKitInformation::tr("The current Qt version's default mkspecs (Qt 4)."), [this] { return qmakeProperty(m_versionInfo, "QMAKE_MKSPECS"); }); + m_expander.registerVariable("Qt:QMAKE_SPEC", + QtKitInformation::tr("The current Qt version's default mkspec (Qt 5; host system)"), + [this] { return qmakeProperty(m_versionInfo, "QMAKE_SPEC"); }); + m_expander.registerVariable("Qt:QMAKE_XSPEC", + QtKitInformation::tr("The current Qt version's default mkspec (Qt 5; target system)."), + [this] { return qmakeProperty(m_versionInfo, "QMAKE_XSPEC"); }); m_expander.registerVariable("Qt:QMAKE_VERSION", QtKitInformation::tr("The current Qt's qmake version."), diff --git a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp index 5188b2278cc..7b5c93e5000 100644 --- a/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp +++ b/tests/auto/qml/qmldesigner/coretests/tst_testcore.cpp @@ -149,7 +149,7 @@ static QmlDesigner::Model* createModel(const QString &typeName, int major = 2, i QmlDesigner::Model *model = QmlDesigner::Model::create(typeName.toUtf8(), major, minor, metaInfoPropxyModel); QPlainTextEdit *textEdit = new QPlainTextEdit; - QObject::connect(model, SIGNAL(destroyed()), textEdit, SLOT(deleteLater())); + QObject::connect(model, &QObject::destroyed, textEdit, &QObject::deleteLater); textEdit->setPlainText(QString("import %1 %3.%4; %2{}").arg(typeName.split(".").first()) .arg(typeName.split(".").last()) .arg(major) diff --git a/tests/auto/qml/qmldesigner/data/qwidget/test.qml b/tests/auto/qml/qmldesigner/data/qwidget/test.qml deleted file mode 100644 index 17e0331e4bd..00000000000 --- a/tests/auto/qml/qmldesigner/data/qwidget/test.qml +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - - - - - PushButton - - - ... - - - PushButton - - - PushButton - - - PushButton - - - PushButton - - - PushButton - - - PushButton - - diff --git a/tests/auto/qml/qmldesigner/data/testfiles.qrc b/tests/auto/qml/qmldesigner/data/testfiles.qrc index 15662d0986c..b96ba33de42 100644 --- a/tests/auto/qml/qmldesigner/data/testfiles.qrc +++ b/tests/auto/qml/qmldesigner/data/testfiles.qrc @@ -4,7 +4,6 @@ fx/empty.qml fx/helloworld.qml fx/properties.qml - qwidget/test.qml fx/topitem.qml fx/subitems/SubItem.qml fx/states.qml diff --git a/tests/auto/valgrind/callgrind/modeltest.cpp b/tests/auto/valgrind/callgrind/modeltest.cpp index c844f12d307..94c0fd2dde3 100644 --- a/tests/auto/valgrind/callgrind/modeltest.cpp +++ b/tests/auto/valgrind/callgrind/modeltest.cpp @@ -85,8 +85,8 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler) m_format->addItem("absolute", CostDelegate::FormatAbsolute); m_format->addItem("relative", CostDelegate::FormatRelative); m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent); - connect(m_format, SIGNAL(activated(int)), - this, SLOT(formatChanged(int))); + connect(m_format, static_cast(&QComboBox::activated), + this, &ModelTestWidget::formatChanged); h->addWidget(m_format); QDoubleSpinBox *minimumCost = new QDoubleSpinBox; @@ -94,8 +94,8 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler) minimumCost->setRange(0, 1); minimumCost->setDecimals(4); minimumCost->setSingleStep(0.01); - connect(minimumCost, SIGNAL(valueChanged(double)), - m_handler->proxyModel(), SLOT(setMinimumInclusiveCostRatio(double))); + connect(minimumCost, &QDoubleSpinBox::valueChanged, + m_handler->proxyModel(), &DataProxyModel::setMinimumInclusiveCostRatio); minimumCost->setValue(0.0001); h->addWidget(minimumCost); diff --git a/tests/manual/debugger/qquick1/myplugin/mytype.cpp b/tests/manual/debugger/qquick1/myplugin/mytype.cpp index d8e52755713..10127323b6e 100644 --- a/tests/manual/debugger/qquick1/myplugin/mytype.cpp +++ b/tests/manual/debugger/qquick1/myplugin/mytype.cpp @@ -10,7 +10,7 @@ MyType::MyType(QObject *parent) updateTimerText(); m_timer = new QTimer(this); m_timer->setInterval(1000); - connect(m_timer, SIGNAL(timeout()), SLOT(updateTimerText())); + connect(m_timer, &QTimer::timeout, this, &MyType::updateTimerText); m_timer->start(); } diff --git a/tests/manual/debugger/qquick1/myplugin/mytype.h b/tests/manual/debugger/qquick1/myplugin/mytype.h index 30c90c9ef6c..e833fe81b86 100644 --- a/tests/manual/debugger/qquick1/myplugin/mytype.h +++ b/tests/manual/debugger/qquick1/myplugin/mytype.h @@ -20,10 +20,9 @@ public: signals: void timeChanged(const QString &newText); -private slots: +private: void updateTimerText(); -private: QString m_timeText; QTimer *m_timer; diff --git a/tests/manual/debugger/qquick2/myplugin/mytype.cpp b/tests/manual/debugger/qquick2/myplugin/mytype.cpp index f3232af8703..f36105528c3 100644 --- a/tests/manual/debugger/qquick2/myplugin/mytype.cpp +++ b/tests/manual/debugger/qquick2/myplugin/mytype.cpp @@ -10,7 +10,7 @@ MyType::MyType(QObject *parent) updateTimerText(); m_timer = new QTimer(this); m_timer->setInterval(1000); - connect(m_timer, SIGNAL(timeout()), SLOT(updateTimerText())); + connect(m_timer, &QTimer::timeout, this, &MyType::updateTimerText); m_timer->start(); } diff --git a/tests/manual/debugger/qquick2/myplugin/mytype.h b/tests/manual/debugger/qquick2/myplugin/mytype.h index 30c90c9ef6c..e833fe81b86 100644 --- a/tests/manual/debugger/qquick2/myplugin/mytype.h +++ b/tests/manual/debugger/qquick2/myplugin/mytype.h @@ -20,10 +20,9 @@ public: signals: void timeChanged(const QString &newText); -private slots: +private: void updateTimerText(); -private: QString m_timeText; QTimer *m_timer; diff --git a/tests/manual/debugger/simple/simple_test_app.cpp b/tests/manual/debugger/simple/simple_test_app.cpp index 695de846c7f..20f74e347c8 100644 --- a/tests/manual/debugger/simple/simple_test_app.cpp +++ b/tests/manual/debugger/simple/simple_test_app.cpp @@ -1792,10 +1792,10 @@ namespace qobject { parent.setObjectName("A Parent"); QObject child(&parent); child.setObjectName("A Child"); - QObject::connect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater())); - QObject::connect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater())); - QObject::disconnect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater())); - QObject::disconnect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater())); + QObject::connect(&child, &QObject::destroyed, &parent, &QObject::deleteLater); + QObject::connect(&child, &QObject::destroyed, &child, &QObject::deleteLater); + QObject::disconnect(&child, &QObject::destroyed, &parent, &QObject::deleteLater); + QObject::disconnect(&child, &QObject::destroyed, &child, &QObject::deleteLater); child.setObjectName("A renamed Child"); BREAK_HERE; // Check child "A renamed Child" QObject. @@ -1889,11 +1889,11 @@ namespace qobject { QObject ob1; ob1.setObjectName("Another Object"); - QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); - QObject::connect(&ob1, SIGNAL(destroyed()), &ob, SLOT(deleteLater())); + QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater); + QObject::connect(&ob1, &QObject::destroyed, &ob, &QObject::deleteLater); BREAK_HERE; - QObject::disconnect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); - QObject::disconnect(&ob1, SIGNAL(destroyed()), &ob, SLOT(deleteLater())); + QObject::disconnect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater); + QObject::disconnect(&ob1, &QObject::destroyed, &ob, &QObject::deleteLater); dummyStatement(&ob, &ob1); #endif } @@ -1930,7 +1930,6 @@ namespace qobject { Q_OBJECT public: Receiver() { setObjectName("Receiver"); } - public slots: void aSlot() { QObject *s = sender(); if (s) { @@ -1945,7 +1944,7 @@ namespace qobject { { Sender sender; Receiver receiver; - QObject::connect(&sender, SIGNAL(aSignal()), &receiver, SLOT(aSlot())); + QObject::connect(&sender, &Sender::aSignal, &receiver, &Receiver::aSlot); // Break here. // Single step through signal emission. sender.doEmit(); diff --git a/tests/manual/debugger/spacy path/app with space.cpp b/tests/manual/debugger/spacy path/app with space.cpp index af7226bbc37..1dfa82c0efd 100644 --- a/tests/manual/debugger/spacy path/app with space.cpp +++ b/tests/manual/debugger/spacy path/app with space.cpp @@ -222,8 +222,8 @@ void testObject(int &argc, char *argv[]) QObject ob1; ob1.setObjectName("Another Object"); - QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); - QObject::connect(&app, SIGNAL(lastWindowClosed()), &ob, SLOT(deleteLater())); + QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater); + QObject::connect(&app, &QGuiApplication::lastWindowClosed, &ob, &QObject::deleteLater); QList obs; obs.append(&ob); diff --git a/tests/manual/debugger/spacy-file/app with space.cpp b/tests/manual/debugger/spacy-file/app with space.cpp index af7226bbc37..1dfa82c0efd 100644 --- a/tests/manual/debugger/spacy-file/app with space.cpp +++ b/tests/manual/debugger/spacy-file/app with space.cpp @@ -222,8 +222,8 @@ void testObject(int &argc, char *argv[]) QObject ob1; ob1.setObjectName("Another Object"); - QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); - QObject::connect(&app, SIGNAL(lastWindowClosed()), &ob, SLOT(deleteLater())); + QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater); + QObject::connect(&app, &QGuiApplication::lastWindowClosed, &ob, &QObject::deleteLater); QList obs; obs.append(&ob); diff --git a/tests/manual/fakevim/main.cpp b/tests/manual/fakevim/main.cpp index fa561381b73..4250676dea2 100644 --- a/tests/manual/fakevim/main.cpp +++ b/tests/manual/fakevim/main.cpp @@ -84,7 +84,6 @@ public: : QObject(parent), m_widget(widget), m_mainWindow(mw) {} -public slots: void changeSelection(const QList &s) { if (QPlainTextEdit *ed = qobject_cast(m_widget)) @@ -230,19 +229,18 @@ void readFile(FakeVimHandler &handler, const QString &editFileName) void connectSignals(FakeVimHandler &handler, Proxy &proxy) { - QObject::connect(&handler, SIGNAL(commandBufferChanged(QString,int,int,int,QObject*)), - &proxy, SLOT(changeStatusMessage(QString,int))); - QObject::connect(&handler, - SIGNAL(selectionChanged(QList)), - &proxy, SLOT(changeSelection(QList))); - QObject::connect(&handler, SIGNAL(extraInformationChanged(QString)), - &proxy, SLOT(changeExtraInformation(QString))); - QObject::connect(&handler, SIGNAL(statusDataChanged(QString)), - &proxy, SLOT(changeStatusData(QString))); - QObject::connect(&handler, SIGNAL(highlightMatches(QString)), - &proxy, SLOT(highlightMatches(QString))); - QObject::connect(&handler, SIGNAL(handleExCommandRequested(bool*,ExCommand)), - &proxy, SLOT(handleExCommand(bool*,ExCommand))); + QObject::connect(&handler, &FakeVimHandler::commandBufferChanged, + &proxy, &Proxy::changeStatusMessage); + QObject::connect(&handler, &FakeVimHandler::selectionChanged, + &proxy, &Proxy::changeSelection); + QObject::connect(&handler, &FakeVimHandler::extraInformationChanged, + &proxy, &Proxy::changeExtraInformation); + QObject::connect(&handler, &FakeVimHandler::statusDataChanged, + &proxy, &Proxy::changeStatusData); + QObject::connect(&handler, &FakeVimHandler::highlightMatches, + &proxy, &Proxy::highlightMatches); + QObject::connect(&handler, &FakeVimHandler::handleExCommandRequested, + &proxy, &Proxy::handleExCommand); } int main(int argc, char *argv[]) diff --git a/tests/manual/pluginview/plugindialog.h b/tests/manual/pluginview/plugindialog.h index 6206f3556d5..27d0eea7951 100644 --- a/tests/manual/pluginview/plugindialog.h +++ b/tests/manual/pluginview/plugindialog.h @@ -38,12 +38,11 @@ class PluginDialog : public QWidget public: PluginDialog(); -private slots: +private: void updateButtons(); void openDetails(ExtensionSystem::PluginSpec *spec = nullptr); void openErrorDetails(); -private: ExtensionSystem::PluginView *m_view; QPushButton *m_detailsButton; diff --git a/tests/manual/process/mainwindow.cpp b/tests/manual/process/mainwindow.cpp index a3ca20196d4..bd89d935cf8 100644 --- a/tests/manual/process/mainwindow.cpp +++ b/tests/manual/process/mainwindow.cpp @@ -37,7 +37,7 @@ MainWindow::MainWindow(QWidget *parent) : m_logWindow(new QPlainTextEdit) { setCentralWidget(m_logWindow); - QTimer::singleShot(200, this, SLOT(test())); + QTimer::singleShot(200, this, &MainWindow::test); } void MainWindow::append(const QString &s) @@ -54,8 +54,8 @@ void MainWindow::test() Utils::SynchronousProcess process; process.setTimeoutS(2); qDebug() << "Async: " << cmd << args; - connect(&process, SIGNAL(stdOut(QString,bool)), this, SLOT(append(QString))); - connect(&process, SIGNAL(stdErr(QString,bool)), this, SLOT(append(QString))); + connect(&process, &Utils::SynchronousProcess::stdOut, this, &MainWindow::append); + connect(&process, &Utils::SynchronousProcess::stdErr, this, &MainWindow::append); const Utils::SynchronousProcessResponse resp = process.run(cmd, args); qDebug() << resp; } diff --git a/tests/manual/process/mainwindow.h b/tests/manual/process/mainwindow.h index 6dfe3874000..3171b841f8b 100644 --- a/tests/manual/process/mainwindow.h +++ b/tests/manual/process/mainwindow.h @@ -37,9 +37,6 @@ Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); -signals: - -public slots: void test(); void append(const QString &s); diff --git a/tests/manual/ssh/errorhandling/main.cpp b/tests/manual/ssh/errorhandling/main.cpp index 9eb44277c9e..7aab5d0bc18 100644 --- a/tests/manual/ssh/errorhandling/main.cpp +++ b/tests/manual/ssh/errorhandling/main.cpp @@ -110,7 +110,7 @@ public: delete m_connection; } -private slots: +private: void handleConnected() { qDebug("Error: Received unexpected connected() signal."); @@ -162,7 +162,6 @@ private slots: qDebug("Error: The following test timed out: %s", testItem.description); } -private: void runNextTest() { if (m_connection) { @@ -170,10 +169,10 @@ private: delete m_connection; } m_connection = new SshConnection(m_testSet.first().params); - connect(m_connection, SIGNAL(connected()), SLOT(handleConnected())); - connect(m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected())); - connect(m_connection, SIGNAL(dataAvailable(QString)), SLOT(handleDataAvailable(QString))); - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleError(QSsh::SshError))); + connect(m_connection, &SshConnection::connected, this, &Test::handleConnected); + connect(m_connection, &SshConnection::disconnected, this, &Test::handleDisconnected); + connect(m_connection, &SshConnection::dataAvailable, this, &Test::handleDataAvailable); + connect(m_connection, &SshConnection::error, this, &Test::handleError); const TestItem &nextItem = m_testSet.first(); m_timeoutTimer.stop(); m_timeoutTimer.setInterval(qMax(10000, nextItem.params.timeout * 1000)); diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp index 44c90470051..062a974282b 100644 --- a/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp +++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.cpp @@ -45,7 +45,7 @@ RemoteProcessTest::RemoteProcessTest(const SshConnectionParameters ¶ms) m_state(Inactive) { m_timeoutTimer->setInterval(5000); - connect(m_timeoutTimer, SIGNAL(timeout()), SLOT(handleTimeout())); + connect(m_timeoutTimer, &QTimer::timeout, this, &RemoteProcessTest::handleTimeout); } RemoteProcessTest::~RemoteProcessTest() @@ -55,14 +55,16 @@ RemoteProcessTest::~RemoteProcessTest() void RemoteProcessTest::run() { - connect(m_remoteRunner, SIGNAL(connectionError()), - SLOT(handleConnectionError())); - connect(m_remoteRunner, SIGNAL(processStarted()), - SLOT(handleProcessStarted())); - connect(m_remoteRunner, SIGNAL(readyReadStandardOutput()), SLOT(handleProcessStdout())); - connect(m_remoteRunner, SIGNAL(readyReadStandardError()), SLOT(handleProcessStderr())); - connect(m_remoteRunner, SIGNAL(processClosed(int)), - SLOT(handleProcessClosed(int))); + connect(m_remoteRunner, &SshRemoteProcessRunner::connectionError, + this, &RemoteProcessTest::handleConnectionError); + connect(m_remoteRunner, &SshRemoteProcessRunner::processStarted, + this, &RemoteProcessTest::handleProcessStarted); + connect(m_remoteRunner, &SshRemoteProcessRunner::readyReadStandardOutput, + this, &RemoteProcessTest::handleProcessStdout); + connect(m_remoteRunner, &SshRemoteProcessRunner::readyReadStandardError, + this, &RemoteProcessTest::handleProcessStderr); + connect(m_remoteRunner, &SshRemoteProcessRunner::processClosed, + this, &RemoteProcessTest::handleProcessClosed); std::cout << "Testing successful remote process... " << std::flush; m_state = TestingSuccess; @@ -91,7 +93,8 @@ void RemoteProcessTest::handleProcessStarted() SshRemoteProcessRunner * const killer = new SshRemoteProcessRunner(this); killer->run("pkill -9 sleep", m_sshParams); } else if (m_state == TestingIoDevice) { - connect(m_catProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead())); + connect(m_catProcess.data(), &QIODevice::readyRead, + this, &RemoteProcessTest::handleReadyRead); m_textStream = new QTextStream(m_catProcess.data()); *m_textStream << testString(); m_textStream->flush(); @@ -209,9 +212,10 @@ void RemoteProcessTest::handleProcessClosed(int exitStatus) std::cout << "Ok.\nTesting I/O device functionality... " << std::flush; m_state = TestingIoDevice; m_sshConnection = new SshConnection(m_sshParams); - connect(m_sshConnection, SIGNAL(connected()), SLOT(handleConnected())); - connect(m_sshConnection, SIGNAL(error(QSsh::SshError)), - SLOT(handleConnectionError())); + connect(m_sshConnection, &SshConnection::connected, + this, &RemoteProcessTest::handleConnected); + connect(m_sshConnection, &SshConnection::error, + this, &RemoteProcessTest::handleConnectionError); m_sshConnection->connectToHost(); m_timeoutTimer->start(); break; @@ -280,8 +284,10 @@ void RemoteProcessTest::handleConnected() Q_ASSERT(m_state == TestingIoDevice); m_catProcess = m_sshConnection->createRemoteProcess(QString::fromLatin1("/bin/cat").toUtf8()); - connect(m_catProcess.data(), SIGNAL(started()), SLOT(handleProcessStarted())); - connect(m_catProcess.data(), SIGNAL(closed(int)), SLOT(handleProcessClosed(int))); + connect(m_catProcess.data(), &SshRemoteProcess::started, + this, &RemoteProcessTest::handleProcessStarted); + connect(m_catProcess.data(), &SshRemoteProcess::closed, + this, &RemoteProcessTest::handleProcessClosed); m_started = false; m_timeoutTimer->start(); m_catProcess->start(); @@ -347,11 +353,14 @@ void RemoteProcessTest::handleSuccessfulIoTest() m_remoteStderr.clear(); m_echoProcess = m_sshConnection->createRemoteProcess("printf " + StderrOutput + " >&2"); m_echoProcess->setReadChannel(QProcess::StandardError); - connect(m_echoProcess.data(), SIGNAL(started()), SLOT(handleProcessStarted())); - connect(m_echoProcess.data(), SIGNAL(closed(int)), SLOT(handleProcessClosed(int))); - connect(m_echoProcess.data(), SIGNAL(readyRead()), SLOT(handleReadyRead())); - connect(m_echoProcess.data(), SIGNAL(readyReadStandardError()), - SLOT(handleReadyReadStderr())); + connect(m_echoProcess.data(), &SshRemoteProcess::started, + this, &RemoteProcessTest::handleProcessStarted); + connect(m_echoProcess.data(), &SshRemoteProcess::closed, + this, &RemoteProcessTest::handleProcessClosed); + connect(m_echoProcess.data(), &QIODevice::readyRead, + this, &RemoteProcessTest::handleReadyRead); + connect(m_echoProcess.data(), &SshRemoteProcess::readyReadStandardError, + this, &RemoteProcessTest::handleReadyReadStderr); m_echoProcess->start(); m_timeoutTimer->start(); } diff --git a/tests/manual/ssh/remoteprocess/remoteprocesstest.h b/tests/manual/ssh/remoteprocess/remoteprocesstest.h index 44c02169e78..b3c8ebc3e3f 100644 --- a/tests/manual/ssh/remoteprocess/remoteprocesstest.h +++ b/tests/manual/ssh/remoteprocess/remoteprocesstest.h @@ -40,7 +40,12 @@ public: ~RemoteProcessTest(); void run(); -private slots: +private: + enum State { + Inactive, TestingSuccess, TestingFailure, TestingCrash, TestingTerminal, TestingIoDevice, + TestingProcessChannels + }; + void handleConnectionError(); void handleProcessStarted(); void handleProcessStdout(); @@ -52,12 +57,6 @@ private slots: void handleReadyReadStderr(); void handleConnected(); -private: - enum State { - Inactive, TestingSuccess, TestingFailure, TestingCrash, TestingTerminal, TestingIoDevice, - TestingProcessChannels - }; - QString testString() const; void handleSuccessfulCrashTest(); void handleSuccessfulIoTest(); diff --git a/tests/manual/ssh/sftp/sftptest.cpp b/tests/manual/ssh/sftp/sftptest.cpp index 007f261822b..40c3157fd0d 100644 --- a/tests/manual/ssh/sftp/sftptest.cpp +++ b/tests/manual/ssh/sftp/sftptest.cpp @@ -56,9 +56,9 @@ SftpTest::~SftpTest() void SftpTest::run() { m_connection = new SshConnection(m_parameters.sshParams); - connect(m_connection, SIGNAL(connected()), SLOT(handleConnected())); - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleError())); - connect(m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected())); + connect(m_connection, &SshConnection::connected, this, &SftpTest::handleConnected); + connect(m_connection, &SshConnection::error, this, &SftpTest::handleError); + connect(m_connection, &SshConnection::disconnected, this, &SftpTest::handleDisconnected); std::cout << "Connecting to host '" << qPrintable(m_parameters.sshParams.host) << "'..." << std::endl; m_state = Connecting; @@ -74,17 +74,17 @@ void SftpTest::handleConnected() } else { std::cout << "Connected. Initializing SFTP channel..." << std::endl; m_channel = m_connection->createSftpChannel(); - connect(m_channel.data(), SIGNAL(initialized()), this, - SLOT(handleChannelInitialized())); - connect(m_channel.data(), SIGNAL(channelError(QString)), this, - SLOT(handleChannelInitializationFailure(QString))); - connect(m_channel.data(), SIGNAL(finished(QSsh::SftpJobId,QString)), - this, SLOT(handleJobFinished(QSsh::SftpJobId,QString))); - connect(m_channel.data(), - SIGNAL(fileInfoAvailable(QSsh::SftpJobId,QList)), - SLOT(handleFileInfo(QSsh::SftpJobId,QList))); - connect(m_channel.data(), SIGNAL(closed()), this, - SLOT(handleChannelClosed())); + connect(m_channel.data(), &SftpChannel::initialized, + this, &SftpTest::handleChannelInitialized); + connect(m_channel.data(), &SftpChannel::channelError, + this, &SftpTest::handleChannelInitializationFailure); + connect(m_channel.data(), &SftpChannel::finished, + this, static_cast( + &SftpTest::handleJobFinished)); + connect(m_channel.data(), &SftpChannel::fileInfoAvailable, + this, &SftpTest::handleFileInfo); + connect(m_channel.data(), &SftpChannel::closed, + this, &SftpTest::handleChannelClosed); m_state = InitializingChannel; m_channel->initialize(); } diff --git a/tests/manual/ssh/sftp/sftptest.h b/tests/manual/ssh/sftp/sftptest.h index 1b984c41544..97b13217eeb 100644 --- a/tests/manual/ssh/sftp/sftptest.h +++ b/tests/manual/ssh/sftp/sftptest.h @@ -46,16 +46,6 @@ public: ~SftpTest(); void run(); -private slots: - void handleConnected(); - void handleError(); - void handleDisconnected(); - void handleChannelInitialized(); - void handleChannelInitializationFailure(const QString &reason); - void handleJobFinished(QSsh::SftpJobId job, const QString &error); - void handleFileInfo(QSsh::SftpJobId job, const QList &fileInfoList); - void handleChannelClosed(); - private: typedef QHash JobMap; typedef QSharedPointer FilePtr; @@ -65,6 +55,15 @@ private: CheckingDirAttributes, CheckingDirContents, RemovingDir, ChannelClosing, Disconnecting }; + void handleConnected(); + void handleError(); + void handleDisconnected(); + void handleChannelInitialized(); + void handleChannelInitializationFailure(const QString &reason); + void handleJobFinished(QSsh::SftpJobId job, const QString &error); + void handleFileInfo(QSsh::SftpJobId job, const QList &fileInfoList); + void handleChannelClosed(); + void removeFile(const FilePtr &filePtr, bool remoteToo); void removeFiles(bool remoteToo); QString cmpFileName(const QString &localFileName) const; diff --git a/tests/manual/ssh/sftpfsmodel/window.cpp b/tests/manual/ssh/sftpfsmodel/window.cpp index fdbfab0f45b..79a05fad38a 100644 --- a/tests/manual/ssh/sftpfsmodel/window.cpp +++ b/tests/manual/ssh/sftpfsmodel/window.cpp @@ -44,8 +44,8 @@ using namespace QSsh; SftpFsWindow::SftpFsWindow(QWidget *parent) : QDialog(parent), m_ui(new Ui::Window) { m_ui->setupUi(this); - connect(m_ui->connectButton, SIGNAL(clicked()), SLOT(connectToHost())); - connect(m_ui->downloadButton, SIGNAL(clicked()), SLOT(downloadFile())); + connect(m_ui->connectButton, &QAbstractButton::clicked, this, &SftpFsWindow::connectToHost); + connect(m_ui->downloadButton, &QAbstractButton::clicked, this, &SftpFsWindow::downloadFile); } SftpFsWindow::~SftpFsWindow() @@ -67,11 +67,12 @@ void SftpFsWindow::connectToHost() m_fsModel = new SftpFileSystemModel(this); if (m_ui->useModelTesterCheckBox->isChecked()) new ModelTest(m_fsModel, this); - connect(m_fsModel, SIGNAL(sftpOperationFailed(QString)), - SLOT(handleSftpOperationFailed(QString))); - connect(m_fsModel, SIGNAL(connectionError(QString)), SLOT(handleConnectionError(QString))); - connect(m_fsModel, SIGNAL(sftpOperationFinished(QSsh::SftpJobId,QString)), - SLOT(handleSftpOperationFinished(QSsh::SftpJobId,QString))); + connect(m_fsModel, &SftpFileSystemModel::sftpOperationFailed, + this, &SftpFsWindow::handleSftpOperationFailed); + connect(m_fsModel, &SftpFileSystemModel::connectionError, + this, &SftpFsWindow::handleConnectionError); + connect(m_fsModel, &SftpFileSystemModel::sftpOperationFinished, + this, &SftpFsWindow::handleSftpOperationFinished); m_fsModel->setSshConnection(sshParams); m_ui->fsView->setModel(m_fsModel); } diff --git a/tests/manual/ssh/sftpfsmodel/window.h b/tests/manual/ssh/sftpfsmodel/window.h index 6b8dde1329e..d3ba03c1345 100644 --- a/tests/manual/ssh/sftpfsmodel/window.h +++ b/tests/manual/ssh/sftpfsmodel/window.h @@ -40,14 +40,13 @@ public: SftpFsWindow(QWidget *parent = 0); ~SftpFsWindow(); -private slots: +private: void connectToHost(); void downloadFile(); void handleConnectionError(const QString &errorMessage); void handleSftpOperationFailed(const QString &errorMessage); void handleSftpOperationFinished(QSsh::SftpJobId jobId, const QString &error); -private: QSsh::SftpFileSystemModel *m_fsModel; Ui::Window *m_ui; }; diff --git a/tests/manual/ssh/shell/shell.cpp b/tests/manual/ssh/shell/shell.cpp index 48f3f18bf75..c3997eed647 100644 --- a/tests/manual/ssh/shell/shell.cpp +++ b/tests/manual/ssh/shell/shell.cpp @@ -42,9 +42,9 @@ Shell::Shell(const SshConnectionParameters ¶meters, QObject *parent) m_connection(new SshConnection(parameters)), m_stdin(new QFile(this)) { - connect(m_connection, SIGNAL(connected()), SLOT(handleConnected())); - connect(m_connection, SIGNAL(dataAvailable(QString)), SLOT(handleShellMessage(QString))); - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); + connect(m_connection, &SshConnection::connected, this, &Shell::handleConnected); + connect(m_connection, &SshConnection::dataAvailable, this, &Shell::handleShellMessage); + connect(m_connection, &SshConnection::error, this, &Shell::handleConnectionError); } Shell::~Shell() @@ -77,17 +77,19 @@ void Shell::handleShellMessage(const QString &message) void Shell::handleConnected() { m_shell = m_connection->createRemoteShell(); - connect(m_shell.data(), SIGNAL(started()), SLOT(handleShellStarted())); - connect(m_shell.data(), SIGNAL(readyReadStandardOutput()), SLOT(handleRemoteStdout())); - connect(m_shell.data(), SIGNAL(readyReadStandardError()), SLOT(handleRemoteStderr())); - connect(m_shell.data(), SIGNAL(closed(int)), SLOT(handleChannelClosed(int))); + connect(m_shell.data(), &SshRemoteProcess::started, this, &Shell::handleShellStarted); + connect(m_shell.data(), &SshRemoteProcess::readyReadStandardOutput, + this, &Shell::handleRemoteStdout); + connect(m_shell.data(), &SshRemoteProcess::readyReadStandardError, + this, &Shell::handleRemoteStderr); + connect(m_shell.data(), &SshRemoteProcess::closed, this, &Shell::handleChannelClosed); m_shell->start(); } void Shell::handleShellStarted() { QSocketNotifier * const notifier = new QSocketNotifier(0, QSocketNotifier::Read, this); - connect(notifier, SIGNAL(activated(int)), SLOT(handleStdin())); + connect(notifier, &QSocketNotifier::activated, this, &Shell::handleStdin); } void Shell::handleRemoteStdout() diff --git a/tests/manual/ssh/shell/shell.h b/tests/manual/ssh/shell/shell.h index 3fae9bf18be..ed5f4d82b37 100644 --- a/tests/manual/ssh/shell/shell.h +++ b/tests/manual/ssh/shell/shell.h @@ -49,7 +49,7 @@ public: void run(); -private slots: +private: void handleConnected(); void handleConnectionError(); void handleRemoteStdout(); @@ -59,7 +59,6 @@ private slots: void handleShellStarted(); void handleStdin(); -private: QSsh::SshConnection *m_connection; QSharedPointer m_shell; QFile * const m_stdin; diff --git a/tests/manual/ssh/tunnel/directtunnel.cpp b/tests/manual/ssh/tunnel/directtunnel.cpp index 5c23669d716..54f4c3a3e5d 100644 --- a/tests/manual/ssh/tunnel/directtunnel.cpp +++ b/tests/manual/ssh/tunnel/directtunnel.cpp @@ -47,8 +47,8 @@ DirectTunnel::DirectTunnel(const SshConnectionParameters ¶meters, QObject *p m_targetServer(new QTcpServer(this)), m_expectingChannelClose(false) { - connect(m_connection, SIGNAL(connected()), SLOT(handleConnected())); - connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleConnectionError())); + connect(m_connection, &SshConnection::connected, this, &DirectTunnel::handleConnected); + connect(m_connection, &SshConnection::error, this, &DirectTunnel::handleConnectionError); } DirectTunnel::~DirectTunnel() @@ -77,14 +77,16 @@ void DirectTunnel::handleConnected() return; } m_targetPort = m_targetServer->serverPort(); - connect(m_targetServer, SIGNAL(newConnection()), SLOT(handleNewConnection())); + connect(m_targetServer, &QTcpServer::newConnection, this, &DirectTunnel::handleNewConnection); m_tunnel = m_connection->createDirectTunnel(QLatin1String("localhost"), 1024, // made-up values QLatin1String("localhost"), m_targetPort); - connect(m_tunnel.data(), SIGNAL(initialized()), SLOT(handleInitialized())); - connect(m_tunnel.data(), SIGNAL(error(QString)), SLOT(handleTunnelError(QString))); - connect(m_tunnel.data(), SIGNAL(readyRead()), SLOT(handleServerData())); - connect(m_tunnel.data(), SIGNAL(aboutToClose()), SLOT(handleTunnelClosed())); + connect(m_tunnel.data(), &SshDirectTcpIpTunnel::initialized, + this, &DirectTunnel::handleInitialized); + connect(m_tunnel.data(), &SshDirectTcpIpTunnel::error, + this, &DirectTunnel::handleTunnelError); + connect(m_tunnel.data(), &QIODevice::readyRead, this, &DirectTunnel::handleServerData); + connect(m_tunnel.data(), &QIODevice::aboutToClose, this, &DirectTunnel::handleTunnelClosed); std::cout << "Initializing tunnel..." << std::endl; m_tunnel->initialize(); @@ -95,7 +97,7 @@ void DirectTunnel::handleInitialized() std::cout << "Writing data into the tunnel..." << std::endl; m_tunnel->write(TestData); QTimer * const timeoutTimer = new QTimer(this); - connect(timeoutTimer, SIGNAL(timeout()), SLOT(handleTimeout())); + connect(timeoutTimer, &QTimer::timeout, this, &DirectTunnel::handleTimeout); timeoutTimer->start(10000); } @@ -131,8 +133,10 @@ void DirectTunnel::handleNewConnection() { m_targetSocket = m_targetServer->nextPendingConnection(); m_targetServer->close(); - connect(m_targetSocket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(handleSocketError())); - connect(m_targetSocket, SIGNAL(readyRead()), SLOT(handleClientData())); + connect(m_targetSocket, + static_cast(&QAbstractSocket::error), + this, &DirectTunnel::handleSocketError); + connect(m_targetSocket, &QIODevice::readyRead, this, &DirectTunnel::handleClientData); handleClientData(); } diff --git a/tests/manual/ssh/tunnel/directtunnel.h b/tests/manual/ssh/tunnel/directtunnel.h index 26c1898b1c5..b73fcd9d63b 100644 --- a/tests/manual/ssh/tunnel/directtunnel.h +++ b/tests/manual/ssh/tunnel/directtunnel.h @@ -51,7 +51,7 @@ public: signals: void finished(int errorCode); -private slots: +private: void handleConnected(); void handleConnectionError(); void handleServerData(); @@ -63,7 +63,6 @@ private slots: void handleClientData(); void handleTimeout(); -private: QSsh::SshConnection * const m_connection; QSharedPointer m_tunnel; QTcpServer * const m_targetServer; diff --git a/tests/manual/ssh/tunnel/forwardtunnel.h b/tests/manual/ssh/tunnel/forwardtunnel.h index d5cc23ff627..fd3bf35d40d 100644 --- a/tests/manual/ssh/tunnel/forwardtunnel.h +++ b/tests/manual/ssh/tunnel/forwardtunnel.h @@ -51,7 +51,7 @@ public: signals: void finished(int exitCode); -private slots: +private: void handleConnected(); void handleConnectionError(QSsh::SshError error); void handleInitialized(); @@ -60,7 +60,6 @@ private slots: void handleNewConnection(); void handleSocketError(); -private: QSsh::SshConnection * const m_connection; QSharedPointer m_server; QTcpSocket *m_targetSocket; diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index a8d16c9e3ad..d5cf7030aac 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -125,7 +125,7 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True, lib return str(projectName) def __createProjectHandleQtQuickSelection__(minimumQtVersion): - comboBox = waitForObject("{buddy=':Minimal required Qt version:_QLabel' name='QtVersion' " + comboBox = waitForObject("{leftWidget=':Minimal required Qt version:_QLabel' name='QtVersion' " "type='Utils::TextFieldComboBox' visible='1'}") try: selectFromCombo(comboBox, "Qt %s" % minimumQtVersion) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index bdd64fcdcd8..7f9a9cbc598 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -650,6 +650,11 @@ def getChildByClass(parent, classToSearchFor, occurrence=1): def getHelpViewer(): try: return waitForObject(":Qt Creator_Help::Internal::HelpViewer", 3000) + except: + pass + try: + return waitForObject("{type='QWebEngineView' unnamed='1' " + "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 1000) except: return waitForObject("{type='Help::Internal::TextBrowserHelpWidget' unnamed='1' " "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 1000) diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 5720ff3cd80..7f046e76a45 100755 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -28,14 +28,17 @@ import re # test search in help mode and advanced search searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bld":False } +urlDictionary = { "deployment":"qthelp://com.trolltech.qt.481/qdoc/gettingstarted-develop.html", + "build":"qthelp://com.trolltech.qt.481/qdoc/sql-driver.html" } def __getSelectedText__(): hv = getHelpViewer() + isWebEngineView = className(hv) == "QWebEngineView" try: selText = hv.selectedText if className(selText) != 'instancemethod': - return str(selText) + return str(selText), isWebEngineView except: pass try: @@ -43,7 +46,7 @@ def __getSelectedText__(): except: test.warning("Could not get highlighted text.") selText = '' - return str(selText) + return str(selText), isWebEngineView def __getUrl__(): helpViewer = getHelpViewer() @@ -66,12 +69,20 @@ def getHighlightsInHtml(htmlCode): return res def verifySelection(expected): - selText = str(__getSelectedText__()) + selText, isWebEngineView = __getSelectedText__() + if isWebEngineView: + test.log("The search results are not a selection in a QWebEngineView", + "Searched strings should still be highlighted") + return + selText = str(selText) if test.verify(selText, "Verify that there is a selection"): # verify if search keyword is found in results test.verify(expected.lower() in selText.lower(), "'%s' search result can be found" % expected) +def verifyUrl(expected): + return test.compare(expected, __getUrl__(), "Expected URL loaded?") + def main(): global sdkPath noMatch = "Your search did not match any documents." @@ -109,14 +120,15 @@ def main(): test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits'," "str(findObject(':Hits_QLabel').text))", 2000), "Verifying if search results found with 1+ hits for: " + searchKeyword) - selText = __getSelectedText__() + selText = __getSelectedText__()[0] url = __getUrl__() # click in the widget, tab to first item and press enter mouseClick(waitForObject(":Hits_QCLuceneResultWidget"), 1, 1, 0, Qt.LeftButton) type(waitForObject(":Hits_QCLuceneResultWidget"), "") type(waitForObject(":Hits_QCLuceneResultWidget"), "") - waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) + waitFor("__getUrl__() != url or selText != __getSelectedText__()[0]", 20000) verifySelection(searchKeyword) + verifyUrl(urlDictionary[searchKeyword]) else: test.verify(waitFor("noMatch in " "str(waitForObject(':Hits_QCLuceneResultWidget').plainText)", 1000), @@ -148,10 +160,12 @@ def main(): type(resultsView, "") type(resultsView, "") verifySelection("printing") + verifyUrl("qthelp://com.trolltech.qt.481/qdoc/overviews.html") for i in range(2): type(resultsView, "") type(resultsView, "") verifySelection("sql") + verifyUrl("qthelp://com.trolltech.qt.481/qdoc/best-practices.html") # verify if simple search is properly disabled test.verify(not searchLineEdit.enabled, "Verifying if simple search is not active in advanced mode.") diff --git a/tests/system/suite_qtquick/tst_qml_outline/testdata/focus.qml_mod3_outline.tsv b/tests/system/suite_qtquick/tst_qml_outline/testdata/focus.qml_mod3_outline.tsv index 6aac83e07ba..086c391d2ea 100644 --- a/tests/system/suite_qtquick/tst_qml_outline/testdata/focus.qml_mod3_outline.tsv +++ b/tests/system/suite_qtquick/tst_qml_outline/testdata/focus.qml_mod3_outline.tsv @@ -3,7 +3,7 @@ "id" "1" "window" "txtCnt" "1" """Property""" "clicked" "1" "" -"clicked" "1" "" +"clicked()" "1" "" "width" "1" "800" "height" "1" "480" "color" "1" """white"""
Signal name : %1