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()) {
fixedPath.replace(QLatin1String("//"), QLatin1String("/"));
fixedPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
return fixedPath;
return QUrl::fromLocalFile(fixedPath);
}
}
}

View File

@@ -54,9 +54,20 @@ RowLayout {
property bool isComplete: false
property string textValue: backendValue.value
function setCurrentText(text) {
if (text === "")
return
var index = comboBox.find(textValue)
if (index === -1)
currentIndex = -1
editText = textValue
}
property string textValue: backendValue.valueToString
onTextValueChanged: {
comboBox.editText = textValue
setCurrentText(textValue)
}
Layout.fillWidth: true
@@ -72,7 +83,7 @@ RowLayout {
if (!comboBox.isComplete)
return;
editText = backendValue.valueToString
setCurrentText(textValue)
}
onCurrentTextChanged: {
@@ -95,7 +106,7 @@ RowLayout {
}
}
comboBox.isComplete = true
editText = backendValue.valueToString
setCurrentText(textValue)
}
}

View File

@@ -820,7 +820,8 @@ void Check::visitQmlObject(Node *ast, UiQualifiedId *typeId,
const QString typeName = getRightMostIdentifier(typeId)->name.toString();
if (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("State"))
if (!m_typeStack.isEmpty() && m_typeStack.last() == QLatin1String("State")
&& typeId->name.toString() != "PropertyChanges")
addMessage(StateCannotHaveChildItem, typeErrorLocation, typeName);
if (checkTypeForDesignerSupport(typeId))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -259,44 +259,6 @@ BreakHandler::BreakHandler()
<< tr("Address") << tr("Condition") << tr("Ignore") << tr("Threads"));
}
QIcon BreakHandler::breakpointIcon()
{
static QIcon icon = Icons::BREAKPOINT.icon();
return icon;
}
QIcon BreakHandler::disabledBreakpointIcon()
{
static QIcon icon = Icons::BREAKPOINT_DISABLED.icon();
return icon;
}
QIcon BreakHandler::pendingBreakpointIcon()
{
static QIcon icon = Icons::BREAKPOINT_PENDING.icon();
return icon;
}
QIcon BreakHandler::watchpointIcon()
{
static QIcon icon = Icons::WATCHPOINT.icon();
return icon;
}
QIcon BreakHandler::tracepointIcon()
{
static QIcon icon = Icons::TRACEPOINT.icon();
return icon;
}
QIcon BreakHandler::emptyIcon()
{
static QIcon icon = Icons::BREAKPOINT_PENDING.icon();
//static QIcon icon = Icons::WATCHPOINT.icon();
//static QIcon icon = Icons::EMPTY.icon();
return icon;
}
static inline bool fileNameMatch(const QString &f1, const QString &f2)
{
if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive)
@@ -1401,16 +1363,16 @@ QIcon BreakpointItem::icon() const
// FIXME: This seems to be called on each cursor blink as soon as the
// cursor is near a line with a breakpoint marker (+/- 2 lines or so).
if (m_params.isTracepoint())
return BreakHandler::tracepointIcon();
return Icons::TRACEPOINT.icon();
if (m_params.type == WatchpointAtAddress)
return BreakHandler::watchpointIcon();
return Icons::WATCHPOINT.icon();
if (m_params.type == WatchpointAtExpression)
return BreakHandler::watchpointIcon();
return Icons::WATCHPOINT.icon();
if (!m_params.enabled)
return BreakHandler::disabledBreakpointIcon();
return Icons::BREAKPOINT_DISABLED.icon();
if (m_state == BreakpointInserted && !m_response.pending)
return BreakHandler::breakpointIcon();
return BreakHandler::pendingBreakpointIcon();
return Icons::BREAKPOINT.icon();
return Icons::BREAKPOINT_PENDING.icon();
}
QString BreakpointItem::toToolTip() const

View File

@@ -187,13 +187,6 @@ public:
Breakpoints findBreakpointsByIndex(const QList<QModelIndex> &list) const;
void updateMarkers();
static QIcon breakpointIcon();
static QIcon disabledBreakpointIcon();
static QIcon pendingBreakpointIcon();
static QIcon emptyIcon();
static QIcon watchpointIcon();
static QIcon tracepointIcon();
Breakpoint findBreakpointByFileAndLine(const QString &fileName,
int lineNumber, bool useMarkerPosition = true);
Breakpoint findBreakpointByAddress(quint64 address) const;

View File

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

View File

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

View File

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

View File

@@ -28,6 +28,7 @@
#include "debuggerinternalconstants.h"
#include "debuggeractions.h"
#include "debuggercore.h"
#include "debuggericons.h"
#include "debuggerruncontrol.h"
#include "debuggerstartparameters.h"
#include "debuggertooltipmanager.h"
@@ -37,7 +38,6 @@
#include "logwindow.h"
#include "memoryagent.h"
#include "moduleshandler.h"
#include "gdb/gdbengine.h" // REMOVE
#include "registerhandler.h"
#include "sourcefileshandler.h"
#include "sourceutils.h"
@@ -132,7 +132,7 @@ Location::Location(const StackFrame &frame, bool marker)
LocationMark::LocationMark(DebuggerEngine *engine, const QString &file, int line)
: TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine)
{
setIcon(Internal::locationMarkIcon());
setIcon(Icons::LOCATION.icon());
setPriority(TextMark::HighPriority);
}
@@ -564,7 +564,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl)
d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid));
if (isNativeMixedActive())
d->m_runParameters.inferior.environment.set(QLatin1String("QV4_FORCE_INTERPRETER"), QLatin1String("1"));
d->m_runParameters.inferior.environment.set("QV4_FORCE_INTERPRETER", "1");
action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability));
@@ -609,7 +609,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
}
if (loc.fileName().isEmpty()) {
showMessage(QLatin1String("CANNOT GO TO THIS LOCATION"));
showMessage("CANNOT GO TO THIS LOCATION");
return;
}
const QString file = QDir::cleanPath(loc.fileName());
@@ -633,7 +633,7 @@ void DebuggerEngine::gotoLocation(const Location &loc)
// Called from RunControl.
void DebuggerEngine::handleStartFailed()
{
showMessage(QLatin1String("HANDLE RUNCONTROL START FAILED"));
showMessage("HANDLE RUNCONTROL START FAILED");
d->m_runControl = 0;
d->m_progress.setProgressValue(900);
d->m_progress.reportCanceled();
@@ -643,7 +643,7 @@ void DebuggerEngine::handleStartFailed()
// Called from RunControl.
void DebuggerEngine::handleFinished()
{
showMessage(QLatin1String("HANDLE RUNCONTROL FINISHED"));
showMessage("HANDLE RUNCONTROL FINISHED");
d->m_runControl = 0;
d->m_progress.setProgressValue(1000);
d->m_progress.reportFinished();
@@ -905,7 +905,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re
if (result.gdbServerPort.isValid()) {
QString &rc = d->m_runParameters.remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
const int sepIndex = rc.lastIndexOf(':');
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(result.gdbServerPort.number()));
@@ -1785,9 +1785,9 @@ QString DebuggerEngine::msgInterrupted()
void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name)
{
if (name.isEmpty())
name = QLatin1Char(' ') + tr("<Unknown>", "name") + QLatin1Char(' ');
name = ' ' + tr("<Unknown>", "name") + ' ';
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 "
"signal from the operating system.<p>"
"<table><tr><td>Signal name : </td><td>%1</td></tr>"
@@ -1856,14 +1856,14 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
"experience for this binary format.");
return;
} else if (warnOnRelease) {
if (!symbolFile.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive))
symbolFile.append(QLatin1String(".exe"));
if (!symbolFile.endsWith(".exe", Qt::CaseInsensitive))
symbolFile.append(".exe");
QString errorMessage;
QStringList rc;
if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty())
return;
if (!errorMessage.isEmpty()) {
detailedWarning.append(QLatin1Char('\n'));
detailedWarning.append('\n');
detailedWarning.append(errorMessage);
}
} else {
@@ -1979,12 +1979,12 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp)
tr("The selected debugger may be inappropiate for the inferior.\n"
"Examining symbols and setting breakpoints by file name and line number "
"may fail.\n")
+ QLatin1Char('\n') + detailedWarning);
+ '\n' + detailedWarning);
} else if (warnOnRelease) {
AsynchronousMessageBox::information(tr("Warning"),
tr("This does not seem to be a \"Debug\" build.\n"
"Setting breakpoints by file name and line number may fail.")
+ QLatin1Char('\n') + detailedWarning);
+ '\n' + detailedWarning);
}
}
@@ -2007,7 +2007,7 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all)
static int count = 0;
showMessage(QString("<Rebuild Watchmodel %1 @ %2 >")
.arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput);
showStatusMessage(GdbEngine::tr("Finished retrieving data"), 400); // FIXME: String
showStatusMessage(tr("Finished retrieving data"), 400);
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
#include "debugger_global.h"
#include <utils/icon.h>
namespace Debugger {
namespace Icons {
const Utils::Icon BREAKPOINT({
{QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint);
const Utils::Icon BREAKPOINT_DISABLED({
{QLatin1String(":/debugger/images/breakpoint_disabled.png"), Utils::Theme::IconsErrorColor}}, Utils::Icon::Tint);
const Utils::Icon BREAKPOINT_PENDING({
{QLatin1String(":/debugger/images/breakpoint.png"), Utils::Theme::IconsErrorColor},
{QLatin1String(":/debugger/images/breakpoint_pending_overlay.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::IconStyleOptions(Utils::Icon::Tint | Utils::Icon::PunchEdges));
const Utils::Icon BREAKPOINTS(
QLatin1String(":/debugger/images/debugger_breakpoints.png"));
const Utils::Icon WATCHPOINT({
{QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint);
const Utils::Icon TRACEPOINT({
{QLatin1String(":/core/images/eye_open.png"), Utils::Theme::TextColorNormal},
{QLatin1String(":/debugger/images/tracepointoverlay.png"), Utils::Theme::TextColorNormal}}, Utils::Icon::Tint | Utils::Icon::PunchEdges);
const Utils::Icon CONTINUE(
QLatin1String(":/debugger/images/debugger_continue.png"));
const Utils::Icon CONTINUE_FLAT({
{QLatin1String(":/debugger/images/debugger_continue_1_mask.png"), Utils::Theme::IconsInterruptToolBarColor},
{QLatin1String(":/debugger/images/debugger_continue_2_mask.png"), Utils::Theme::IconsRunToolBarColor},
{QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}});
const Utils::Icon DEBUG_CONTINUE_SMALL({
{QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptColor},
{QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR({
{QLatin1String(":/projectexplorer/images/continue_1_small.png"), Utils::Theme::IconsInterruptToolBarColor},
{QLatin1String(":/projectexplorer/images/continue_2_small.png"), Utils::Theme::IconsRunToolBarColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}});
const Utils::Icon INTERRUPT(
QLatin1String(":/debugger/images/debugger_interrupt.png"));
const Utils::Icon INTERRUPT_FLAT({
{QLatin1String(":/debugger/images/debugger_interrupt_mask.png"), Utils::Theme::IconsInterruptToolBarColor},
{QLatin1String(":/projectexplorer/images/debugger_beetle_mask.png"), Utils::Theme::IconsDebugColor}});
const Utils::Icon DEBUG_INTERRUPT_SMALL({
{QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR({
{QLatin1String(":/core/images/interrupt_small.png"), Utils::Theme::IconsInterruptToolBarColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}});
const Utils::Icon DEBUG_EXIT_SMALL({
{QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR({
{QLatin1String(":/core/images/stop_small.png"), Utils::Theme::IconsStopToolBarColor},
{QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}});
const Utils::Icon LOCATION({
{QLatin1String(":/debugger/images/location_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor},
{QLatin1String(":/debugger/images/location.png"), Utils::Theme::IconsWarningToolBarColor}}, Utils::Icon::Tint);
const Utils::Icon REVERSE_MODE({
{QLatin1String(":/debugger/images/debugger_reversemode_background.png"), Utils::Theme::IconsCodeModelOverlayForegroundColor},
{QLatin1String(":/debugger/images/debugger_reversemode.png"), Utils::Theme::IconsInfoColor}}, Utils::Icon::Tint);
const Utils::Icon APP_ON_TOP({
{QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon APP_ON_TOP_TOOLBAR({
{QLatin1String(":/debugger/images/qml/app-on-top.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon SELECT({
{QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon SELECT_TOOLBAR({
{QLatin1String(":/debugger/images/qml/select.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon EMPTY(
QLatin1String(":/debugger/images/debugger_empty_14.png"));
const Utils::Icon RECORD_ON({
{QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsStopColor},
{QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow);
const Utils::Icon RECORD_OFF({
{QLatin1String(":/debugger/images/recordfill.png"), Utils::Theme::IconsDisabledColor},
{QLatin1String(":/debugger/images/recordoutline.png"), Utils::Theme::IconsBaseColor}}, Utils::Icon::Tint | Utils::Icon::DropShadow);
// Used in QmlProfiler.
DEBUGGER_EXPORT extern const Utils::Icon RECORD_ON;
DEBUGGER_EXPORT extern const Utils::Icon RECORD_OFF;
const Utils::Icon STEP_OVER({
{QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon STEP_OVER_TOOLBAR({
{QLatin1String(":/debugger/images/debugger_stepover_small.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon STEP_INTO({
{QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon STEP_INTO_TOOLBAR({
{QLatin1String(":/debugger/images/debugger_stepinto_small.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon STEP_OUT({
{QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon STEP_OUT_TOOLBAR({
{QLatin1String(":/debugger/images/debugger_stepout_small.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon RESTART({
{QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::PanelTextColorMid}}, Utils::Icon::MenuTintedStyle);
const Utils::Icon RESTART_TOOLBAR({
{QLatin1String(":/debugger/images/debugger_restart_small.png"), Utils::Theme::IconsRunToolBarColor}});
const Utils::Icon SINGLE_INSTRUCTION_MODE({
{QLatin1String(":/debugger/images/debugger_singleinstructionmode.png"), Utils::Theme::IconsBaseColor}});
extern const Utils::Icon BREAKPOINT;
extern const Utils::Icon BREAKPOINT_DISABLED;
extern const Utils::Icon BREAKPOINT_PENDING;
extern const Utils::Icon BREAKPOINTS;
extern const Utils::Icon WATCHPOINT;
extern const Utils::Icon TRACEPOINT;
extern const Utils::Icon CONTINUE;
extern const Utils::Icon CONTINUE_FLAT;
extern const Utils::Icon DEBUG_CONTINUE_SMALL;
extern const Utils::Icon DEBUG_CONTINUE_SMALL_TOOLBAR;
extern const Utils::Icon INTERRUPT;
extern const Utils::Icon INTERRUPT_FLAT;
extern const Utils::Icon DEBUG_INTERRUPT_SMALL;
extern const Utils::Icon DEBUG_INTERRUPT_SMALL_TOOLBAR;
extern const Utils::Icon DEBUG_EXIT_SMALL;
extern const Utils::Icon DEBUG_EXIT_SMALL_TOOLBAR;
extern const Utils::Icon LOCATION;
extern const Utils::Icon REVERSE_MODE;
extern const Utils::Icon APP_ON_TOP;
extern const Utils::Icon APP_ON_TOP_TOOLBAR;
extern const Utils::Icon SELECT;
extern const Utils::Icon SELECT_TOOLBAR;
extern const Utils::Icon EMPTY;
const Utils::Icon MODE_DEBUGGER_CLASSIC(
QLatin1String(":/debugger/images/mode_debug.png"));
const Utils::Icon MODE_DEBUGGER_FLAT({
{QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE({
{QLatin1String(":/debugger/images/mode_debug_mask.png"), Utils::Theme::IconsModeDebugActiveColor}});
extern const Utils::Icon STEP_OVER;
extern const Utils::Icon STEP_OVER_TOOLBAR;
extern const Utils::Icon STEP_INTO;
extern const Utils::Icon STEP_INTO_TOOLBAR;
extern const Utils::Icon STEP_OUT;
extern const Utils::Icon STEP_OUT_TOOLBAR;
extern const Utils::Icon RESTART;
extern const Utils::Icon RESTART_TOOLBAR;
extern const Utils::Icon SINGLE_INSTRUCTION_MODE;
extern const Utils::Icon MODE_DEBUGGER_CLASSIC;
extern const Utils::Icon MODE_DEBUGGER_FLAT;
extern const Utils::Icon MODE_DEBUGGER_FLAT_ACTIVE;
} // namespace Icons
} // namespace Debugger

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

@@ -195,7 +195,7 @@ public:
void operator=(Runnable other) { d = std::move(other.d); }
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 {
@@ -235,7 +235,7 @@ public:
void operator=(Connection other) { d = std::move(other.d); }
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 {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

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 goToImplementationDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Go to Implementation");
const char addSignalHandlerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Add New Signal Handler");
const char moveToComponentDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Move to Component");
const char setIdDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Set Id");

View File

@@ -509,10 +509,11 @@ void DesignerActionManager::createDefaultDesignerActions()
addDesignerAction(new ModelNodeAction
(goIntoComponentDisplayName, rootCategory, priorityGoIntoComponent, &goIntoComponent, &selectionIsComponent));
addDesignerAction(new ModelNodeAction
(goToImplementationDisplayName, rootCategory, 42, &gotoImplementation, &singleSelectedAndUiFile, &singleSelectedAndUiFile));
(goToImplementationDisplayName, rootCategory, 42, &goImplementation, &singleSelectedAndUiFile, &singleSelectedAndUiFile));
addDesignerAction(new ModelNodeAction
(addSignalHandlerDisplayName, rootCategory, 42, &addNewSignalHandler, &singleSelectedAndUiFile, &singleSelectedAndUiFile));
addDesignerAction(new ModelNodeAction
(moveToComponentDisplayName, rootCategory, 44, &moveToComponent, &singleSelection, &singleSelection));
}
void DesignerActionManager::addDesignerAction(ActionInterface *newAction)

View File

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

View File

@@ -63,7 +63,9 @@ void layoutFlowPositioner(const SelectionContext &selectionState);
void layoutRowLayout(const SelectionContext &selectionState);
void layoutColumnLayout(const SelectionContext &selectionState);
void layoutGridLayout(const SelectionContext &selectionState);
void gotoImplementation(const SelectionContext &selectionState);
void goImplementation(const SelectionContext &selectionState);
void addNewSignalHandler(const SelectionContext &selectionState);
void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState, bool addAlwaysNewSlot);
void removeLayout(const SelectionContext &selectionContext);
void removePositioner(const SelectionContext &selectionContext);
void moveToComponent(const SelectionContext &selectionContext);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -341,8 +341,14 @@ void BaseQtVersion::setupExpander()
[this] { return qmakeProperty(m_versionInfo, "QT_INSTALL_DEMOS"); });
m_expander.registerVariable("Qt:QMAKE_MKSPECS",
QtKitInformation::tr("The current Qt version's default mkspecs."),
QtKitInformation::tr("The current Qt version's default mkspecs (Qt 4)."),
[this] { return qmakeProperty(m_versionInfo, "QMAKE_MKSPECS"); });
m_expander.registerVariable("Qt:QMAKE_SPEC",
QtKitInformation::tr("The current Qt version's default mkspec (Qt 5; host system)"),
[this] { return qmakeProperty(m_versionInfo, "QMAKE_SPEC"); });
m_expander.registerVariable("Qt:QMAKE_XSPEC",
QtKitInformation::tr("The current Qt version's default mkspec (Qt 5; target system)."),
[this] { return qmakeProperty(m_versionInfo, "QMAKE_XSPEC"); });
m_expander.registerVariable("Qt:QMAKE_VERSION",
QtKitInformation::tr("The current Qt's qmake version."),

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);
QPlainTextEdit *textEdit = new QPlainTextEdit;
QObject::connect(model, SIGNAL(destroyed()), textEdit, SLOT(deleteLater()));
QObject::connect(model, &QObject::destroyed, textEdit, &QObject::deleteLater);
textEdit->setPlainText(QString("import %1 %3.%4; %2{}").arg(typeName.split(".").first())
.arg(typeName.split(".").last())
.arg(major)

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/helloworld.qml</file>
<file>fx/properties.qml</file>
<file>qwidget/test.qml</file>
<file>fx/topitem.qml</file>
<file>fx/subitems/SubItem.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("relative", CostDelegate::FormatRelative);
m_format->addItem("rel. to parent", CostDelegate::FormatRelativeToParent);
connect(m_format, SIGNAL(activated(int)),
this, SLOT(formatChanged(int)));
connect(m_format, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated),
this, &ModelTestWidget::formatChanged);
h->addWidget(m_format);
QDoubleSpinBox *minimumCost = new QDoubleSpinBox;
@@ -94,8 +94,8 @@ ModelTestWidget::ModelTestWidget(CallgrindWidgetHandler *handler)
minimumCost->setRange(0, 1);
minimumCost->setDecimals(4);
minimumCost->setSingleStep(0.01);
connect(minimumCost, SIGNAL(valueChanged(double)),
m_handler->proxyModel(), SLOT(setMinimumInclusiveCostRatio(double)));
connect(minimumCost, &QDoubleSpinBox::valueChanged,
m_handler->proxyModel(), &DataProxyModel::setMinimumInclusiveCostRatio);
minimumCost->setValue(0.0001);
h->addWidget(minimumCost);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -84,7 +84,6 @@ public:
: QObject(parent), m_widget(widget), m_mainWindow(mw)
{}
public slots:
void changeSelection(const QList<QTextEdit::ExtraSelection> &s)
{
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)
{
QObject::connect(&handler, SIGNAL(commandBufferChanged(QString,int,int,int,QObject*)),
&proxy, SLOT(changeStatusMessage(QString,int)));
QObject::connect(&handler,
SIGNAL(selectionChanged(QList<QTextEdit::ExtraSelection>)),
&proxy, SLOT(changeSelection(QList<QTextEdit::ExtraSelection>)));
QObject::connect(&handler, SIGNAL(extraInformationChanged(QString)),
&proxy, SLOT(changeExtraInformation(QString)));
QObject::connect(&handler, SIGNAL(statusDataChanged(QString)),
&proxy, SLOT(changeStatusData(QString)));
QObject::connect(&handler, SIGNAL(highlightMatches(QString)),
&proxy, SLOT(highlightMatches(QString)));
QObject::connect(&handler, SIGNAL(handleExCommandRequested(bool*,ExCommand)),
&proxy, SLOT(handleExCommand(bool*,ExCommand)));
QObject::connect(&handler, &FakeVimHandler::commandBufferChanged,
&proxy, &Proxy::changeStatusMessage);
QObject::connect(&handler, &FakeVimHandler::selectionChanged,
&proxy, &Proxy::changeSelection);
QObject::connect(&handler, &FakeVimHandler::extraInformationChanged,
&proxy, &Proxy::changeExtraInformation);
QObject::connect(&handler, &FakeVimHandler::statusDataChanged,
&proxy, &Proxy::changeStatusData);
QObject::connect(&handler, &FakeVimHandler::highlightMatches,
&proxy, &Proxy::highlightMatches);
QObject::connect(&handler, &FakeVimHandler::handleExCommandRequested,
&proxy, &Proxy::handleExCommand);
}
int main(int argc, char *argv[])

View File

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

View File

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

View File

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

View File

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

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