Merge remote-tracking branch 'origin/4.1'

Change-Id: If6cd798a25de0c6eb1b386177c11bf8de535aa42
This commit is contained in:
Eike Ziller
2016-06-30 09:40:25 +02:00
115 changed files with 736 additions and 669 deletions

View File

@@ -126,7 +126,7 @@ QVariant fixResourcePaths(const QVariant &value)
if (QFileInfo(fixedPath).exists()) { if (QFileInfo(fixedPath).exists()) {
fixedPath.replace(QLatin1String("//"), QLatin1String("/")); fixedPath.replace(QLatin1String("//"), QLatin1String("/"));
fixedPath.replace(QLatin1Char('\\'), QLatin1Char('/')); fixedPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
return fixedPath; return QUrl::fromLocalFile(fixedPath);
} }
} }
} }

View File

@@ -54,9 +54,20 @@ RowLayout {
property bool isComplete: false 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: { onTextValueChanged: {
comboBox.editText = textValue setCurrentText(textValue)
} }
Layout.fillWidth: true Layout.fillWidth: true
@@ -72,7 +83,7 @@ RowLayout {
if (!comboBox.isComplete) if (!comboBox.isComplete)
return; return;
editText = backendValue.valueToString setCurrentText(textValue)
} }
onCurrentTextChanged: { onCurrentTextChanged: {
@@ -95,7 +106,7 @@ RowLayout {
} }
} }
comboBox.isComplete = true comboBox.isComplete = true
editText = backendValue.valueToString setCurrentText(textValue)
} }
} }

View File

@@ -820,7 +820,8 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId,
const QString typeName = getRightMostIdentifier(typeId)->name.toString(); 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); addMessage(StateCannotHaveChildItem, typeErrorLocation, typeName);
if (checkTypeForDesignerSupport(typeId)) if (checkTypeForDesignerSupport(typeId))

View File

@@ -426,13 +426,8 @@ bool LinkPrivate::importLibrary(Document::Ptr doc,
QString libraryPath = libraryPath_; QString libraryPath = libraryPath_;
LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath); LibraryInfo libraryInfo = snapshot.libraryInfo(libraryPath);
if (!libraryInfo.isValid()) { if (!libraryInfo.isValid())
// try canonical path return false;
libraryPath = QFileInfo(libraryPath).canonicalFilePath();
libraryInfo = snapshot.libraryInfo(libraryPath);
if (!libraryInfo.isValid())
return false;
}
import->libraryPath = libraryPath; import->libraryPath = libraryPath;

View File

@@ -103,7 +103,7 @@ signals:
void stubStarted(); void stubStarted();
void stubStopped(); void stubStopped();
private slots: private:
void stubConnectionAvailable(); void stubConnectionAvailable();
void readStubOutput(); void readStubOutput();
void stubExited(); void stubExited();
@@ -111,7 +111,6 @@ private slots:
void inferiorExited(); void inferiorExited();
#endif #endif
private:
static QString modeOption(Mode m); static QString modeOption(Mode m);
static QString msgCommChannelFailed(const QString &error); static QString msgCommChannelFailed(const QString &error);
static QString msgPromptToClose(); static QString msgPromptToClose();

View File

@@ -60,10 +60,8 @@ signals:
protected: protected:
void resizeEvent(QResizeEvent *); void resizeEvent(QResizeEvent *);
private slots:
void emitElementClicked();
private: private:
void emitElementClicked();
void resizeButtons(); void resizeButtons();
void setBackgroundStyle(); void setBackgroundStyle();

View File

@@ -87,7 +87,7 @@ signals:
void linkActivated(const QString &link); void linkActivated(const QString &link);
void expanded(bool); void expanded(bool);
private slots: private:
void setExpanded(bool); void setExpanded(bool);
protected: protected:

View File

@@ -140,7 +140,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event)
// after the drag operation. // after the drag operation.
// If we do not do this, e.g. dragging from Outline view crashes if the editor and // If we do not do this, e.g. dragging from Outline view crashes if the editor and
// the selected item changes // the selected item changes
QTimer::singleShot(100, this, SLOT(emitFilesDropped())); QTimer::singleShot(100, this, &DropSupport::emitFilesDropped);
} }
} }
if (fileDropMimeData && !fileDropMimeData->values().isEmpty()) { if (fileDropMimeData && !fileDropMimeData->values().isEmpty()) {
@@ -150,7 +150,7 @@ bool DropSupport::eventFilter(QObject *obj, QEvent *event)
m_values.append(fileDropMimeData->values()); m_values.append(fileDropMimeData->values());
m_dropPos = de->pos(); m_dropPos = de->pos();
if (needToScheduleEmit) if (needToScheduleEmit)
QTimer::singleShot(100, this, SLOT(emitValuesDropped())); QTimer::singleShot(100, this, &DropSupport::emitValuesDropped);
} }
} }
if (!accepted) { if (!accepted) {

View File

@@ -68,11 +68,10 @@ public:
protected: protected:
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event);
private slots: private:
void emitFilesDropped(); void emitFilesDropped();
void emitValuesDropped(); void emitValuesDropped();
private:
DropFilterFunction m_filterFunction; DropFilterFunction m_filterFunction;
QList<FileSpec> m_files; QList<FileSpec> m_files;
QList<QVariant> m_values; QList<QVariant> m_values;

View File

@@ -87,7 +87,7 @@ public:
{ {
show(); show();
raise(); raise();
QTimer::singleShot(ms, this, SLOT(runInternal())); QTimer::singleShot(ms, this, &FadingIndicatorPrivate::runInternal);
} }
protected: protected:
@@ -104,7 +104,7 @@ protected:
} }
} }
private slots: private:
void runInternal() void runInternal()
{ {
QPropertyAnimation *anim = new QPropertyAnimation(m_effect, "opacity", this); QPropertyAnimation *anim = new QPropertyAnimation(m_effect, "opacity", this);
@@ -114,7 +114,6 @@ private slots:
anim->start(QAbstractAnimation::DeleteWhenStopped); anim->start(QAbstractAnimation::DeleteWhenStopped);
} }
private:
QGraphicsOpacityEffect *m_effect; QGraphicsOpacityEffect *m_effect;
QLabel *m_label; QLabel *m_label;
QPixmap m_pixmap; QPixmap m_pixmap;

View File

@@ -79,10 +79,9 @@ protected:
void showEvent(QShowEvent *event); void showEvent(QShowEvent *event);
void contextMenuEvent(QContextMenuEvent *event); void contextMenuEvent(QContextMenuEvent *event);
private slots: private:
void onDockActionTriggered(); void onDockActionTriggered();
private:
void handleVisibilityChanged(bool visible); void handleVisibilityChanged(bool visible);
FancyMainWindowPrivate *d; FancyMainWindowPrivate *d;

View File

@@ -66,16 +66,14 @@ public:
bool watchesDirectory(const QString &file) const; bool watchesDirectory(const QString &file) const;
QStringList directories() const; QStringList directories() const;
private slots:
void slotFileChanged(const QString &path);
void slotDirectoryChanged(const QString &path);
signals: signals:
void fileChanged(const QString &path); void fileChanged(const QString &path);
void directoryChanged(const QString &path); void directoryChanged(const QString &path);
private: private:
void init(); void init();
void slotFileChanged(const QString &path);
void slotDirectoryChanged(const QString &path);
FileSystemWatcherPrivate *d; FileSystemWatcherPrivate *d;
}; };

View File

@@ -65,11 +65,10 @@ public slots:
void setPath(const QString &path); void setPath(const QString &path);
void setFileName(const QString &name); void setFileName(const QString &name);
private slots: private:
void slotValidChanged(); void slotValidChanged();
void slotActivated(); void slotActivated();
private:
FileWizardPagePrivate *d; FileWizardPagePrivate *d;
}; };

View File

@@ -149,15 +149,13 @@ public slots:
*/ */
void suggestClassNameFromBase(); void suggestClassNameFromBase();
private slots: private:
void slotUpdateFileNames(const QString &t); void slotUpdateFileNames(const QString &t);
void slotValidChanged(); void slotValidChanged();
void slotActivated(); void slotActivated();
void classNameEdited(); void classNameEdited();
void slotFormInputChecked(); void slotFormInputChecked();
void slotBaseClassEdited(const QString &); void slotBaseClassEdited(const QString &);
private:
void setFormInputCheckable(bool checkable, bool force); void setFormInputCheckable(bool checkable, bool force);
QString fixSuffix(const QString &suffix); QString fixSuffix(const QString &suffix);

View File

@@ -73,11 +73,10 @@ public slots:
void setUseAsDefaultPath(bool u); void setUseAsDefaultPath(bool u);
void setProjectNameRegularExpression(const QRegularExpression &regEx); void setProjectNameRegularExpression(const QRegularExpression &regEx);
private slots: private:
void slotChanged(); void slotChanged();
void slotActivated(); void slotActivated();
private:
enum StatusLabelMode { Error, Warning, Hint }; enum StatusLabelMode { Error, Warning, Hint };
bool validate(); bool validate();

View File

@@ -60,12 +60,10 @@ public:
static QString stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut); static QString stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut);
static ProxyAction *proxyActionWithIcon(QAction *original, const QIcon &newIcon); static ProxyAction *proxyActionWithIcon(QAction *original, const QIcon &newIcon);
private slots: private:
void actionChanged(); void actionChanged();
void updateState(); void updateState();
void updateToolTipWithKeySequence(); void updateToolTipWithKeySequence();
private:
void disconnectAction(); void disconnectAction();
void connectAction(); void connectAction();
void update(QAction *action, bool initialize); void update(QAction *action, bool initialize);

View File

@@ -67,12 +67,11 @@ signals:
void rename(int index, const QString &newName); void rename(int index, const QString &newName);
void currentChanged(int index); void currentChanged(int index);
private slots: private:
void removeButtonClicked(); void removeButtonClicked();
void renameButtonClicked(); void renameButtonClicked();
void updateButtonState(); void updateButtonState();
private:
QLabel *m_label; QLabel *m_label;
QComboBox *m_configurationCombo; QComboBox *m_configurationCombo;
QPushButton *m_addButton; QPushButton *m_addButton;

View File

@@ -43,10 +43,8 @@ public slots:
void showStatusMessage(const QString &message, int timeoutMS = 5000); void showStatusMessage(const QString &message, int timeoutMS = 5000);
void clearStatusMessage(); void clearStatusMessage();
private slots:
void slotTimeout();
private: private:
void slotTimeout();
void stopTimer(); void stopTimer();
QTimer *m_timer; QTimer *m_timer;

View File

@@ -155,14 +155,12 @@ signals:
public slots: public slots:
bool terminate(); bool terminate();
private slots: private:
void slotTimeout(); void slotTimeout();
void finished(int exitCode, QProcess::ExitStatus e); void finished(int exitCode, QProcess::ExitStatus e);
void error(QProcess::ProcessError); void error(QProcess::ProcessError);
void stdOutReady(); void stdOutReady();
void stdErrReady(); void stdErrReady();
private:
void processStdOut(bool emitSignals); void processStdOut(bool emitSignals);
void processStdErr(bool emitSignals); void processStdErr(bool emitSignals);
QString convertOutput(const QByteArray &, QTextCodec::ConverterState *state) const; QString convertOutput(const QByteArray &, QTextCodec::ConverterState *state) const;

View File

@@ -51,10 +51,9 @@ public:
signals: signals:
void textChanged(const QString &); void textChanged(const QString &);
private slots: private:
void slotStateChanged(int); void slotStateChanged(int);
private:
QString m_trueText; QString m_trueText;
QString m_falseText; QString m_falseText;
}; };

View File

@@ -46,10 +46,9 @@ public:
signals: signals:
void text4Changed(const QString &); // Do not conflict with Qt 3 compat signal. void text4Changed(const QString &); // Do not conflict with Qt 3 compat signal.
private slots: private:
void slotCurrentIndexChanged(int); void slotCurrentIndexChanged(int);
private:
inline QString valueAt(int) const; inline QString valueAt(int) const;
}; };

View File

@@ -99,7 +99,7 @@ class LinearProgressWidget : public QWidget
public: public:
LinearProgressWidget(WizardProgress *progress, QWidget *parent = 0); LinearProgressWidget(WizardProgress *progress, QWidget *parent = 0);
private slots: private:
void slotItemAdded(WizardProgressItem *item); void slotItemAdded(WizardProgressItem *item);
void slotItemRemoved(WizardProgressItem *item); void slotItemRemoved(WizardProgressItem *item);
void slotItemChanged(WizardProgressItem *item); void slotItemChanged(WizardProgressItem *item);
@@ -107,8 +107,6 @@ private slots:
void slotNextShownItemChanged(WizardProgressItem *item, WizardProgressItem *nextItem); void slotNextShownItemChanged(WizardProgressItem *item, WizardProgressItem *nextItem);
void slotStartItemChanged(WizardProgressItem *item); void slotStartItemChanged(WizardProgressItem *item);
void slotCurrentItemChanged(WizardProgressItem *item); void slotCurrentItemChanged(WizardProgressItem *item);
private:
void recreateLayout(); void recreateLayout();
void updateProgress(); void updateProgress();
void disableUpdates(); void disableUpdates();

View File

@@ -143,7 +143,7 @@ void TestCodeParser::emitUpdateTestTree()
qCDebug(LOG) << "adding singleShot"; qCDebug(LOG) << "adding singleShot";
m_singleShotScheduled = true; m_singleShotScheduled = true;
QTimer::singleShot(1000, this, SLOT(updateTestTree())); QTimer::singleShot(1000, this, &TestCodeParser::updateTestTree);
} }
void TestCodeParser::updateTestTree() void TestCodeParser::updateTestTree()

View File

@@ -70,7 +70,7 @@ signals:
void parsingFinished(); void parsingFinished();
void parsingFailed(); void parsingFailed();
public slots: public:
void emitUpdateTestTree(); void emitUpdateTestTree();
void updateTestTree(); void updateTestTree();
void onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document); void onCppDocumentUpdated(const CPlusPlus::Document::Ptr &document);

View File

@@ -65,16 +65,12 @@ public:
signals: signals:
public slots: private:
private slots:
void onItemActivated(const QModelIndex &index); void onItemActivated(const QModelIndex &index);
void onSortClicked(); void onSortClicked();
void onFilterMenuTriggered(QAction *action); void onFilterMenuTriggered(QAction *action);
void onParsingStarted(); void onParsingStarted();
void onParsingFinished(); void onParsingFinished();
private:
void initializeFilterMenu(); void initializeFilterMenu();
void onRunThisTestTriggered(TestRunner::Mode runMode); void onRunThisTestTriggered(TestRunner::Mode runMode);

View File

@@ -41,8 +41,6 @@ public:
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
public slots:
void currentChanged(const QModelIndex &current, const QModelIndex &previous); void currentChanged(const QModelIndex &current, const QModelIndex &previous);
private: private:

View File

@@ -87,20 +87,17 @@ public:
void goToNext(); void goToNext();
void goToPrev(); void goToPrev();
signals:
public slots:
void addTestResult(const TestResultPtr &result); void addTestResult(const TestResultPtr &result);
private slots: private:
explicit TestResultsPane(QObject *parent = 0);
void onItemActivated(const QModelIndex &index); void onItemActivated(const QModelIndex &index);
void onRunAllTriggered(); void onRunAllTriggered();
void onRunSelectedTriggered(); void onRunSelectedTriggered();
void enableAllFilter(); void enableAllFilter();
void filterMenuTriggered(QAction *action); void filterMenuTriggered(QAction *action);
private:
explicit TestResultsPane(QObject *parent = 0);
void initializeFilterMenu(); void initializeFilterMenu();
void updateSummaryLabel(); void updateSummaryLabel();
void createToolButtons(); void createToolButtons();

View File

@@ -56,21 +56,19 @@ public:
void setSelectedTests(const QList<TestConfiguration *> &selected); void setSelectedTests(const QList<TestConfiguration *> &selected);
bool isTestRunning() const { return m_executingTests; } bool isTestRunning() const { return m_executingTests; }
void prepareToRunTests(Mode mode);
signals: signals:
void testRunStarted(); void testRunStarted();
void testRunFinished(); void testRunFinished();
void requestStopTestRun(); void requestStopTestRun();
void testResultReady(const TestResultPtr &result); void testResultReady(const TestResultPtr &result);
public slots: private:
void prepareToRunTests(Mode mode);
private slots:
void buildProject(ProjectExplorer::Project *project); void buildProject(ProjectExplorer::Project *project);
void buildFinished(bool success); void buildFinished(bool success);
void onFinished(); void onFinished();
private:
void runTests(); void runTests();
void debugTests(); void debugTests();
void runOrDebugTests(); void runOrDebugTests();

View File

@@ -83,8 +83,6 @@ signals:
void sweepingDone(); void sweepingDone();
#endif #endif
public slots:
private: private:
void onParseResultReady(const TestParseResultPtr result); void onParseResultReady(const TestParseResultPtr result);
void handleParseResult(const TestParseResult *result, TestTreeItem *rootNode); void handleParseResult(const TestParseResult *result, TestTreeItem *rootNode);

View File

@@ -352,13 +352,17 @@ void ClangDiagnosticManager::addFixItAvailableMarker(
QSet<int> &lineNumbersWithFixItMarker) QSet<int> &lineNumbersWithFixItMarker)
{ {
for (auto &&diagnostic : diagnostics) { for (auto &&diagnostic : diagnostics) {
const int line = int(diagnostic.location().line()); for (auto &&fixit : diagnostic.fixIts()) {
if (!diagnostic.fixIts().isEmpty() && !lineNumbersWithFixItMarker.contains(line)) { const ClangBackEnd::SourceLocationContainer location = fixit.range().start();
const TextEditor::RefactorMarker marker const int line = int(location.line());
= createFixItAvailableMarker(m_textDocument->document(), line);
lineNumbersWithFixItMarker.insert(line); if (location.filePath() == filePath() && !lineNumbersWithFixItMarker.contains(line)) {
m_fixItAvailableMarkers.append(marker); const TextEditor::RefactorMarker marker
= createFixItAvailableMarker(m_textDocument->document(), line);
lineNumbersWithFixItMarker.insert(line);
m_fixItAvailableMarkers.append(marker);
}
} }
addFixItAvailableMarker(diagnostic.children(), lineNumbersWithFixItMarker); addFixItAvailableMarker(diagnostic.children(), lineNumbersWithFixItMarker);

View File

@@ -27,6 +27,8 @@
#include "clangfixitoperation.h" #include "clangfixitoperation.h"
#include <utils/algorithm.h>
#include <QDebug> #include <QDebug>
using ClangBackEnd::DiagnosticContainer; using ClangBackEnd::DiagnosticContainer;
@@ -75,13 +77,16 @@ QString tweakedDiagnosticText(const QString &diagnosticText)
return tweakedText; return tweakedText;
} }
bool isDiagnosticFromFileAtLine(const DiagnosticContainer &diagnosticContainer, bool hasFixItAt(const QVector<ClangBackEnd::FixItContainer> &fixits,
const QString &filePath, const Utf8String &filePath,
int line) int line)
{ {
const auto location = diagnosticContainer.location(); const auto isFixitForLocation = [filePath, line] (const ClangBackEnd::FixItContainer &fixit) {
return location.filePath().toString() == filePath const ClangBackEnd::SourceLocationContainer location = fixit.range().start();
&& location.line() == uint(line); return location.filePath() == filePath && location.line() == uint(line);
};
return Utils::anyOf(fixits, isFixitForLocation);
} }
} // anonymous namespace } // anonymous namespace
@@ -103,17 +108,17 @@ ClangFixItOperationsExtractor::extract(const QString &filePath, int line)
return operations; return operations;
} }
void ClangFixItOperationsExtractor::appendFixitOperationsFromDiagnostic( void ClangFixItOperationsExtractor::appendFixitOperation(
const QString &filePath, const QString &filePath,
const DiagnosticContainer &diagnosticContainer) const QString &diagnosticText,
const QVector<ClangBackEnd::FixItContainer> &fixits)
{ {
const auto fixIts = diagnosticContainer.fixIts(); if (!fixits.isEmpty()) {
if (!fixIts.isEmpty()) { const QString diagnosticTextTweaked = tweakedDiagnosticText(diagnosticText);
const QString diagnosticText = tweakedDiagnosticText(diagnosticContainer.text().toString());
TextEditor::QuickFixOperation::Ptr operation( TextEditor::QuickFixOperation::Ptr operation(
new ClangFixItOperation(filePath, new ClangFixItOperation(filePath,
diagnosticText, diagnosticTextTweaked,
fixIts)); fixits));
operations.append(operation); operations.append(operation);
} }
} }
@@ -123,8 +128,9 @@ void ClangFixItOperationsExtractor::extractFromDiagnostic(
const QString &filePath, const QString &filePath,
int line) int line)
{ {
if (isDiagnosticFromFileAtLine(diagnosticContainer, filePath, line)) { const QVector<ClangBackEnd::FixItContainer> fixIts = diagnosticContainer.fixIts();
appendFixitOperationsFromDiagnostic(filePath, diagnosticContainer); if (hasFixItAt(fixIts, filePath, line)) {
appendFixitOperation(filePath, diagnosticContainer.text().toString(), fixIts);
foreach (const auto &child, diagnosticContainer.children()) foreach (const auto &child, diagnosticContainer.children())
extractFromDiagnostic(child, filePath, line); extractFromDiagnostic(child, filePath, line);

View File

@@ -42,8 +42,9 @@ private:
void extractFromDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnosticContainer, void extractFromDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnosticContainer,
const QString &filePath, const QString &filePath,
int line); int line);
void appendFixitOperationsFromDiagnostic(const QString &filePath, void appendFixitOperation(const QString &filePath,
const ClangBackEnd::DiagnosticContainer &diagnosticContainer); const QString &diagnosticText,
const QVector<ClangBackEnd::FixItContainer> &fixits);
private: private:
const QVector<ClangBackEnd::DiagnosticContainer> &diagnosticContainers; const QVector<ClangBackEnd::DiagnosticContainer> &diagnosticContainers;

View File

@@ -259,44 +259,6 @@ BreakHandler::BreakHandler()
<< tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads")); << 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) static inline bool fileNameMatch(const QString &f1, const QString &f2)
{ {
if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive) 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 // 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). // cursor is near a line with a breakpoint marker (+/- 2 lines or so).
if (m_params.isTracepoint()) if (m_params.isTracepoint())
return BreakHandler::tracepointIcon(); return Icons::TRACEPOINT.icon();
if (m_params.type == WatchpointAtAddress) if (m_params.type == WatchpointAtAddress)
return BreakHandler::watchpointIcon(); return Icons::WATCHPOINT.icon();
if (m_params.type == WatchpointAtExpression) if (m_params.type == WatchpointAtExpression)
return BreakHandler::watchpointIcon(); return Icons::WATCHPOINT.icon();
if (!m_params.enabled) if (!m_params.enabled)
return BreakHandler::disabledBreakpointIcon(); return Icons::BREAKPOINT_DISABLED.icon();
if (m_state == BreakpointInserted && !m_response.pending) if (m_state == BreakpointInserted && !m_response.pending)
return BreakHandler::breakpointIcon(); return Icons::BREAKPOINT.icon();
return BreakHandler::pendingBreakpointIcon(); return Icons::BREAKPOINT_PENDING.icon();
} }
QString BreakpointItem::toToolTip() const QString BreakpointItem::toToolTip() const

View File

@@ -187,13 +187,6 @@ public:
Breakpoints findBreakpointsByIndex(const QList<QModelIndex> &list) const; Breakpoints findBreakpointsByIndex(const QList<QModelIndex> &list) const;
void updateMarkers(); 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, Breakpoint findBreakpointByFileAndLine(const QString &fileName,
int lineNumber, bool useMarkerPosition = true); int lineNumber, bool useMarkerPosition = true);
Breakpoint findBreakpointByAddress(quint64 address) const; Breakpoint findBreakpointByAddress(quint64 address) const;

View File

@@ -123,7 +123,8 @@ SOURCES += \
localsandexpressionswindow.cpp \ localsandexpressionswindow.cpp \
imageviewer.cpp \ imageviewer.cpp \
simplifytype.cpp \ simplifytype.cpp \
unstartedappwatcherdialog.cpp unstartedappwatcherdialog.cpp \
debuggericons.cpp
RESOURCES += debugger.qrc RESOURCES += debugger.qrc

View File

@@ -49,7 +49,7 @@ Project {
"debugger_global.h", "debugger_global.h",
"debuggeractions.cpp", "debuggeractions.h", "debuggeractions.cpp", "debuggeractions.h",
"debuggerconstants.h", "debuggerconstants.h",
"debuggericons.h", "debuggericons.h", "debuggericons.cpp",
"debuggercore.h", "debuggercore.h",
"debuggerdialogs.cpp", "debuggerdialogs.h", "debuggerdialogs.cpp", "debuggerdialogs.h",
"debuggerengine.cpp", "debuggerengine.h", "debuggerengine.cpp", "debuggerengine.h",

View File

@@ -61,7 +61,6 @@ enum TestCases
// Some convenience. // Some convenience.
void updateState(DebuggerEngine *engine); void updateState(DebuggerEngine *engine);
void updateWatchersWindow(bool showWatch, bool showReturn); void updateWatchersWindow(bool showWatch, bool showReturn);
QIcon locationMarkIcon();
const CPlusPlus::Snapshot &cppCodeModelSnapshot(); const CPlusPlus::Snapshot &cppCodeModelSnapshot();
bool hasSnapshots(); bool hasSnapshots();
void openTextEditor(const QString &titlePattern, const QString &contents); void openTextEditor(const QString &titlePattern, const QString &contents);

View File

@@ -28,6 +28,7 @@
#include "debuggerinternalconstants.h" #include "debuggerinternalconstants.h"
#include "debuggeractions.h" #include "debuggeractions.h"
#include "debuggercore.h" #include "debuggercore.h"
#include "debuggericons.h"
#include "debuggerruncontrol.h" #include "debuggerruncontrol.h"
#include "debuggerstartparameters.h" #include "debuggerstartparameters.h"
#include "debuggertooltipmanager.h" #include "debuggertooltipmanager.h"
@@ -37,7 +38,6 @@
#include "logwindow.h" #include "logwindow.h"
#include "memoryagent.h" #include "memoryagent.h"
#include "moduleshandler.h" #include "moduleshandler.h"
#include "gdb/gdbengine.h" // REMOVE
#include "registerhandler.h" #include "registerhandler.h"
#include "sourcefileshandler.h" #include "sourcefileshandler.h"
#include "sourceutils.h" #include "sourceutils.h"
@@ -132,7 +132,7 @@ Location::Location(const StackFrame &frame, bool marker)
LocationMark::LocationMark(DebuggerEngine *engine, const QString &file, int line) LocationMark::LocationMark(DebuggerEngine *engine, const QString &file, int line)
: TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine) : TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine)
{ {
setIcon(Internal::locationMarkIcon()); setIcon(Icons::LOCATION.icon());
setPriority(TextMark::HighPriority); setPriority(TextMark::HighPriority);
} }
@@ -564,7 +564,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid)); d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid));
if (isNativeMixedActive()) 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)); action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability));
@@ -609,7 +609,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
} }
if (loc.fileName().isEmpty()) { if (loc.fileName().isEmpty()) {
showMessage(QLatin1String("CANNOT GO TO THIS LOCATION")); showMessage("CANNOT GO TO THIS LOCATION");
return; return;
} }
const QString file = QDir::cleanPath(loc.fileName()); const QString file = QDir::cleanPath(loc.fileName());
@@ -633,7 +633,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
// Called from RunControl. // Called from RunControl.
void DebuggerEngine::handleStartFailed() void DebuggerEngine::handleStartFailed()
{ {
showMessage(QLatin1String("HANDLE RUNCONTROL START FAILED")); showMessage("HANDLE RUNCONTROL START FAILED");
d->m_runControl = 0; d->m_runControl = 0;
d->m_progress.setProgressValue(900); d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled(); d->m_progress.reportCanceled();
@@ -643,7 +643,7 @@ void DebuggerEngine::handleStartFailed()
// Called from RunControl. // Called from RunControl.
void DebuggerEngine::handleFinished() void DebuggerEngine::handleFinished()
{ {
showMessage(QLatin1String("HANDLE RUNCONTROL FINISHED")); showMessage("HANDLE RUNCONTROL FINISHED");
d->m_runControl = 0; d->m_runControl = 0;
d->m_progress.setProgressValue(1000); d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished(); d->m_progress.reportFinished();
@@ -905,7 +905,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
if (result.gdbServerPort.isValid()) { if (result.gdbServerPort.isValid()) {
QString &rc = d->m_runParameters.remoteChannel; QString &rc = d->m_runParameters.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); const int sepIndex = rc.lastIndexOf(':');
if (sepIndex != -1) { if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort.number())); QString::number(result.gdbServerPort.number()));
@@ -1785,9 +1785,9 @@ QString DebuggerEngine::msgInterrupted()
void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
{ {
if (name.isEmpty()) if (name.isEmpty())
name = QLatin1Char(' ') + tr("<Unknown>", "name") + QLatin1Char(' '); name = ' ' + tr("<Unknown>", "name") + ' ';
if (meaning.isEmpty()) if (meaning.isEmpty())
meaning = QLatin1Char(' ') + tr("<Unknown>", "meaning") + QLatin1Char(' '); meaning = ' ' + tr("<Unknown>", "meaning") + ' ';
const QString msg = tr("<p>The inferior stopped because it received a " const QString msg = tr("<p>The inferior stopped because it received a "
"signal from the operating system.<p>" "signal from the operating system.<p>"
"<table><tr><td>Signal name : </td><td>%1</td></tr>" "<table><tr><td>Signal name : </td><td>%1</td></tr>"
@@ -1856,14 +1856,14 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
"experience for this binary format."); "experience for this binary format.");
return; return;
} else if (warnOnRelease) { } else if (warnOnRelease) {
if (!symbolFile.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) if (!symbolFile.endsWith(".exe", Qt::CaseInsensitive))
symbolFile.append(QLatin1String(".exe")); symbolFile.append(".exe");
QString errorMessage; QString errorMessage;
QStringList rc; QStringList rc;
if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty()) if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty())
return; return;
if (!errorMessage.isEmpty()) { if (!errorMessage.isEmpty()) {
detailedWarning.append(QLatin1Char('\n')); detailedWarning.append('\n');
detailedWarning.append(errorMessage); detailedWarning.append(errorMessage);
} }
} else { } else {
@@ -1979,12 +1979,12 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
tr("The selected debugger may be inappropiate for the inferior.\n" tr("The selected debugger may be inappropiate for the inferior.\n"
"Examining symbols and setting breakpoints by file name and line number " "Examining symbols and setting breakpoints by file name and line number "
"may fail.\n") "may fail.\n")
+ QLatin1Char('\n') + detailedWarning); + '\n' + detailedWarning);
} else if (warnOnRelease) { } else if (warnOnRelease) {
AsynchronousMessageBox::information(tr("Warning"), AsynchronousMessageBox::information(tr("Warning"),
tr("This does not seem to be a \"Debug\" build.\n" tr("This does not seem to be a \"Debug\" build.\n"
"Setting breakpoints by file name and line number may fail.") "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; static int count = 0;
showMessage(QString("<Rebuild Watchmodel %1 @ %2 >") showMessage(QString("<Rebuild Watchmodel %1 @ %2 >")
.arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput); .arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput);
showStatusMessage(GdbEngine::tr("Finished retrieving data"), 400); // FIXME: String showStatusMessage(tr("Finished retrieving data"), 400);
DebuggerToolTipManager::updateEngine(this); DebuggerToolTipManager::updateEngine(this);

View File

@@ -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

View File

@@ -25,104 +25,54 @@
#pragma once #pragma once
#include "debugger_global.h"
#include <utils/icon.h> #include <utils/icon.h>
namespace Debugger { namespace Debugger {
namespace Icons { namespace Icons {
const Utils::Icon BREAKPOINT({ // Used in QmlProfiler.
{QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint); DEBUGGER_EXPORT extern const Utils::Icon RECORD_ON;
const Utils::Icon BREAKPOINT_DISABLED({ DEBUGGER_EXPORT extern const Utils::Icon RECORD_OFF;
{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);
const Utils::Icon STEP_OVER({ extern const Utils::Icon BREAKPOINT;
{QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); extern const Utils::Icon BREAKPOINT_DISABLED;
const Utils::Icon STEP_OVER_TOOLBAR({ extern const Utils::Icon BREAKPOINT_PENDING;
{QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::IconsBaseColor}}); extern const Utils::Icon BREAKPOINTS;
const Utils::Icon STEP_INTO({ extern const Utils::Icon WATCHPOINT;
{QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); extern const Utils::Icon TRACEPOINT;
const Utils::Icon STEP_INTO_TOOLBAR({ extern const Utils::Icon CONTINUE;
{QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::IconsBaseColor}}); extern const Utils::Icon CONTINUE_FLAT;
const Utils::Icon STEP_OUT({ extern const Utils::Icon DEBUG_CONTINUE_SMALL;
{QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); extern const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR;
const Utils::Icon STEP_OUT_TOOLBAR({ extern const Utils::Icon INTERRUPT;
{QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::IconsBaseColor}}); extern const Utils::Icon INTERRUPT_FLAT;
const Utils::Icon RESTART({ extern const Utils::Icon DEBUG_INTERRUPT_SMALL;
{QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle); extern const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR;
const Utils::Icon RESTART_TOOLBAR({ extern const Utils::Icon DEBUG_EXIT_SMALL;
{QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::IconsRunToolBarColor}}); extern const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR;
const Utils::Icon SINGLE_INSTRUCTION_MODE({ extern const Utils::Icon LOCATION;
{QLatin1String(":/debugger/images/debugger_singleinstructionmode.png"), Utils::Theme::IconsBaseColor}}); 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( extern const Utils::Icon STEP_OVER;
QLatin1String(":/debugger/images/mode_debug.png")); extern const Utils::Icon STEP_OVER_TOOLBAR;
const Utils::Icon MODE_DEBUGGER_FLAT({ extern const Utils::Icon STEP_INTO;
{QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsBaseColor}}); extern const Utils::Icon STEP_INTO_TOOLBAR;
const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE({ extern const Utils::Icon STEP_OUT;
{QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsModeDebugActiveColor}}); 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 Icons
} // namespace Debugger } // namespace Debugger

View File

@@ -998,8 +998,6 @@ public:
QToolButton *m_reverseToolButton = 0; QToolButton *m_reverseToolButton = 0;
QIcon m_locationMarkIcon;
QLabel *m_threadLabel = 0; QLabel *m_threadLabel = 0;
QComboBox *m_threadBox = 0; QComboBox *m_threadBox = 0;
@@ -1310,8 +1308,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
const Context cppDebuggercontext(C_CPPDEBUGGER); const Context cppDebuggercontext(C_CPPDEBUGGER);
const Context cppeditorcontext(CppEditor::Constants::CPPEDITOR_ID); const Context cppeditorcontext(CppEditor::Constants::CPPEDITOR_ID);
m_locationMarkIcon = Icons::LOCATION.icon();
m_busy = false; m_busy = false;
m_logWindow = new LogWindow; m_logWindow = new LogWindow;
@@ -3107,11 +3103,6 @@ void updateWatchersWindow(bool showWatch, bool showReturn)
dd->m_returnWindow->setVisible(showReturn); dd->m_returnWindow->setVisible(showReturn);
} }
QIcon locationMarkIcon()
{
return dd->m_locationMarkIcon;
}
bool hasSnapshots() bool hasSnapshots()
{ {
return dd->m_snapshotHandler->size(); return dd->m_snapshotHandler->size();

View File

@@ -562,9 +562,8 @@ void RegisterHandler::setNumberFormat(const QString &name, RegisterFormat format
RegisterMap RegisterHandler::registerMap() const RegisterMap RegisterHandler::registerMap() const
{ {
RegisterMap result; RegisterMap result;
Utils::TreeItem *root = rootItem(); for (int i = 0, n = rootItem()->childCount(); i != n; ++i) {
for (int i = 0, n = root->rowCount(); i != n; ++i) { RegisterItem *reg = rootItem()->childAt(i);
RegisterItem *reg = static_cast<RegisterItem *>(root->child(i));
quint64 value = reg->addressValue(); quint64 value = reg->addressValue();
if (value) if (value)
result.insert(value, reg->m_reg.name); result.insert(value, reg->m_reg.name);

View File

@@ -115,9 +115,13 @@ public:
}; };
class RegisterItem; class RegisterItem;
class RegisterSubItem;
using RegisterRootItem = Utils::TypedTreeItem<RegisterItem>;
typedef QMap<quint64, QString> RegisterMap; typedef QMap<quint64, QString> RegisterMap;
class RegisterHandler : public Utils::TreeModel class RegisterHandler
: public Utils::LeveledTreeModel<RegisterRootItem, RegisterItem, RegisterSubItem>
{ {
Q_OBJECT Q_OBJECT

View File

@@ -119,8 +119,6 @@ QDebug operator<<(QDebug d, const SnapshotData &f)
*/ */
SnapshotHandler::SnapshotHandler() SnapshotHandler::SnapshotHandler()
: m_positionIcon(Icons::LOCATION.icon()),
m_emptyIcon(Icons::EMPTY.icon())
{ {
m_currentIndex = -1; m_currentIndex = -1;
} }
@@ -178,8 +176,7 @@ QVariant SnapshotHandler::data(const QModelIndex &index, int role) const
case Qt::DecorationRole: case Qt::DecorationRole:
// Return icon that indicates whether this is the active stack frame. // Return icon that indicates whether this is the active stack frame.
if (index.column() == 0) if (index.column() == 0)
return (index.row() == m_currentIndex) ? m_positionIcon : m_emptyIcon; return (index.row() == m_currentIndex) ? Icons::LOCATION.icon() : Icons::EMPTY.icon();
break;
default: default:
break; break;

View File

@@ -65,8 +65,6 @@ private:
int m_currentIndex; int m_currentIndex;
QList< QPointer<DebuggerEngine> > m_snapshots; QList< QPointer<DebuggerEngine> > m_snapshots;
const QVariant m_positionIcon;
const QVariant m_emptyIcon;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -26,8 +26,8 @@
#include "sourceagent.h" #include "sourceagent.h"
#include "debuggerengine.h" #include "debuggerengine.h"
#include "debuggericons.h"
#include "debuggerinternalconstants.h" #include "debuggerinternalconstants.h"
#include "debuggercore.h"
#include "stackhandler.h" #include "stackhandler.h"
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
@@ -141,7 +141,7 @@ void SourceAgent::updateLocationMarker()
d->locationMark = new TextMark(QString(), lineNumber, d->locationMark = new TextMark(QString(), lineNumber,
Constants::TEXT_MARK_CATEGORY_LOCATION); Constants::TEXT_MARK_CATEGORY_LOCATION);
d->locationMark->setIcon(locationMarkIcon()); d->locationMark->setIcon(Icons::LOCATION.icon());
d->locationMark->setPriority(TextMark::HighPriority); d->locationMark->setPriority(TextMark::HighPriority);
d->editor->textDocument()->addMark(d->locationMark); d->editor->textDocument()->addMark(d->locationMark);

View File

@@ -54,9 +54,7 @@ namespace Internal {
*/ */
StackHandler::StackHandler(DebuggerEngine *engine) StackHandler::StackHandler(DebuggerEngine *engine)
: m_engine(engine), : m_engine(engine)
m_positionIcon(Icons::LOCATION.icon()),
m_emptyIcon(Icons::EMPTY.icon())
{ {
setObjectName(QLatin1String("StackModel")); setObjectName(QLatin1String("StackModel"));
m_resetLocationScheduled = false; m_resetLocationScheduled = false;
@@ -93,7 +91,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
if (role == Qt::DisplayRole && index.column() == StackFunctionNameColumn) if (role == Qt::DisplayRole && index.column() == StackFunctionNameColumn)
return tr("<More>"); return tr("<More>");
if (role == Qt::DecorationRole && index.column() == StackLevelColumn) if (role == Qt::DecorationRole && index.column() == StackLevelColumn)
return m_emptyIcon; return Icons::EMPTY.icon();
return QVariant(); return QVariant();
} }
@@ -120,7 +118,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const
if (role == Qt::DecorationRole && index.column() == StackLevelColumn) { if (role == Qt::DecorationRole && index.column() == StackLevelColumn) {
// Return icon that indicates whether this is the active stack frame // Return icon that indicates whether this is the active stack frame
return (m_contentsValid && index.row() == m_currentIndex) return (m_contentsValid && index.row() == m_currentIndex)
? m_positionIcon : m_emptyIcon; ? Icons::LOCATION.icon() : Icons::EMPTY.icon();
} }
if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInStackView)) if (role == Qt::ToolTipRole && boolSetting(UseToolTipsInStackView))

View File

@@ -88,8 +88,6 @@ private:
DebuggerEngine *m_engine; DebuggerEngine *m_engine;
StackFrames m_stackFrames; StackFrames m_stackFrames;
int m_currentIndex; int m_currentIndex;
const QVariant m_positionIcon;
const QVariant m_emptyIcon;
bool m_canExpand; bool m_canExpand;
bool m_resetLocationScheduled; bool m_resetLocationScheduled;
bool m_contentsValid; bool m_contentsValid;

View File

@@ -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 class ThreadItem : public TreeItem
{ {
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::ThreadsHandler) Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::ThreadsHandler)
@@ -79,7 +67,8 @@ public:
case Qt::DecorationRole: case Qt::DecorationRole:
// Return icon that indicates whether this is the active stack frame. // Return icon that indicates whether this is the active stack frame.
if (column == 0) if (column == 0)
return threadData.id == handler->currentThread() ? positionIcon() : emptyIcon(); return threadData.id == handler->currentThread() ? Icons::LOCATION.icon()
: Icons::EMPTY.icon();
break; break;
case ThreadData::IdRole: case ThreadData::IdRole:
return threadData.id.raw(); return threadData.id.raw();
@@ -266,9 +255,9 @@ int ThreadsHandler::currentThreadIndex() const
void ThreadsHandler::sort(int column, Qt::SortOrder order) void ThreadsHandler::sort(int column, Qt::SortOrder order)
{ {
rootItem()->sortChildren([order, column](const TreeItem *item1, const TreeItem *item2) -> bool { rootItem()->sortChildren([order, column](const ThreadItem *item1, const ThreadItem *item2) -> bool {
const QVariant v1 = static_cast<const ThreadItem *>(item1)->threadPart(column); const QVariant v1 = item1->threadPart(column);
const QVariant v2 = static_cast<const ThreadItem *>(item2)->threadPart(column); const QVariant v2 = item2->threadPart(column);
if (v1 == v2) if (v1 == v2)
return false; return false;
if (column == 0) if (column == 0)
@@ -286,7 +275,7 @@ ThreadId ThreadsHandler::currentThread() const
ThreadId ThreadsHandler::threadAt(int index) const ThreadId ThreadsHandler::threadAt(int index) const
{ {
QTC_ASSERT(index >= 0 && index < rootItem()->childCount(), return ThreadId()); QTC_ASSERT(index >= 0 && index < rootItem()->childCount(), return ThreadId());
return static_cast<ThreadItem *>(rootItem()->childAt(index))->threadData.id; return rootItem()->childAt(index)->threadData.id;
} }
void ThreadsHandler::setCurrentThread(ThreadId id) void ThreadsHandler::setCurrentThread(ThreadId id)

View File

@@ -41,7 +41,7 @@ namespace Internal {
class GdbMi; class GdbMi;
class ThreadItem; class ThreadItem;
class ThreadsHandler : public Utils::LeveledTreeModel<Utils::TreeItem, ThreadItem> class ThreadsHandler : public Utils::LeveledTreeModel<Utils::TypedTreeItem<ThreadItem>, ThreadItem>
{ {
Q_OBJECT Q_OBJECT

View File

@@ -239,13 +239,13 @@ GenericMakeStepConfigWidget::GenericMakeStepConfigWidget(GenericMakeStep *makeSt
connect(m_ui->makeArgumentsLineEdit, &QLineEdit::textEdited, connect(m_ui->makeArgumentsLineEdit, &QLineEdit::textEdited,
this, &GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited); this, &GenericMakeStepConfigWidget::makeArgumentsLineEditTextEdited);
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, SLOT(updateMakeOverrrideLabel())); this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel);
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()), connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, SLOT(updateDetails())); this, &GenericMakeStepConfigWidget::updateDetails);
connect(m_makeStep->target(), SIGNAL(kitChanged()), connect(m_makeStep->target(), &Target::kitChanged,
this, SLOT(updateMakeOverrrideLabel())); this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel);
connect(pro, &GenericProject::environmentChanged, connect(pro, &GenericProject::environmentChanged,
this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel); this, &GenericMakeStepConfigWidget::updateMakeOverrrideLabel);

View File

@@ -87,14 +87,13 @@ public:
QString displayName() const override; QString displayName() const override;
QString summaryText() const override; QString summaryText() const override;
private slots: private:
void itemChanged(QListWidgetItem *item); void itemChanged(QListWidgetItem *item);
void makeLineEditTextEdited(); void makeLineEditTextEdited();
void makeArgumentsLineEditTextEdited(); void makeArgumentsLineEditTextEdited();
void updateMakeOverrrideLabel(); void updateMakeOverrrideLabel();
void updateDetails(); void updateDetails();
private:
Ui::GenericMakeStep *m_ui; Ui::GenericMakeStep *m_ui;
GenericMakeStep *m_makeStep; GenericMakeStep *m_makeStep;
QString m_summaryText; QString m_summaryText;

View File

@@ -195,7 +195,7 @@ public:
void operator=(Runnable other) { d = std::move(other.d); } void operator=(Runnable other) { d = std::move(other.d); }
template <class T> bool is() const { template <class T> bool is() const {
return d.get()->typeId() == T::staticTypeId; return d.get() && (d.get()->typeId() == T::staticTypeId);
} }
template <class T> const T &as() const { template <class T> const T &as() const {
@@ -235,7 +235,7 @@ public:
void operator=(Connection other) { d = std::move(other.d); } void operator=(Connection other) { d = std::move(other.d); }
template <class T> bool is() const { template <class T> bool is() const {
return d.get()->typeId() == T::staticTypeId; return d.get() && (d.get()->typeId() == T::staticTypeId);
} }
template <class T> const T &as() const { template <class T> const T &as() const {

View File

@@ -51,10 +51,12 @@ CustomQbsPropertiesDialog::CustomQbsPropertiesDialog(const QVariantMap &properti
m_ui->propertiesTable->setItem(currentRow, 1, valueItem); m_ui->propertiesTable->setItem(currentRow, 1, valueItem);
++currentRow; ++currentRow;
} }
connect(m_ui->addButton, SIGNAL(clicked()), SLOT(addProperty())); connect(m_ui->addButton, &QAbstractButton::clicked,
connect(m_ui->removeButton, SIGNAL(clicked()), SLOT(removeSelectedProperty())); this, &CustomQbsPropertiesDialog::addProperty);
connect(m_ui->propertiesTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), connect(m_ui->removeButton, &QAbstractButton::clicked,
SLOT(handleCurrentItemChanged())); this, &CustomQbsPropertiesDialog::removeSelectedProperty);
connect(m_ui->propertiesTable, &QTableWidget::currentItemChanged,
this, &CustomQbsPropertiesDialog::handleCurrentItemChanged);
handleCurrentItemChanged(); handleCurrentItemChanged();
} }

View File

@@ -42,7 +42,7 @@ public:
QVariantMap properties() const; QVariantMap properties() const;
~CustomQbsPropertiesDialog(); ~CustomQbsPropertiesDialog();
private slots: private:
void addProperty(); void addProperty();
void removeSelectedProperty(); void removeSelectedProperty();
void handleCurrentItemChanged(); void handleCurrentItemChanged();

View File

@@ -86,10 +86,9 @@ protected:
QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id); QbsBuildConfiguration(ProjectExplorer::Target *target, Core::Id id);
bool fromMap(const QVariantMap &map) override; bool fromMap(const QVariantMap &map) override;
private slots: private:
void buildStepInserted(int pos); void buildStepInserted(int pos);
private:
static QbsBuildConfiguration *setup(ProjectExplorer::Target *t, static QbsBuildConfiguration *setup(ProjectExplorer::Target *t,
const QString &defaultDisplayName, const QString &defaultDisplayName,
const QString &displayName, const QString &displayName,

View File

@@ -43,7 +43,7 @@ class QbsBuildConfigurationWidget : public ProjectExplorer::NamedWidget
public: public:
QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc); QbsBuildConfigurationWidget(Internal::QbsBuildConfiguration *bc);
private slots: private:
void buildDirEdited(); void buildDirEdited();
// Changes triggered from creator // Changes triggered from creator

View File

@@ -112,8 +112,10 @@ bool QbsBuildStep::init(QList<const BuildStep *> &earlierSteps)
m_activeFileTags = bc->activeFileTags(); m_activeFileTags = bc->activeFileTags();
m_products = bc->products(); m_products = bc->products();
connect(m_parser, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat)), connect(m_parser, &ProjectExplorer::IOutputParser::addOutput,
this, SIGNAL(addOutput(QString,ProjectExplorer::BuildStep::OutputFormat))); this, [this](const QString &string, ProjectExplorer::BuildStep::OutputFormat format) {
emit addOutput(string, format);
});
connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask); connect(m_parser, &ProjectExplorer::IOutputParser::addTask, this, &QbsBuildStep::addTask);
return true; return true;
@@ -259,7 +261,7 @@ void QbsBuildStep::buildingDone(bool success)
void QbsBuildStep::reparsingDone(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; m_parsingProject = false;
if (m_job) { // This was a scheduled reparsing after building. if (m_job) { // This was a scheduled reparsing after building.
finish(); finish();
@@ -398,7 +400,7 @@ void QbsBuildStep::setCleanInstallRoot(bool clean)
void QbsBuildStep::parseProject() void QbsBuildStep::parseProject()
{ {
m_parsingProject = true; m_parsingProject = true;
connect(qbsProject(), SIGNAL(projectParsingDone(bool)), SLOT(reparsingDone(bool))); connect(qbsProject(), &QbsProject::projectParsingDone, this, &QbsBuildStep::reparsingDone);
qbsProject()->parseCurrentBuildConfiguration(); qbsProject()->parseCurrentBuildConfiguration();
} }
@@ -419,15 +421,15 @@ void QbsBuildStep::build()
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(buildingDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsBuildStep::buildingDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsBuildStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsBuildStep::handleProgress);
connect(m_job, SIGNAL(reportCommandDescription(QString,QString)), connect(m_job, &qbs::BuildJob::reportCommandDescription,
this, SLOT(handleCommandDescriptionReport(QString,QString))); this, &QbsBuildStep::handleCommandDescriptionReport);
connect(m_job, SIGNAL(reportProcessResult(qbs::ProcessResult)), connect(m_job, &qbs::BuildJob::reportProcessResult,
this, SLOT(handleProcessResultReport(qbs::ProcessResult))); this, &QbsBuildStep::handleProcessResultReport);
} }
@@ -455,9 +457,12 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
m_step(step), m_step(step),
m_ignoreChange(false) m_ignoreChange(false)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(qbsConfigurationChanged()), this, SLOT(updateState())); this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, SIGNAL(qbsBuildOptionsChanged()), this, SLOT(updateState())); connect(m_step, &QbsBuildStep::qbsConfigurationChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(m_step, &QbsBuildStep::qbsBuildOptionsChanged,
this, &QbsBuildStepConfigWidget::updateState);
connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged, connect(&QbsProjectManagerSettings::instance(), &QbsProjectManagerSettings::settingsBaseChanged,
this, &QbsBuildStepConfigWidget::updateState); this, &QbsBuildStepConfigWidget::updateState);
connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged, connect(step->buildConfiguration()->target(), &ProjectExplorer::Target::buildDirectoryChanged,
@@ -474,10 +479,13 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
}); });
m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap()); m_ui->qmlDebuggingWarningText->setPixmap(Core::Icons::WARNING.pixmap());
connect(m_ui->buildVariantComboBox, SIGNAL(currentIndexChanged(int)), connect(m_ui->buildVariantComboBox,
this, SLOT(changeBuildVariant(int))); static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); this, &QbsBuildStepConfigWidget::changeBuildVariant);
connect(m_ui->jobSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeJobCount(int))); connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsBuildStepConfigWidget::changeKeepGoing);
connect(m_ui->jobSpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &QbsBuildStepConfigWidget::changeJobCount);
connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this, connect(m_ui->showCommandLinesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeShowCommandLines); &QbsBuildStepConfigWidget::changeShowCommandLines);
connect(m_ui->installCheckBox, &QCheckBox::toggled, this, connect(m_ui->installCheckBox, &QCheckBox::toggled, this,
@@ -486,10 +494,10 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step) :
&QbsBuildStepConfigWidget::changeCleanInstallRoot); &QbsBuildStepConfigWidget::changeCleanInstallRoot);
connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this, connect(m_ui->forceProbesCheckBox, &QCheckBox::toggled, this,
&QbsBuildStepConfigWidget::changeForceProbes); &QbsBuildStepConfigWidget::changeForceProbes);
connect(m_ui->qmlDebuggingLibraryCheckBox, SIGNAL(toggled(bool)), connect(m_ui->qmlDebuggingLibraryCheckBox, &QAbstractButton::toggled,
this, SLOT(linkQmlDebuggingLibraryChecked(bool))); this, &QbsBuildStepConfigWidget::linkQmlDebuggingLibraryChecked);
connect(QtSupport::QtVersionManager::instance(), SIGNAL(dumpUpdatedFor(Utils::FileName)), connect(QtSupport::QtVersionManager::instance(), &QtSupport::QtVersionManager::dumpUpdatedFor,
this, SLOT(updateQmlDebuggingOption())); this, &QbsBuildStepConfigWidget::updateQmlDebuggingOption);
updateState(); updateState();
} }

View File

@@ -80,7 +80,7 @@ signals:
void qbsConfigurationChanged(); void qbsConfigurationChanged();
void qbsBuildOptionsChanged(); void qbsBuildOptionsChanged();
private slots: private:
void buildingDone(bool success); void buildingDone(bool success);
void reparsingDone(bool success); void reparsingDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
@@ -88,7 +88,6 @@ private slots:
void handleCommandDescriptionReport(const QString &highlight, const QString &message); void handleCommandDescriptionReport(const QString &highlight, const QString &message);
void handleProcessResultReport(const qbs::ProcessResult &result); void handleProcessResultReport(const qbs::ProcessResult &result);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -137,7 +136,7 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void updateQmlDebuggingOption(); void updateQmlDebuggingOption();
void updatePropertyEdit(const QVariantMap &data); void updatePropertyEdit(const QVariantMap &data);
@@ -154,7 +153,6 @@ private slots:
// QML debugging: // QML debugging:
void linkQmlDebuggingLibraryChecked(bool checked); void linkQmlDebuggingLibraryChecked(bool checked);
private:
bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage); bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage);
Ui::QbsBuildStepConfigWidget *m_ui; Ui::QbsBuildStepConfigWidget *m_ui;

View File

@@ -106,11 +106,11 @@ void QbsCleanStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(cleaningDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsCleanStep::cleaningDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsCleanStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsCleanStep::handleProgress);
} }
ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget() ProjectExplorer::BuildStepConfigWidget *QbsCleanStep::createConfigWidget()
@@ -233,16 +233,20 @@ void QbsCleanStep::setMaxJobs(int jobcount)
QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) : QbsCleanStepConfigWidget::QbsCleanStepConfigWidget(QbsCleanStep *step) :
m_step(step) m_step(step)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); this, &QbsCleanStepConfigWidget::updateState);
connect(m_step, &QbsCleanStep::changed,
this, &QbsCleanStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
m_ui = new Ui::QbsCleanStepConfigWidget; m_ui = new Ui::QbsCleanStepConfigWidget;
m_ui->setupUi(this); m_ui->setupUi(this);
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); connect(m_ui->dryRunCheckBox, &QAbstractButton::toggled,
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); this, &QbsCleanStepConfigWidget::changeDryRun);
connect(m_ui->keepGoingCheckBox, &QAbstractButton::toggled,
this, &QbsCleanStepConfigWidget::changeKeepGoing);
updateState(); updateState();
} }

View File

@@ -65,12 +65,11 @@ public:
signals: signals:
void changed(); void changed();
private slots: private:
void cleaningDone(bool success); void cleaningDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value); void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -100,14 +99,13 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void changeDryRun(bool dr); void changeDryRun(bool dr);
void changeKeepGoing(bool kg); void changeKeepGoing(bool kg);
void changeJobCount(int jobcount); void changeJobCount(int jobcount);
private:
Ui::QbsCleanStepConfigWidget *m_ui; Ui::QbsCleanStepConfigWidget *m_ui;
QbsCleanStep *m_step; QbsCleanStep *m_step;

View File

@@ -99,11 +99,11 @@ void QbsInstallStep::run(QFutureInterface<bool> &fi)
m_progressBase = 0; m_progressBase = 0;
connect(m_job, SIGNAL(finished(bool,qbs::AbstractJob*)), this, SLOT(installDone(bool))); connect(m_job, &qbs::AbstractJob::finished, this, &QbsInstallStep::installDone);
connect(m_job, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskStarted,
this, SLOT(handleTaskStarted(QString,int))); this, &QbsInstallStep::handleTaskStarted);
connect(m_job, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_job, &qbs::AbstractJob::taskProgress,
this, SLOT(handleProgress(int))); this, &QbsInstallStep::handleProgress);
} }
ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget() ProjectExplorer::BuildStepConfigWidget *QbsInstallStep::createConfigWidget()
@@ -261,8 +261,10 @@ void QbsInstallStep::setKeepGoing(bool kg)
QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) : QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_step(step), m_ignoreChange(false) m_step(step), m_ignoreChange(false)
{ {
connect(m_step, SIGNAL(displayNameChanged()), this, SLOT(updateState())); connect(m_step, &ProjectExplorer::ProjectConfiguration::displayNameChanged,
connect(m_step, SIGNAL(changed()), this, SLOT(updateState())); this, &QbsInstallStepConfigWidget::updateState);
connect(m_step, &QbsInstallStep::changed,
this, &QbsInstallStepConfigWidget::updateState);
setContentsMargins(0, 0, 0, 0); setContentsMargins(0, 0, 0, 0);
@@ -275,13 +277,17 @@ QbsInstallStepConfigWidget::QbsInstallStepConfigWidget(QbsInstallStep *step) :
m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory); m_ui->installRootChooser->setExpectedKind(Utils::PathChooser::Directory);
m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History")); m_ui->installRootChooser->setHistoryCompleter(QLatin1String("Qbs.InstallRoot.History"));
connect(m_ui->installRootChooser, SIGNAL(rawPathChanged(QString)), this, connect(m_ui->installRootChooser, &Utils::PathChooser::rawPathChanged, this,
SLOT(changeInstallRoot())); &QbsInstallStepConfigWidget::changeInstallRoot);
connect(m_ui->removeFirstCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeRemoveFirst(bool))); connect(m_ui->removeFirstCheckBox, &QAbstractButton::toggled,
connect(m_ui->dryRunCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeDryRun(bool))); this, &QbsInstallStepConfigWidget::changeRemoveFirst);
connect(m_ui->keepGoingCheckBox, SIGNAL(toggled(bool)), this, SLOT(changeKeepGoing(bool))); 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(); updateState();
} }

View File

@@ -68,12 +68,11 @@ public:
signals: signals:
void changed(); void changed();
private slots: private:
void installDone(bool success); void installDone(bool success);
void handleTaskStarted(const QString &desciption, int max); void handleTaskStarted(const QString &desciption, int max);
void handleProgress(int value); void handleProgress(int value);
private:
void createTaskAndOutput(ProjectExplorer::Task::TaskType type, void createTaskAndOutput(ProjectExplorer::Task::TaskType type,
const QString &message, const QString &file, int line); const QString &message, const QString &file, int line);
@@ -104,7 +103,7 @@ public:
QString summaryText() const; QString summaryText() const;
QString displayName() const; QString displayName() const;
private slots: private:
void updateState(); void updateState();
void changeInstallRoot(); void changeInstallRoot();

View File

@@ -36,6 +36,8 @@
#include <QMutexLocker> #include <QMutexLocker>
#include <QTimer> #include <QTimer>
using namespace ProjectExplorer;
namespace QbsProjectManager { namespace QbsProjectManager {
namespace Internal { namespace Internal {
@@ -45,9 +47,9 @@ namespace Internal {
QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent) QbsLogSink::QbsLogSink(QObject *parent) : QObject(parent)
{ {
connect(this, SIGNAL(newTask(ProjectExplorer::Task)), connect(this, &QbsLogSink::newTask,
ProjectExplorer::TaskHub::instance(), TaskHub::instance(),
SLOT(addTask(ProjectExplorer::Task)), Qt::QueuedConnection); [](const Task &task) { TaskHub::addTask(task); }, Qt::QueuedConnection);
} }
void QbsLogSink::sendMessages() void QbsLogSink::sendMessages()
@@ -66,11 +68,11 @@ void QbsLogSink::sendMessages()
void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning) void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning)
{ {
foreach (const qbs::ErrorItem &item, warning.items()) foreach (const qbs::ErrorItem &item, warning.items())
emit newTask(ProjectExplorer::Task(ProjectExplorer::Task::Warning, emit newTask(Task(Task::Warning,
item.description(), item.description(),
Utils::FileName::fromString(item.codeLocation().filePath()), Utils::FileName::fromString(item.codeLocation().filePath()),
item.codeLocation().line(), item.codeLocation().line(),
ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); Constants::TASK_CATEGORY_BUILDSYSTEM));
} }
void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag) void QbsLogSink::doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag)

View File

@@ -45,10 +45,9 @@ public:
signals: signals:
void newTask(const ProjectExplorer::Task &task); void newTask(const ProjectExplorer::Task &task);
private slots:
void sendMessages();
private: private:
Q_INVOKABLE void sendMessages();
void doPrintWarning(const qbs::ErrorInfo &warning); void doPrintWarning(const qbs::ErrorInfo &warning);
void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag); void doPrintMessage(qbs::LoggerLevel level, const QString &message, const QString &tag);

View File

@@ -41,12 +41,10 @@ class QbsParser : public ProjectExplorer::IOutputParser
public: public:
explicit QbsParser(); explicit QbsParser();
private:
void setWorkingDirectory(const QString &workingDirectory); void setWorkingDirectory(const QString &workingDirectory);
public slots:
void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines); void taskAdded(const ProjectExplorer::Task &task, int linkedLines, int skipLines);
private:
QDir m_workingDirectory; QDir m_workingDirectory;
}; };

View File

@@ -54,12 +54,10 @@ public:
void apply(); void apply();
private slots: private:
void refreshKitsList(); void refreshKitsList();
void displayCurrentProfile(); void displayCurrentProfile();
void editProfile(); void editProfile();
private:
void setupCustomProperties(const ProjectExplorer::Kit *kit); void setupCustomProperties(const ProjectExplorer::Kit *kit);
void mergeCustomPropertiesIntoModel(); void mergeCustomPropertiesIntoModel();
@@ -123,9 +121,12 @@ QbsProfilesSettingsWidget::QbsProfilesSettingsWidget(QWidget *parent)
m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir()); m_model.updateSettingsDir(QbsProjectManagerSettings::qbsSettingsBaseDir());
displayCurrentProfile(); displayCurrentProfile();
}); });
connect(m_ui.expandButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(expandAll())); connect(m_ui.expandButton, &QAbstractButton::clicked,
connect(m_ui.collapseButton, SIGNAL(clicked()), m_ui.propertiesView, SLOT(collapseAll())); m_ui.propertiesView, &QTreeView::expandAll);
connect(m_ui.editButton, SIGNAL(clicked()), SLOT(editProfile())); connect(m_ui.collapseButton, &QAbstractButton::clicked,
m_ui.propertiesView, &QTreeView::collapseAll);
connect(m_ui.editButton, &QAbstractButton::clicked,
this, &QbsProfilesSettingsWidget::editProfile);
refreshKitsList(); refreshKitsList();
} }
@@ -175,7 +176,9 @@ void QbsProfilesSettingsWidget::refreshKitsList()
else if (hasKits) else if (hasKits)
m_ui.kitsComboBox->setCurrentIndex(0); m_ui.kitsComboBox->setCurrentIndex(0);
displayCurrentProfile(); displayCurrentProfile();
connect(m_ui.kitsComboBox, SIGNAL(currentIndexChanged(int)), SLOT(displayCurrentProfile())); connect(m_ui.kitsComboBox,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &QbsProfilesSettingsWidget::displayCurrentProfile);
} }
void QbsProfilesSettingsWidget::displayCurrentProfile() void QbsProfilesSettingsWidget::displayCurrentProfile()

View File

@@ -117,13 +117,11 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
setProjectContext(Context(Constants::PROJECT_ID)); setProjectContext(Context(Constants::PROJECT_ID));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX)); setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), connect(this, &Project::activeTargetChanged, this, &QbsProject::changeActiveTarget);
this, SLOT(changeActiveTarget(ProjectExplorer::Target*))); connect(this, &Project::addedTarget, this, &QbsProject::targetWasAdded);
connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)), connect(this, &Project::environmentChanged, this, &QbsProject::delayParsing);
this, SLOT(targetWasAdded(ProjectExplorer::Target*)));
connect(this, SIGNAL(environmentChanged()), this, SLOT(delayParsing()));
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing())); connect(&m_parsingDelay, &QTimer::timeout, this, &QbsProject::startParsing);
} }
QbsProject::~QbsProject() QbsProject::~QbsProject()
@@ -531,9 +529,8 @@ void QbsProject::handleRuleExecutionDone()
void QbsProject::targetWasAdded(Target *t) void QbsProject::targetWasAdded(Target *t)
{ {
connect(t, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)), connect(t, &Target::activeBuildConfigurationChanged, this, &QbsProject::delayParsing);
this, SLOT(delayParsing())); connect(t, &Target::buildDirectoryChanged, this, &QbsProject::delayParsing);
connect(t, SIGNAL(buildDirectoryChanged()), this, SLOT(delayParsing()));
} }
void QbsProject::changeActiveTarget(Target *t) void QbsProject::changeActiveTarget(Target *t)
@@ -547,11 +544,13 @@ void QbsProject::changeActiveTarget(Target *t)
void QbsProject::buildConfigurationChanged(BuildConfiguration *bc) void QbsProject::buildConfigurationChanged(BuildConfiguration *bc)
{ {
if (m_currentBc) if (m_currentBc)
disconnect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing())); disconnect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
this, &QbsProject::delayParsing);
m_currentBc = qobject_cast<QbsBuildConfiguration *>(bc); m_currentBc = qobject_cast<QbsBuildConfiguration *>(bc);
if (m_currentBc) { if (m_currentBc) {
connect(m_currentBc, SIGNAL(qbsConfigurationChanged()), this, SLOT(delayParsing())); connect(m_currentBc, &QbsBuildConfiguration::qbsConfigurationChanged,
this, &QbsProject::delayParsing);
delayParsing(); delayParsing();
} else { } else {
invalidate(); invalidate();
@@ -640,7 +639,8 @@ void QbsProject::registerQbsProjectParser(QbsProjectParser *p)
if (p) { if (p) {
connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone, connect(m_qbsProjectParser, &QbsProjectParser::ruleExecutionDone,
this, &QbsProject::handleRuleExecutionDone); this, &QbsProject::handleRuleExecutionDone);
connect(m_qbsProjectParser, SIGNAL(done(bool)), this, SLOT(handleQbsParsingDone(bool))); connect(m_qbsProjectParser, &QbsProjectParser::done,
this, &QbsProject::handleQbsParsingDone);
} }
} }

View File

@@ -106,7 +106,7 @@ public:
const qbs::ProductData &product); const qbs::ProductData &product);
static QString uniqueProductName(const qbs::ProductData &product); static QString uniqueProductName(const qbs::ProductData &product);
public slots: public:
void invalidate(); void invalidate();
void delayParsing(); void delayParsing();
@@ -114,7 +114,7 @@ signals:
void projectParsingStarted(); void projectParsingStarted();
void projectParsingDone(bool); void projectParsingDone(bool);
private slots: private:
void handleQbsParsingDone(bool success); void handleQbsParsingDone(bool success);
void targetWasAdded(ProjectExplorer::Target *t); void targetWasAdded(ProjectExplorer::Target *t);
@@ -122,7 +122,6 @@ private slots:
void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc); void buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc);
void startParsing(); void startParsing();
private:
RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override; RestoreResult fromMap(const QVariantMap &map, QString *errorMessage) override;
void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir); void parse(const QVariantMap &config, const Utils::Environment &env, const QString &dir);

View File

@@ -127,19 +127,22 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext); command = Core::ActionManager::registerAction(m_reparseQbs, Constants::ACTION_REPARSE_QBS, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_reparseQbsCtx = new QAction(tr("Reparse Qbs"), this);
command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_reparseQbsCtx, Constants::ACTION_REPARSE_QBS_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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); m_buildFileCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildFileCtx, Constants::ACTION_BUILD_FILE_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); 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\""), m_buildFile = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -149,13 +152,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_buildProductCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildProductCtx, Constants::ACTION_BUILD_PRODUCT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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\""), m_buildProduct = new Utils::ParameterAction(tr("Build Product"), tr("Build Product \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -165,13 +169,14 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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); m_buildSubprojectCtx = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext); command = Core::ActionManager::registerAction(m_buildSubprojectCtx, Constants::ACTION_BUILD_SUBPROJECT_CONTEXT, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); 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\""), m_buildSubproject = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -181,24 +186,24 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
command->setDescription(m_buildFile->text()); command->setDescription(m_buildFile->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); 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
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged, connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged,
this, &QbsProjectManagerPlugin::nodeSelectionChanged); this, &QbsProjectManagerPlugin::nodeSelectionChanged);
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), connect(BuildManager::instance(), &BuildManager::buildStateChanged,
this, SLOT(buildStateChanged(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::buildStateChanged);
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)), connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
this, SLOT(currentEditorChanged())); this, &QbsProjectManagerPlugin::currentEditorChanged);
connect(SessionManager::instance(), SIGNAL(projectAdded(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::projectAdded,
this, SLOT(projectWasAdded(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::projectWasAdded);
connect(SessionManager::instance(), SIGNAL(projectRemoved(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::projectRemoved,
this, SLOT(projectWasRemoved())); this, &QbsProjectManagerPlugin::projectWasRemoved);
connect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
this, SLOT(currentProjectWasChanged(ProjectExplorer::Project*))); this, &QbsProjectManagerPlugin::currentProjectWasChanged);
// Run initial setup routines // Run initial setup routines
updateContextActions(); updateContextActions();
@@ -218,8 +223,10 @@ void QbsProjectManagerPlugin::projectWasAdded(Project *project)
if (!qbsProject) if (!qbsProject)
return; return;
connect(qbsProject, SIGNAL(projectParsingStarted()), this, SLOT(parsingStateChanged())); connect(qbsProject, &QbsProject::projectParsingStarted,
connect(qbsProject, SIGNAL(projectParsingDone(bool)), this, SLOT(parsingStateChanged())); this, &QbsProjectManagerPlugin::parsingStateChanged);
connect(qbsProject, &QbsProject::projectParsingDone,
this, &QbsProjectManagerPlugin::parsingStateChanged);
} }
void QbsProjectManagerPlugin::currentProjectWasChanged(Project *project) void QbsProjectManagerPlugin::currentProjectWasChanged(Project *project)

View File

@@ -58,7 +58,7 @@ public:
void extensionsInitialized(); void extensionsInitialized();
private slots: private:
void projectWasAdded(ProjectExplorer::Project *project); void projectWasAdded(ProjectExplorer::Project *project);
void currentProjectWasChanged(ProjectExplorer::Project *project); void currentProjectWasChanged(ProjectExplorer::Project *project);
void projectWasRemoved(); void projectWasRemoved();
@@ -78,7 +78,6 @@ private slots:
void reparseCurrentProject(); void reparseCurrentProject();
void reparseProject(QbsProject *project); void reparseProject(QbsProject *project);
private:
void updateContextActions(); void updateContextActions();
void updateReparseQbsAction(); void updateReparseQbsAction();
void updateBuildActions(); void updateBuildActions();

View File

@@ -111,12 +111,12 @@ void QbsProjectParser::parse(const QVariantMap &config, const Environment &env,
m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0); m_qbsSetupProjectJob = m_project.setupProject(params, QbsManager::logSink(), 0);
connect(m_qbsSetupProjectJob, SIGNAL(finished(bool,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::finished,
this, SLOT(handleQbsParsingDone(bool))); this, &QbsProjectParser::handleQbsParsingDone);
connect(m_qbsSetupProjectJob, SIGNAL(taskStarted(QString,int,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskStarted,
this, SLOT(handleQbsParsingTaskSetup(QString,int))); this, &QbsProjectParser::handleQbsParsingTaskSetup);
connect(m_qbsSetupProjectJob, SIGNAL(taskProgress(int,qbs::AbstractJob*)), connect(m_qbsSetupProjectJob, &qbs::AbstractJob::taskProgress,
this, SLOT(handleQbsParsingProgress(int))); this, &QbsProjectParser::handleQbsParsingProgress);
} }
void QbsProjectParser::cancel() void QbsProjectParser::cancel()

View File

@@ -57,12 +57,11 @@ signals:
void done(bool success); void done(bool success);
void ruleExecutionDone(); void ruleExecutionDone();
private slots: private:
void handleQbsParsingDone(bool success); void handleQbsParsingDone(bool success);
void handleQbsParsingProgress(int progress); void handleQbsParsingProgress(int progress);
void handleQbsParsingTaskSetup(const QString &description, int maximumProgressValue); void handleQbsParsingTaskSetup(const QString &description, int maximumProgressValue);
private:
QString pluginsBaseDirectory() const; QString pluginsBaseDirectory() const;
QString resourcesBaseDirectory() const; QString resourcesBaseDirectory() const;
QString libExecDirectory() const; QString libExecDirectory() const;

View File

@@ -85,11 +85,9 @@ signals:
protected: protected:
QbsRunConfiguration(ProjectExplorer::Target *parent, QbsRunConfiguration *source); QbsRunConfiguration(ProjectExplorer::Target *parent, QbsRunConfiguration *source);
private slots: private:
void installStepChanged(); void installStepChanged();
void installStepToBeRemoved(int pos); void installStepToBeRemoved(int pos);
private:
QString baseWorkingDirectory() const; QString baseWorkingDirectory() const;
QString defaultDisplayName(); QString defaultDisplayName();
qbs::InstallOptions installOptions() const; qbs::InstallOptions installOptions() const;

View File

@@ -72,6 +72,7 @@ const char resetPositionDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMen
const char goIntoComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go into Component"); const char goIntoComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go into Component");
const char goToImplementationDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go to Implementation"); 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 moveToComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Move to Component");
const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set Id"); const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set Id");

View File

@@ -509,10 +509,11 @@ void DesignerActionManager::createDefaultDesignerActions()
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction
(goIntoComponentDisplayName, rootCategory, priorityGoIntoComponent, &goIntoComponent, &selectionIsComponent)); (goIntoComponentDisplayName, rootCategory, priorityGoIntoComponent, &goIntoComponent, &selectionIsComponent));
addDesignerAction(new ModelNodeAction 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 addDesignerAction(new ModelNodeAction
(moveToComponentDisplayName, rootCategory, 44, &moveToComponent, &singleSelection, &singleSelection)); (moveToComponentDisplayName, rootCategory, 44, &moveToComponent, &singleSelection, &singleSelection));
} }
void DesignerActionManager::addDesignerAction(ActionInterface *newAction) void DesignerActionManager::addDesignerAction(ActionInterface *newAction)

View File

@@ -637,7 +637,7 @@ static QStringList getSortedSignalNameList(const ModelNode &modelNode)
return signalNames; return signalNames;
} }
void gotoImplementation(const SelectionContext &selectionState) void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState, bool addAlwaysNewSlot)
{ {
ModelNode modelNode; ModelNode modelNode;
if (selectionState.singleNodeIsSelected()) if (selectionState.singleNodeIsSelected())
@@ -687,7 +687,7 @@ void gotoImplementation(const SelectionContext &selectionState)
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT); 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); Core::EditorManager::openEditorAt(usages.first().path, usages.first().line, usages.first().col);
if (!signalNames.isEmpty()) { if (!signalNames.isEmpty()) {
@@ -782,6 +782,16 @@ void moveToComponent(const SelectionContext &selectionContext)
selectionContext.view()->model()->rewriterView()->moveToComponent(modelNode); selectionContext.view()->model()->rewriterView()->moveToComponent(modelNode);
} }
void goImplementation(const SelectionContext &selectionState)
{
addSignalHandlerOrGotoImplementation(selectionState, false);
}
void addNewSignalHandler(const SelectionContext &selectionState)
{
addSignalHandlerOrGotoImplementation(selectionState, true);
}
} // namespace Mode } // namespace Mode
} //QmlDesigner } //QmlDesigner

View File

@@ -63,7 +63,9 @@ void layoutFlowPositioner(const SelectionContext &selectionState);
void layoutRowLayout(const SelectionContext &selectionState); void layoutRowLayout(const SelectionContext &selectionState);
void layoutColumnLayout(const SelectionContext &selectionState); void layoutColumnLayout(const SelectionContext &selectionState);
void layoutGridLayout(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 removeLayout(const SelectionContext &selectionContext);
void removePositioner(const SelectionContext &selectionContext); void removePositioner(const SelectionContext &selectionContext);
void moveToComponent(const SelectionContext &selectionContext); void moveToComponent(const SelectionContext &selectionContext);

View File

@@ -46,6 +46,8 @@
#include <qtsupport/qtversionmanager.h> #include <qtsupport/qtversionmanager.h>
#include <coreplugin/idocument.h> #include <coreplugin/idocument.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
#include <QFileInfo> #include <QFileInfo>
#include <QUrl> #include <QUrl>
#include <QDebug> #include <QDebug>
@@ -170,7 +172,7 @@ QList<RewriterError> DesignDocument::qmlParseWarnings() const
bool DesignDocument::hasQmlParseWarnings() const bool DesignDocument::hasQmlParseWarnings() const
{ {
return m_rewriterView->warnings().isEmpty(); return !m_rewriterView->warnings().isEmpty();
} }
QList<RewriterError> DesignDocument::qmlParseErrors() const QList<RewriterError> DesignDocument::qmlParseErrors() const
@@ -180,7 +182,7 @@ QList<RewriterError> DesignDocument::qmlParseErrors() const
bool DesignDocument::hasQmlParseErrors() const bool DesignDocument::hasQmlParseErrors() const
{ {
return m_rewriterView->errors().isEmpty(); return !m_rewriterView->errors().isEmpty();
} }
QString DesignDocument::displayName() const QString DesignDocument::displayName() const
@@ -243,12 +245,17 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit)
this, SIGNAL(dirtyStateChanged(bool))); this, SIGNAL(dirtyStateChanged(bool)));
m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit()))); m_documentTextModifier.reset(new BaseTextEditModifier(dynamic_cast<TextEditor::TextEditorWidget*>(plainTextEdit())));
connect(m_documentTextModifier.data(), &TextModifier::textChanged, this, &DesignDocument::updateQrcFiles);
m_documentModel->setTextModifier(m_documentTextModifier.data()); m_documentModel->setTextModifier(m_documentTextModifier.data());
m_inFileComponentTextModifier.reset(); m_inFileComponentTextModifier.reset();
updateFileName(Utils::FileName(), fileName()); updateFileName(Utils::FileName(), fileName());
updateQrcFiles();
m_documentLoaded = true; m_documentLoaded = true;
} }
@@ -277,6 +284,18 @@ void DesignDocument::changeToInFileComponentModel(ComponentTextModifier *textMod
viewManager().attachViewsExceptRewriterAndComponetView(); 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) void DesignDocument::changeToSubComponent(const ModelNode &componentNode)
{ {
if (QmlDesignerPlugin::instance()->currentDesignDocument() != this) if (QmlDesignerPlugin::instance()->currentDesignDocument() != this)

View File

@@ -124,6 +124,8 @@ private slots:
private: // functions private: // functions
void changeToInFileComponentModel(ComponentTextModifier *textModifer); void changeToInFileComponentModel(ComponentTextModifier *textModifer);
void updateQrcFiles();
QWidget *centralWidget() const; QWidget *centralWidget() const;
QString pathToQt() const; QString pathToQt() const;

View File

@@ -40,6 +40,8 @@
#include <qmljs/qmljsvalueowner.h> #include <qmljs/qmljsvalueowner.h>
#include <languageutils/fakemetaobject.h> #include <languageutils/fakemetaobject.h>
#include <utils/qtcassert.h>
namespace QmlDesigner { namespace QmlDesigner {
namespace Internal { namespace Internal {
@@ -565,6 +567,9 @@ private:
const CppComponentValue *getNearestCppComponentValue() const; const CppComponentValue *getNearestCppComponentValue() const;
QString fullQualifiedImportAliasType() const; QString fullQualifiedImportAliasType() const;
void ensureProperties() const;
void initialiseProperties();
TypeName m_qualfiedTypeName; TypeName m_qualfiedTypeName;
int m_majorVersion; int m_majorVersion;
int m_minorVersion; int m_minorVersion;
@@ -585,6 +590,8 @@ private:
QPointer<Model> m_model; QPointer<Model> m_model;
static QHash<TypeName, Pointer> m_nodeMetaInfoCache; static QHash<TypeName, Pointer> m_nodeMetaInfoCache;
const ObjectValue *m_objectValue = nullptr;
bool m_propertiesSetup = false;
}; };
QHash<TypeName, NodeMetaInfoPrivate::Pointer> NodeMetaInfoPrivate::m_nodeMetaInfoCache; QHash<TypeName, NodeMetaInfoPrivate::Pointer> NodeMetaInfoPrivate::m_nodeMetaInfoCache;
@@ -596,16 +603,21 @@ bool NodeMetaInfoPrivate::isFileComponent() const
PropertyNameList NodeMetaInfoPrivate::properties() const PropertyNameList NodeMetaInfoPrivate::properties() const
{ {
ensureProperties();
return m_properties; return m_properties;
} }
PropertyNameList NodeMetaInfoPrivate::localProperties() const PropertyNameList NodeMetaInfoPrivate::localProperties() const
{ {
ensureProperties();
return m_localProperties; return m_localProperties;
} }
PropertyNameList NodeMetaInfoPrivate::signalNames() const PropertyNameList NodeMetaInfoPrivate::signalNames() const
{ {
ensureProperties();
return m_signals; return m_signals;
} }
@@ -670,12 +682,10 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i
m_majorVersion = cppObjectValue->componentVersion().majorVersion(); m_majorVersion = cppObjectValue->componentVersion().majorVersion();
m_minorVersion = cppObjectValue->componentVersion().minorVersion(); m_minorVersion = cppObjectValue->componentVersion().minorVersion();
} }
setupPropertyInfo(getTypes(cppObjectValue, context())); m_objectValue = cppObjectValue;
setupLocalPropertyInfo(getTypes(cppObjectValue, context(), true));
m_defaultPropertyName = cppObjectValue->defaultPropertyName().toUtf8(); m_defaultPropertyName = cppObjectValue->defaultPropertyName().toUtf8();
m_isValid = true; m_isValid = true;
setupPrototypes(); setupPrototypes();
m_signals = getSignals(cppObjectValue, context());
} else { } else {
const ObjectValue *objectValue = getObjectValue(); const ObjectValue *objectValue = getObjectValue();
if (objectValue) { if (objectValue) {
@@ -699,12 +709,10 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, TypeName type, int maj, i
m_minorVersion = importInfo.version().minorVersion(); m_minorVersion = importInfo.version().minorVersion();
} }
} }
setupPropertyInfo(getTypes(objectValue, context())); m_objectValue = objectValue;
setupLocalPropertyInfo(getTypes(objectValue, context(), true));
m_defaultPropertyName = context()->defaultPropertyName(objectValue).toUtf8(); m_defaultPropertyName = context()->defaultPropertyName(objectValue).toUtf8();
m_isValid = true; m_isValid = true;
setupPrototypes(); setupPrototypes();
m_signals = getSignals(objectValue, context());
} }
} }
} }
@@ -803,6 +811,8 @@ bool NodeMetaInfoPrivate::isPropertyWritable(const PropertyName &propertyName) c
if (!isValid()) if (!isValid())
return false; return false;
ensureProperties();
if (propertyName.contains('.')) { if (propertyName.contains('.')) {
const PropertyNameList parts = propertyName.split('.'); const PropertyNameList parts = propertyName.split('.');
const PropertyName objectName = parts.first(); const PropertyName objectName = parts.first();
@@ -834,6 +844,8 @@ bool NodeMetaInfoPrivate::isPropertyList(const PropertyName &propertyName) const
if (!isValid()) if (!isValid())
return false; return false;
ensureProperties();
if (propertyName.contains('.')) { if (propertyName.contains('.')) {
const PropertyNameList parts = propertyName.split('.'); const PropertyNameList parts = propertyName.split('.');
const PropertyName objectName = parts.first(); const PropertyName objectName = parts.first();
@@ -861,6 +873,8 @@ bool NodeMetaInfoPrivate::isPropertyPointer(const PropertyName &propertyName) co
if (!isValid()) if (!isValid())
return false; return false;
ensureProperties();
if (propertyName.contains('.')) { if (propertyName.contains('.')) {
const PropertyNameList parts = propertyName.split('.'); const PropertyNameList parts = propertyName.split('.');
const PropertyName objectName = parts.first(); const PropertyName objectName = parts.first();
@@ -888,6 +902,8 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const
if (!isValid()) if (!isValid())
return false; return false;
ensureProperties();
if (propertyType(propertyName).contains("Qt::")) if (propertyType(propertyName).contains("Qt::"))
return true; return true;
@@ -918,6 +934,8 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName)
if (!isValid()) if (!isValid())
return QString(); return QString();
ensureProperties();
if (propertyType(propertyName).contains("Qt::")) if (propertyType(propertyName).contains("Qt::"))
return QStringLiteral("Qt"); return QStringLiteral("Qt");
@@ -1262,6 +1280,29 @@ QString NodeMetaInfoPrivate::fullQualifiedImportAliasType() const
return QString::fromUtf8(m_qualfiedTypeName); return QString::fromUtf8(m_qualfiedTypeName);
} }
void NodeMetaInfoPrivate::ensureProperties() const
{
if (m_propertiesSetup)
return;
const_cast<NodeMetaInfoPrivate*>(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 } //namespace Internal
NodeMetaInfo::NodeMetaInfo() : m_privateData(new Internal::NodeMetaInfoPrivate()) NodeMetaInfo::NodeMetaInfo() : m_privateData(new Internal::NodeMetaInfoPrivate())

View File

@@ -27,6 +27,8 @@
#include <abstractview.h> #include <abstractview.h>
#include <rewriterview.h> #include <rewriterview.h>
#include <utils/qtcassert.h>
#ifndef QMLDESIGNER_TEST #ifndef QMLDESIGNER_TEST
#include <designdocument.h> #include <designdocument.h>
#include <qmldesignerplugin.h> #include <qmldesignerplugin.h>
@@ -82,13 +84,22 @@ void RewriterTransaction::commit()
{ {
if (m_valid) { if (m_valid) {
m_valid = false; m_valid = false;
bool oldSemanticChecks = view()->rewriterView()->checkSemanticErrors();
if (m_ignoreSemanticChecks) RewriterView *rewriterView = view()->rewriterView();
view()->rewriterView()->setCheckSemanticErrors(false);
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()->emitRewriterEndTransaction();
view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks); if (rewriterView)
view()->rewriterView()->setCheckSemanticErrors(oldSemanticChecks);
if (m_activeIdentifier) { if (m_activeIdentifier) {
qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber; qDebug() << "Commit RewriterTransaction:" << m_identifier << m_identifierNumber;

View File

@@ -57,8 +57,10 @@ void QmlJSOutlineTreeView::contextMenuEvent(QContextMenuEvent *event)
QMenu contextMenu; QMenu contextMenu;
contextMenu.addAction(tr("Expand All"), this, [this] { expandAll(); }); connect(contextMenu.addAction(tr("Expand All")), &QAction::triggered,
contextMenu.addAction(tr("Collapse All"), this, [this] { collapseAllExceptRoot(); }); this, &QmlJSOutlineTreeView::expandAll);
connect(contextMenu.addAction(tr("Collapse All")), &QAction::triggered,
this, &QmlJSOutlineTreeView::collapseAllExceptRoot);
contextMenu.exec(event->globalPos()); contextMenu.exec(event->globalPos());

View File

@@ -341,8 +341,14 @@ void BaseQtVersion::setupExpander()
[this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_DEMOS"); }); [this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_DEMOS"); });
m_expander.registerVariable("Qt:QMAKE_MKSPECS", 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"); }); [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", m_expander.registerVariable("Qt:QMAKE_VERSION",
QtKitInformation::tr("The current Qt's qmake version."), QtKitInformation::tr("The current Qt's qmake version."),

View File

@@ -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); QmlDesigner::Model *model = QmlDesigner::Model::create(typeName.toUtf8(), major, minor, metaInfoPropxyModel);
QPlainTextEdit *textEdit = new QPlainTextEdit; 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()) textEdit->setPlainText(QString("import %1 %3.%4; %2{}").arg(typeName.split(".").first())
.arg(typeName.split(".").last()) .arg(typeName.split(".").last())
.arg(major) .arg(major)

View File

@@ -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.
**
****************************************************************************/
<?xml version="1.0" encoding="UTF-8"?>
<QWidget id="Form" x="300" y="200" width="455" height="376">
<QPushButton id="pushButton" x="10" y="30" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="toolButton" x="20" y="170" width="27" height="23">
<text><?i18n?>...</text>
</QPushButton>
<QPushButton id="pushButton_2" x="180" y="170" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="pushButton_3" x="180" y="200" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="pushButton_4" x="180" y="230" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="pushButton_5" x="180" y="260" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="pushButton_6" x="180" y="290" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
<QPushButton id="pushButton_7" x="180" y="330" width="75" height="25">
<text><?i18n?>PushButton</text>
</QPushButton>
</QWidget>

View File

@@ -4,7 +4,6 @@
<file>fx/empty.qml</file> <file>fx/empty.qml</file>
<file>fx/helloworld.qml</file> <file>fx/helloworld.qml</file>
<file>fx/properties.qml</file> <file>fx/properties.qml</file>
<file>qwidget/test.qml</file>
<file>fx/topitem.qml</file> <file>fx/topitem.qml</file>
<file>fx/subitems/SubItem.qml</file> <file>fx/subitems/SubItem.qml</file>
<file>fx/states.qml</file> <file>fx/states.qml</file>

View File

@@ -85,8 +85,8 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler)
m_format->addItem("absolute", CostDelegate::FormatAbsolute); m_format->addItem("absolute", CostDelegate::FormatAbsolute);
m_format->addItem("relative", CostDelegate::FormatRelative); m_format->addItem("relative", CostDelegate::FormatRelative);
m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent); m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent);
connect(m_format, SIGNAL(activated(int)), connect(m_format, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, SLOT(formatChanged(int))); this, &ModelTestWidget::formatChanged);
h->addWidget(m_format); h->addWidget(m_format);
QDoubleSpinBox *minimumCost = new QDoubleSpinBox; QDoubleSpinBox *minimumCost = new QDoubleSpinBox;
@@ -94,8 +94,8 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler)
minimumCost->setRange(0, 1); minimumCost->setRange(0, 1);
minimumCost->setDecimals(4); minimumCost->setDecimals(4);
minimumCost->setSingleStep(0.01); minimumCost->setSingleStep(0.01);
connect(minimumCost, SIGNAL(valueChanged(double)), connect(minimumCost, &QDoubleSpinBox::valueChanged,
m_handler->proxyModel(), SLOT(setMinimumInclusiveCostRatio(double))); m_handler->proxyModel(), &DataProxyModel::setMinimumInclusiveCostRatio);
minimumCost->setValue(0.0001); minimumCost->setValue(0.0001);
h->addWidget(minimumCost); h->addWidget(minimumCost);

View File

@@ -10,7 +10,7 @@ MyType::MyType(QObject *parent)
updateTimerText(); updateTimerText();
m_timer = new QTimer(this); m_timer = new QTimer(this);
m_timer->setInterval(1000); m_timer->setInterval(1000);
connect(m_timer, SIGNAL(timeout()), SLOT(updateTimerText())); connect(m_timer, &QTimer::timeout, this, &MyType::updateTimerText);
m_timer->start(); m_timer->start();
} }

View File

@@ -20,10 +20,9 @@ public:
signals: signals:
void timeChanged(const QString &newText); void timeChanged(const QString &newText);
private slots: private:
void updateTimerText(); void updateTimerText();
private:
QString m_timeText; QString m_timeText;
QTimer *m_timer; QTimer *m_timer;

View File

@@ -10,7 +10,7 @@ MyType::MyType(QObject *parent)
updateTimerText(); updateTimerText();
m_timer = new QTimer(this); m_timer = new QTimer(this);
m_timer->setInterval(1000); m_timer->setInterval(1000);
connect(m_timer, SIGNAL(timeout()), SLOT(updateTimerText())); connect(m_timer, &QTimer::timeout, this, &MyType::updateTimerText);
m_timer->start(); m_timer->start();
} }

View File

@@ -20,10 +20,9 @@ public:
signals: signals:
void timeChanged(const QString &newText); void timeChanged(const QString &newText);
private slots: private:
void updateTimerText(); void updateTimerText();
private:
QString m_timeText; QString m_timeText;
QTimer *m_timer; QTimer *m_timer;

View File

@@ -1792,10 +1792,10 @@ namespace qobject {
parent.setObjectName("A Parent"); parent.setObjectName("A Parent");
QObject child(&parent); QObject child(&parent);
child.setObjectName("A Child"); child.setObjectName("A Child");
QObject::connect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater())); QObject::connect(&child, &QObject::destroyed, &parent, &QObject::deleteLater);
QObject::connect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater())); QObject::connect(&child, &QObject::destroyed, &child, &QObject::deleteLater);
QObject::disconnect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater())); QObject::disconnect(&child, &QObject::destroyed, &parent, &QObject::deleteLater);
QObject::disconnect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater())); QObject::disconnect(&child, &QObject::destroyed, &child, &QObject::deleteLater);
child.setObjectName("A renamed Child"); child.setObjectName("A renamed Child");
BREAK_HERE; BREAK_HERE;
// Check child "A renamed Child" QObject. // Check child "A renamed Child" QObject.
@@ -1889,11 +1889,11 @@ namespace qobject {
QObject ob1; QObject ob1;
ob1.setObjectName("Another Object"); ob1.setObjectName("Another Object");
QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater);
QObject::connect(&ob1, SIGNAL(destroyed()), &ob, SLOT(deleteLater())); QObject::connect(&ob1, &QObject::destroyed, &ob, &QObject::deleteLater);
BREAK_HERE; BREAK_HERE;
QObject::disconnect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); QObject::disconnect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater);
QObject::disconnect(&ob1, SIGNAL(destroyed()), &ob, SLOT(deleteLater())); QObject::disconnect(&ob1, &QObject::destroyed, &ob, &QObject::deleteLater);
dummyStatement(&ob, &ob1); dummyStatement(&ob, &ob1);
#endif #endif
} }
@@ -1930,7 +1930,6 @@ namespace qobject {
Q_OBJECT Q_OBJECT
public: public:
Receiver() { setObjectName("Receiver"); } Receiver() { setObjectName("Receiver"); }
public slots:
void aSlot() { void aSlot() {
QObject *s = sender(); QObject *s = sender();
if (s) { if (s) {
@@ -1945,7 +1944,7 @@ namespace qobject {
{ {
Sender sender; Sender sender;
Receiver receiver; Receiver receiver;
QObject::connect(&sender, SIGNAL(aSignal()), &receiver, SLOT(aSlot())); QObject::connect(&sender, &Sender::aSignal, &receiver, &Receiver::aSlot);
// Break here. // Break here.
// Single step through signal emission. // Single step through signal emission.
sender.doEmit(); sender.doEmit();

View File

@@ -222,8 +222,8 @@ void testObject(int &argc, char *argv[])
QObject ob1; QObject ob1;
ob1.setObjectName("Another Object"); ob1.setObjectName("Another Object");
QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater);
QObject::connect(&app, SIGNAL(lastWindowClosed()), &ob, SLOT(deleteLater())); QObject::connect(&app, &QGuiApplication::lastWindowClosed, &ob, &QObject::deleteLater);
QList<QObject *> obs; QList<QObject *> obs;
obs.append(&ob); obs.append(&ob);

View File

@@ -222,8 +222,8 @@ void testObject(int &argc, char *argv[])
QObject ob1; QObject ob1;
ob1.setObjectName("Another Object"); ob1.setObjectName("Another Object");
QObject::connect(&ob, SIGNAL(destroyed()), &ob1, SLOT(deleteLater())); QObject::connect(&ob, &QObject::destroyed, &ob1, &QObject::deleteLater);
QObject::connect(&app, SIGNAL(lastWindowClosed()), &ob, SLOT(deleteLater())); QObject::connect(&app, &QGuiApplication::lastWindowClosed, &ob, &QObject::deleteLater);
QList<QObject *> obs; QList<QObject *> obs;
obs.append(&ob); obs.append(&ob);

View File

@@ -84,7 +84,6 @@ public:
: QObject(parent), m_widget(widget), m_mainWindow(mw) : QObject(parent), m_widget(widget), m_mainWindow(mw)
{} {}
public slots:
void changeSelection(const QList<QTextEdit::ExtraSelection> &s) void changeSelection(const QList<QTextEdit::ExtraSelection> &s)
{ {
if (QPlainTextEdit *ed = qobject_cast<QPlainTextEdit *>(m_widget)) if (QPlainTextEdit *ed = qobject_cast<QPlainTextEdit *>(m_widget))
@@ -230,19 +229,18 @@ void readFile(FakeVimHandler &handler, const QString &editFileName)
void connectSignals(FakeVimHandler &handler, Proxy &proxy) void connectSignals(FakeVimHandler &handler, Proxy &proxy)
{ {
QObject::connect(&handler, SIGNAL(commandBufferChanged(QString,int,int,int,QObject*)), QObject::connect(&handler, &FakeVimHandler::commandBufferChanged,
&proxy, SLOT(changeStatusMessage(QString,int))); &proxy, &Proxy::changeStatusMessage);
QObject::connect(&handler, QObject::connect(&handler, &FakeVimHandler::selectionChanged,
SIGNAL(selectionChanged(QList<QTextEdit::ExtraSelection>)), &proxy, &Proxy::changeSelection);
&proxy, SLOT(changeSelection(QList<QTextEdit::ExtraSelection>))); QObject::connect(&handler, &FakeVimHandler::extraInformationChanged,
QObject::connect(&handler, SIGNAL(extraInformationChanged(QString)), &proxy, &Proxy::changeExtraInformation);
&proxy, SLOT(changeExtraInformation(QString))); QObject::connect(&handler, &FakeVimHandler::statusDataChanged,
QObject::connect(&handler, SIGNAL(statusDataChanged(QString)), &proxy, &Proxy::changeStatusData);
&proxy, SLOT(changeStatusData(QString))); QObject::connect(&handler, &FakeVimHandler::highlightMatches,
QObject::connect(&handler, SIGNAL(highlightMatches(QString)), &proxy, &Proxy::highlightMatches);
&proxy, SLOT(highlightMatches(QString))); QObject::connect(&handler, &FakeVimHandler::handleExCommandRequested,
QObject::connect(&handler, SIGNAL(handleExCommandRequested(bool*,ExCommand)), &proxy, &Proxy::handleExCommand);
&proxy, SLOT(handleExCommand(bool*,ExCommand)));
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])

View File

@@ -38,12 +38,11 @@ class PluginDialog : public QWidget
public: public:
PluginDialog(); PluginDialog();
private slots: private:
void updateButtons(); void updateButtons();
void openDetails(ExtensionSystem::PluginSpec *spec = nullptr); void openDetails(ExtensionSystem::PluginSpec *spec = nullptr);
void openErrorDetails(); void openErrorDetails();
private:
ExtensionSystem::PluginView *m_view; ExtensionSystem::PluginView *m_view;
QPushButton *m_detailsButton; QPushButton *m_detailsButton;

View File

@@ -37,7 +37,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_logWindow(new QPlainTextEdit) m_logWindow(new QPlainTextEdit)
{ {
setCentralWidget(m_logWindow); setCentralWidget(m_logWindow);
QTimer::singleShot(200, this, SLOT(test())); QTimer::singleShot(200, this, &MainWindow::test);
} }
void MainWindow::append(const QString &s) void MainWindow::append(const QString &s)
@@ -54,8 +54,8 @@ void MainWindow::test()
Utils::SynchronousProcess process; Utils::SynchronousProcess process;
process.setTimeoutS(2); process.setTimeoutS(2);
qDebug() << "Async: " << cmd << args; qDebug() << "Async: " << cmd << args;
connect(&process, SIGNAL(stdOut(QString,bool)), this, SLOT(append(QString))); connect(&process, &Utils::SynchronousProcess::stdOut, this, &MainWindow::append);
connect(&process, SIGNAL(stdErr(QString,bool)), this, SLOT(append(QString))); connect(&process, &Utils::SynchronousProcess::stdErr, this, &MainWindow::append);
const Utils::SynchronousProcessResponse resp = process.run(cmd, args); const Utils::SynchronousProcessResponse resp = process.run(cmd, args);
qDebug() << resp; qDebug() << resp;
} }

View File

@@ -37,9 +37,6 @@ Q_OBJECT
public: public:
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
signals:
public slots:
void test(); void test();
void append(const QString &s); void append(const QString &s);

View File

@@ -110,7 +110,7 @@ public:
delete m_connection; delete m_connection;
} }
private slots: private:
void handleConnected() void handleConnected()
{ {
qDebug("Error: Received unexpected connected() signal."); qDebug("Error: Received unexpected connected() signal.");
@@ -162,7 +162,6 @@ private slots:
qDebug("Error: The following test timed out: %s", testItem.description); qDebug("Error: The following test timed out: %s", testItem.description);
} }
private:
void runNextTest() void runNextTest()
{ {
if (m_connection) { if (m_connection) {
@@ -170,10 +169,10 @@ private:
delete m_connection; delete m_connection;
} }
m_connection = new SshConnection(m_testSet.first().params); m_connection = new SshConnection(m_testSet.first().params);
connect(m_connection, SIGNAL(connected()), SLOT(handleConnected())); connect(m_connection, &SshConnection::connected, this, &Test::handleConnected);
connect(m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected())); connect(m_connection, &SshConnection::disconnected, this, &Test::handleDisconnected);
connect(m_connection, SIGNAL(dataAvailable(QString)), SLOT(handleDataAvailable(QString))); connect(m_connection, &SshConnection::dataAvailable, this, &Test::handleDataAvailable);
connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleError(QSsh::SshError))); connect(m_connection, &SshConnection::error, this, &Test::handleError);
const TestItem &nextItem = m_testSet.first(); const TestItem &nextItem = m_testSet.first();
m_timeoutTimer.stop(); m_timeoutTimer.stop();
m_timeoutTimer.setInterval(qMax(10000, nextItem.params.timeout * 1000)); m_timeoutTimer.setInterval(qMax(10000, nextItem.params.timeout * 1000));

Some files were not shown because too many files have changed in this diff Show More