Merge remote-tracking branch 'origin/4.9'

Change-Id: If36258b8e572b5c7875433a31a836e4f06e27286
This commit is contained in:
Eike Ziller
2019-03-21 11:28:21 +01:00
47 changed files with 2860 additions and 1312 deletions

View File

@@ -14,6 +14,7 @@ General
* Added option to run external tools in build or run environment of
active project (QTCREATORBUG-18394, QTCREATORBUG-19892)
* Improved selection colors in dark themes (QTCREATORBUG-18888)
* Added -temporarycleansettings (alias -tcs) command line option
Editing

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -26,29 +26,56 @@
/*!
//! [clang format]
\section2 Automatic Indentation
\section2 Automatic Formatting and Indentation
The experimental Clang Format plugin uses the
\l{https://clang.llvm.org/docs/LibFormat.html}{LibFormat}
library for automatic indentation.
library for automatic formatting and indentation.
To enable the plugin, select \uicontrol Help > \uicontrol {About Plugins} >
\uicontrol {C++} > \uicontrol {ClangFormat}. Then restart \QC to load the
plugin.
To specify global settings for Clang Format:
\note If you enable the plugin, do not use the \l{Beautifying Source Code}
{Beautifier}, because combining the two can provide unexpected results.
You can use Clang Format to enforce a coding style for a project or the
whole organization. Create a \c {.clang-format} file that contains the
\l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
{Clang Format Style Options} to use and save it in the root folder of the
project or one of its parent folders. The plugin searches for the Clang
format file recursively from the directory that contains the source file
up to the file system root.
To specify settings for automatic formatting and indentation:
\list 1
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++} >
\uicontrol {Clang Format}.
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {C++}.
\image qtcreator-clang-format-options.png "C++ Clang Format options"
\li Double-click a value to modify it.
\li Select the \uicontrol {Format instead of indenting} check box to
use the \key {Ctrl+I} keyboard shortcut to format code instead of
indenting it.
\li Select the \uicontrol {Format while typing} check box to apply the
formatting while you type code.
\li Select the \uicontrol {Format edited code on file save} check box
to apply the formatting to the edited code when you save the file.
\li Select the \uicontrol {Override Clang Format configuration file}
check box to create a local configuration file that overrides the
one stored in the file system.
\note This is not recommended, because it defeats the purpose of
a Clang format file.
\li To modify the values in the file, select them in the left-side
column and enter the new values.
\li To view examples of the new values in the right-hand column, select
\uicontrol Apply.
\endlist
You can also specify formatting separately for each project.
Create a \c {.clang-format} file that contains the
\l{https://clang.llvm.org/docs/ClangFormatStyleOptions.html}
{Clang Format Style Options} to use and save it in the project directory.
To override the \c {.clang-format} file for a project, select
\uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol {Code Style} >
\uicontrol {Override Clang Format configuration file}.
\image qtcreator-code-style-clang-format.png
You can create \c {.clang-format} files that contain the configuration
options of a certain predefined style from the command line. For example,
@@ -58,9 +85,5 @@
clang-format -style=llvm -dump-config > .clang-format
\endcode
To view the \c {.clang-format} file for a project, select
\uicontrol Projects > \uicontrol {Project Settings} >
\uicontrol {Clang Format}.
//! [clang format]
*/

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -49,7 +49,8 @@
To find instances of a specific symbol in your Qt C++ project, place the
cursor on the symbol in the editor and select \uicontrol Tools >
\uicontrol {C++} > \uicontrol {Find Usages} or press \key {Ctrl+Shift+U}.
\uicontrol {C++} > \uicontrol {Find References to Symbol Under Cursor} or
press \key {Ctrl+Shift+U}.
\note You can also select \uicontrol Edit > \uicontrol {Find/Replace} >
\uicontrol {Advanced Find} > \uicontrol {C++ Symbols} to search for
@@ -63,7 +64,8 @@
To find instances of a specific QML type in a project, place the cursor on
the type and select \uicontrol Tools > \uicontrol {QML/JS} >
\uicontrol {Find Usages} or press \key {Ctrl+Shift+U}.
\uicontrol {Find References to Symbol Under Cursor} or press
\key {Ctrl+Shift+U}.
\section1 Viewing Search Results

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -192,16 +192,25 @@
\uicontrol Options > \uicontrol {Text Editor} > \uicontrol Behavior >
\uicontrol {Enable mouse navigation}.
You can also select the symbol and press \key F2, or right-click the symbol
There are several additional ways of moving between symbol definitions and
declarations. All the functions described below are also available from the
\uicontrol Tools > \uicontrol C++ menu. The functions supported for QML and
JavaScript code are available from the \uicontrol Tools > \uicontrol QML/JS
menu.
You can select the symbol and press \key F2, or right-click the symbol
and select \uicontrol {Follow Symbol Under Cursor} to move to its definition
or declaration. This feature is supported for namespaces, classes,
functions, variables, include statements, and macros.
or declaration. To follow the symbol in the next split, select
\uicontrol {Follow Symbol Under Cursor in Next Split}. Following symbols is
supported for namespaces, classes, functions, variables, include statements,
and macros.
To switch between the definition and declaration of a function, place the
cursor on either and press \key {Shift+F2} or right-click and select
\uicontrol {Switch Between Function Declaration/Definition}. For example,
this allows you to navigate from anywhere within a function body directly to
the function declaration.
\uicontrol {Switch Between Function Declaration/Definition} or
\uicontrol {Open Function Declaration/Definition in Next Split}.
For example, this allows you to navigate from anywhere within a function
body directly to the function declaration.
Links are opened in the same split by default. To open links in the next
split, prepend \key {Ctrl+E} to the shortcut. For example, press
@@ -214,6 +223,11 @@
another split. If you change the default behavior, the shortcuts for opening
link targets in the next split are used to open them in the current split.
To switch between C++ header and source files, right-click anywhere in a
file and select \uicontrol {Switch Header/Source} or
\uicontrol {Open Corresponding Header/Source in Next Split}. You can also
press \key F4 or \key {Ctrl+E,F4}, respectively.
\section1 Reparsing Externally Changed Files
If source files are modified from outside \QC, the opened files will be

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -427,7 +427,7 @@
\li Alt+C, Alt+P
\endif
\row
\li Find usages
\li Find references to symbol under cursor
\li Ctrl+Shift+U
\row
\li Follow symbol under cursor

View File

@@ -151,6 +151,11 @@
\li Override the default path from where user-independent settings are read
(for example written by the installer).
\row
\li -temporarycleansettings
\li Use clean settings for debug or testing reasons. The settings
will be deleted when \QC exits.
\row
\li -color <color>
\li Core plugin: override the selected UI color.
@@ -165,6 +170,10 @@
\li Core plugin: apply a dark color theme to \QC, without using
stylesheets.
\row
\li -notour
\li Welcome plugin: Skip the UI tour on startup.
\row
\li -debug <pid>
\li Debugger plugin: attach to the process with the given process

View File

@@ -255,6 +255,11 @@
\image qtcreator-application-output.png
If you specify command line arguments in the run settings that are passed
to the application when running it, they are displayed as a part of the
application output. For more information, see
\l{Specifying Run Settings for Desktop Device Types}.
Select toolbar buttons to run applications, to attach the debugger to the
running application, and to stop running or debugging.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -327,8 +327,8 @@
Typically, users also work on multiple classes or functions that are
related, even though they are defined or declared in different files.
\QC provides two shortcuts for that: \key F2 to follow the symbol
and \key Ctrl+Shift+U to find usages.
\QC provides two shortcuts for that: \key F2 to follow the symbol under
cursor and \key Ctrl+Shift+U to find references to it.
In addition, developers can:

View File

@@ -182,6 +182,9 @@
\li Add and remove subprojects.
\endif
\li Search from the selected directory.
\li Expand or collapse the tree view to show or hide all files and
folders.
\li Close all files in a project.
\li Close projects.
\endlist
@@ -312,5 +315,8 @@
the current file, right-click in the editor and select
\uicontrol {Open Include Hierarchy} or press \key {Ctrl+Shift+I}.
To keep the view synchronized with the file currently opened in the editor,
select \uicontrol {Synchronize with Editor}.
//! [include hierarchy view]
*/

View File

@@ -71,6 +71,10 @@
\li .creator
\li \l{Forwarding Flags to Clang Code Model}{.cflags}
\li \l{Forwarding Flags to Clang Code Model}{.cxxflags}
\endlist
\endlist
@@ -126,6 +130,14 @@
#define NAME value
\endcode
\section1 Forwarding Flags to Clang Code Model
The \c {.cxxflags} and \c {.cflags} files contain command line flags for the
Clang code model, one flag per line.
For example, specify the \c {-std=c++11} to set the language version
for parsing as C++11.
\section1 Providing Deployment Information
If you want to run your application on an embedded Linux device, you first need to

View File

@@ -141,7 +141,8 @@ class PlainDumper:
d.putType(value.nativeValue.type.name)
val = printer.to_string()
if isinstance(val, str):
d.putValue(val)
# encode and avoid extra quotes ('"') at beginning and end
d.putValue(d.hexencode(val), 'utf8:1:0')
elif sys.version_info[0] <= 2 and isinstance(val, unicode):
d.putValue(val)
else: # Assuming LazyString

View File

@@ -0,0 +1,51 @@
/****************************************************************************
**
** 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.
**
****************************************************************************/
import QtQuick 2.1
Rectangle {
property string title
property var clickedButton
property var modality
property var standardButtons
property alias contentItem: contentArea
property int maximumWidth: 0
property int minimumWidth: 0
property int maximumHeight: 0
property int minimumHeight: 0
Item {
id: contentArea
anchors.top: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.top
}
}

View File

@@ -622,10 +622,12 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
|| typeName == "QtQuick.Controls/Drawer"
|| typeName == "QtQuick.Controls/Dialog"
|| typeName == "QtQuick.Controls/Menu"
|| typeName == "QtQuick.Controls/Pane"
|| typeName == "QtQuick.Controls/ToolTip")
polishTypeName = "QtQuick/Item";
const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"}};
const QHash<QString, QString> mockHash = {{"QtQuick.Controls/SwipeView","qrc:/qtquickplugin/mockfiles/SwipeView.qml"},
{"QtQuick.Dialogs/Dialog","qrc:/qtquickplugin/mockfiles/Dialog.qml"}};
QObject *object = nullptr;

View File

@@ -6,5 +6,6 @@
<file>mockfiles/Window.qml</file>
<file>mockfiles/SwipeView.qml</file>
<file>mockfiles/GenericBackend.qml</file>
<file>mockfiles/Dialog.qml</file>
</qresource>
</RCC>

View File

@@ -154,11 +154,17 @@ Rectangle {
__panel.visible = false
}
onEditingFinished: {
if (text != delegateStateName)
statesEditorModel.renameState(internalNodeId, text)
}
property string oldValue
onEditingFinished: {
if (stateNameField.oldValue === stateNameField.text)
return
stateNameField.oldValue = stateNameField.text
if (stateNameField.text != delegateStateName)
statesEditorModel.renameState(internalNodeId, stateNameField.text)
}
}
Item {

File diff suppressed because it is too large Load Diff

View File

@@ -81,6 +81,7 @@ const char fixedOptionsC[] =
" -client Attempt to connect to already running first instance\n"
" -settingspath <path> Override the default path where user settings are stored\n"
" -installsettingspath <path> Override the default path from where user-independent settings are read\n"
" -temporarycleansettings Use clean settings for debug or testing reasons\n"
" -pid <pid> Attempt to connect to instance given by pid\n"
" -block Block until editor is closed\n"
" -pluginpath <path> Add a custom search path for plugins\n";
@@ -94,6 +95,8 @@ const char CLIENT_OPTION[] = "-client";
const char SETTINGS_OPTION[] = "-settingspath";
const char INSTALL_SETTINGS_OPTION[] = "-installsettingspath";
const char TEST_OPTION[] = "-test";
const char TEMPORARY_CLEAN_SETTINGS1[] = "-temporarycleansettings";
const char TEMPORARY_CLEAN_SETTINGS2[] = "-tcs";
const char PID_OPTION[] = "-pid";
const char BLOCK_OPTION[] = "-block";
const char PLUGINPATH_OPTION[] = "-pluginpath";
@@ -348,6 +351,7 @@ struct Options
std::vector<char *> appArguments;
Utils::optional<QString> userLibraryPath;
bool hasTestOption = false;
bool wantsCleanSettings = false;
};
Options parseCommandLine(int argc, char *argv[])
@@ -372,6 +376,8 @@ Options parseCommandLine(int argc, char *argv[])
} else if (arg == USER_LIBRARY_PATH_OPTION && hasNext) {
++it;
options.userLibraryPath = nextArg;
} else if (arg == TEMPORARY_CLEAN_SETTINGS1 || arg == TEMPORARY_CLEAN_SETTINGS2) {
options.wantsCleanSettings = true;
} else { // arguments that are still passed on to the application
if (arg == TEST_OPTION)
options.hasTestOption = true;
@@ -424,7 +430,7 @@ int main(int argc, char **argv)
#endif
QScopedPointer<Utils::TemporaryDirectory> temporaryCleanSettingsDir;
if (options.settingsPath.isEmpty() && options.hasTestOption) {
if (options.settingsPath.isEmpty() && (options.hasTestOption || options.wantsCleanSettings)) {
temporaryCleanSettingsDir.reset(new Utils::TemporaryDirectory("qtc-test-settings"));
if (!temporaryCleanSettingsDir->isValid())
return 1;

View File

@@ -131,7 +131,7 @@ public:
palette.setCurrentColorGroup(QPalette::Active);
bool selected = opt.state & QStyle::State_Selected;
QColor backgroundColor = selected ? palette.highlight().color()
: palette.background().color();
: palette.window().color();
painter->setBrush(backgroundColor);
painter->drawRect(0, opt.rect.top(), opt.rect.width() + opt.rect.left(), opt.rect.height());

View File

@@ -408,14 +408,29 @@ CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FileName &pr
m_kit.reset(KitManager::defaultKit()->clone());
connect(this, &CompilationDatabaseProject::parsingFinished,
this, [this]() { addTarget(createTarget(m_kit.get())); });
emitParsingStarted();
const QFuture<void> future = ::Utils::runAsync([this, projectFile](){
buildTreeAndProjectParts(projectFile);
connect(this, &CompilationDatabaseProject::parsingFinished, this, [this]() {
if (!m_hasTarget) {
addTarget(createTarget(m_kit.get()));
m_hasTarget = true;
}
});
reparseProject(projectFile);
m_fileSystemWatcher.addFile(projectFile.toString(), Utils::FileSystemWatcher::WatchModifiedDate);
connect(&m_fileSystemWatcher,
&Utils::FileSystemWatcher::fileChanged,
this,
[this](const QString &projectFile) {
reparseProject(Utils::FileName::fromString(projectFile));
});
}
void CompilationDatabaseProject::reparseProject(const Utils::FileName &projectFile)
{
emitParsingStarted();
const QFuture<void> future = ::Utils::runAsync(
[this, projectFile]() { buildTreeAndProjectParts(projectFile); });
m_parserWatcher.setFuture(future);
}

View File

@@ -26,8 +26,8 @@
#pragma once
#include <projectexplorer/project.h>
#include <texteditor/texteditor.h>
#include <utils/filesystemwatcher.h>
#include <QFutureWatcher>
@@ -51,11 +51,14 @@ public:
bool needsBuildConfigurations() const override { return false; }
private:
void reparseProject(const Utils::FileName &projectFile);
void buildTreeAndProjectParts(const Utils::FileName &projectFile);
QFutureWatcher<void> m_parserWatcher;
std::unique_ptr<CppTools::CppProjectUpdater> m_cppCodeModelUpdater;
std::unique_ptr<ProjectExplorer::Kit> m_kit;
Utils::FileSystemWatcher m_fileSystemWatcher;
bool m_hasTarget = false;
};
class CompilationDatabaseEditorFactory : public TextEditor::TextEditorFactory

View File

@@ -475,7 +475,7 @@ bool CppEditorDocument::save(QString *errorString, const QString &fileName, bool
if (!editedRanges.empty()) {
QTextCursor cursor(document());
cursor.joinPreviousEditBlock();
cursor.beginEditBlock();
indenter()->format(editedRanges);
cursor.endEditBlock();
}

View File

@@ -553,7 +553,7 @@ void DebuggerEnginePrivate::setupViews()
QTC_CHECK(!m_perspective);
m_perspective = new Perspective("Debugger.Perspective." + m_runId,
m_perspective = new Perspective("Debugger.Perspective." + m_runId + '.' + m_debuggerName,
m_engine->displayName(),
Debugger::Constants::PRESET_PERSPECTIVE_ID,
m_debuggerName);

View File

@@ -306,35 +306,36 @@ void DebuggerMainWindow::showStatusMessage(const QString &message, int timeoutMS
theMainWindow->d->m_statusLabel->showStatusMessage(message, timeoutMS);
}
void DebuggerMainWindow::onModeChanged(Core::Id mode)
void DebuggerMainWindow::enterDebugMode()
{
if (mode == Debugger::Constants::MODE_DEBUG) {
theMainWindow->setDockActionsVisible(true);
Perspective *perspective = theMainWindow->d->m_currentPerspective;
if (!perspective) {
const QSettings *settings = ICore::settings();
const QString lastPerspectiveId = settings->value(LAST_PERSPECTIVE_KEY).toString();
perspective = Perspective::findPerspective(lastPerspectiveId);
// If we don't find a perspective with the stored name, pick any.
// This can happen e.g. when a plugin was disabled that provided
// the stored perspective, or when the save file was modified externally.
if (!perspective && !theMainWindow->d->m_perspectives.isEmpty())
perspective = theMainWindow->d->m_perspectives.first();
}
// There's at least the debugger preset perspective that should be found above.
QTC_ASSERT(perspective, return);
perspective->select();
} else {
if (Perspective *perspective = theMainWindow->d->m_currentPerspective)
perspective->d->saveLayout();
theMainWindow->setDockActionsVisible(true);
Perspective *perspective = theMainWindow->d->m_currentPerspective;
if (!perspective) {
const QSettings *settings = ICore::settings();
const QString lastPerspectiveId = settings->value(LAST_PERSPECTIVE_KEY).toString();
perspective = Perspective::findPerspective(lastPerspectiveId);
// If we don't find a perspective with the stored name, pick any.
// This can happen e.g. when a plugin was disabled that provided
// the stored perspective, or when the save file was modified externally.
if (!perspective && !theMainWindow->d->m_perspectives.isEmpty())
perspective = theMainWindow->d->m_perspectives.first();
}
// There's at least the debugger preset perspective that should be found above.
QTC_ASSERT(perspective, return);
perspective->select();
}
theMainWindow->setDockActionsVisible(false);
void DebuggerMainWindow::leaveDebugMode()
{
if (Perspective *perspective = theMainWindow->d->m_currentPerspective)
perspective->d->saveLayout();
// Hide dock widgets manually in case they are floating.
for (QDockWidget *dockWidget : theMainWindow->dockWidgets()) {
if (dockWidget->isFloating())
dockWidget->hide();
}
theMainWindow->setDockActionsVisible(false);
// Hide dock widgets manually in case they are floating.
for (QDockWidget *dockWidget : theMainWindow->dockWidgets()) {
if (dockWidget->isFloating())
dockWidget->hide();
}
}

View File

@@ -126,7 +126,8 @@ public:
static void doShutdown();
static void showStatusMessage(const QString &message, int timeoutMS);
static void onModeChanged(Core::Id mode);
static void enterDebugMode();
static void leaveDebugMode();
static QWidget *centralWidgetStack();
void addSubPerspectiveSwitcher(QWidget *widget);

View File

@@ -700,7 +700,6 @@ public:
int lineNumber, QMenu *menu);
void toggleBreakpointHelper();
void onModeChanged(Id mode);
void updateDebugWithoutDeployMenu();
void startRemoteCdbSession();
@@ -1360,8 +1359,19 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
addCdbOptionPages(&m_optionPages);
m_optionPages.append(new LocalsAndExpressionsOptionsPage);
connect(ModeManager::instance(), &ModeManager::currentModeChanged,
this, &DebuggerPluginPrivate::onModeChanged);
connect(ModeManager::instance(), &ModeManager::currentModeAboutToChange, this, [] {
if (ModeManager::currentModeId() == MODE_DEBUG)
DebuggerMainWindow::leaveDebugMode();
});
connect(ModeManager::instance(), &ModeManager::currentModeChanged, this, [](Id mode) {
if (mode == MODE_DEBUG) {
DebuggerMainWindow::enterDebugMode();
if (IEditor *editor = EditorManager::currentEditor())
editor->widget()->setFocus();
}
});
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
this, &DebuggerPluginPrivate::updateDebugWithoutDeployMenu);
@@ -2287,19 +2297,6 @@ void DebuggerPlugin::extensionsInitialized()
dd->extensionsInitialized();
}
void DebuggerPluginPrivate::onModeChanged(Id mode)
{
DebuggerMainWindow::onModeChanged(mode);
// FIXME: This one gets always called, even if switching between modes
// different then the debugger mode. E.g. Welcome and Help mode and
// also on shutdown.
if (mode == MODE_DEBUG) {
if (IEditor *editor = EditorManager::currentEditor())
editor->widget()->setFocus();
}
}
} // namespace Internal
static bool buildTypeAccepted(QFlags<ToolMode> toolMode, BuildConfiguration::BuildType buildType)

View File

@@ -813,11 +813,13 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfileContextMenu->appendGroup(Constants::G_PROJECT_TREE);
// Open Terminal submenu
#if !defined(Q_OS_UNIX) || QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
ActionContainer * const openTerminal =
ActionManager::createMenu(ProjectExplorer::Constants::M_OPENTERMINALCONTEXT);
openTerminal->setOnAllDisabledBehavior(ActionContainer::Show);
dd->m_openTerminalMenu = openTerminal->menu();
dd->m_openTerminalMenu->setTitle(FileUtils::msgTerminalAction());
#endif
// "open with" submenu
ActionContainer * const openWith =
@@ -885,6 +887,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
#if !defined(Q_OS_UNIX) || QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
// Open Terminal Here menu
mfileContextMenu->addMenu(openTerminal, Constants::G_FILE_OPEN);
mfolderContextMenu->addMenu(openTerminal, Constants::G_FOLDER_FILES);
@@ -893,6 +896,14 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
cmd = ActionManager::registerAction(dd->m_openTerminalHere, Constants::OPENTERMINALHERE,
projecTreeContext);
dd->m_openTerminalMenu->addAction(dd->m_openTerminalHere);
#else
dd->m_openTerminalHere = new QAction(FileUtils::msgTerminalAction(), this);
cmd = ActionManager::registerAction(dd->m_openTerminalHere, Constants::OPENTERMINALHERE,
projecTreeContext);
mfileContextMenu->addAction(cmd, Constants::G_FILE_OPEN);
mfolderContextMenu->addAction(cmd, Constants::G_FOLDER_FILES);
#endif
dd->m_openTerminalHereBuildEnv = new QAction(tr("Build Environment"), this);
dd->m_openTerminalHereRunEnv = new QAction(tr("Run Environment"), this);

View File

@@ -71,7 +71,7 @@ static FileName defaultBuildDirectory(const QString &projectFilePath, const Kit
const QString projectName = QFileInfo(projectFilePath).completeBaseName();
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
QString projectDir = Project::projectDirectory(FileName::fromString(projectFilePath)).toString();
QString buildPath = expander.expand(ProjectExplorerPlugin::defaultBuildDirectoryTemplate());
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
return FileName::fromString(FileUtils::resolvePath(projectDir, buildPath));
}

View File

@@ -94,7 +94,7 @@ static QString buildDir(const QString &projectFilePath, const Kit *k)
BuildConfiguration::Unknown);
const QString projectDir
= Project::projectDirectory(FileName::fromString(projectFilePath)).toString();
const QString buildPath = expander.expand(ProjectExplorerPlugin::defaultBuildDirectoryTemplate());
const QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
return FileUtils::resolvePath(projectDir, buildPath);
}

View File

@@ -984,7 +984,7 @@ void QmakeProject::updateBuildSystemData()
return;
DeploymentData deploymentData;
collectData(rootProjectNode(), deploymentData);
collectData(file, deploymentData);
target->setDeploymentData(deploymentData);
BuildTargetInfoList appTargetList;
@@ -1025,7 +1025,7 @@ void QmakeProject::updateBuildSystemData()
workingDir += '/' + ti.target + ".app/Contents/MacOS";
BuildTargetInfo bti;
bti.targetFilePath = FileName::fromString(executableFor(node));
bti.targetFilePath = FileName::fromString(executableFor(node->proFile()));
bti.projectFilePath = node->filePath();
bti.workingDirectory = FileName::fromString(workingDir);
bti.displayName = bti.projectFilePath.toFileInfo().completeBaseName();
@@ -1077,9 +1077,8 @@ void QmakeProject::updateBuildSystemData()
target->setApplicationTargets(appTargetList);
}
void QmakeProject::collectData(const QmakeProFileNode *node, DeploymentData &deploymentData)
void QmakeProject::collectData(const QmakeProFile *file, DeploymentData &deploymentData)
{
QmakeProFile *file = node->proFile();
if (!file->isSubProjectDeployable(file->filePath()))
return;
@@ -1094,31 +1093,29 @@ void QmakeProject::collectData(const QmakeProFileNode *node, DeploymentData &dep
switch (file->projectType()) {
case ProjectType::ApplicationTemplate:
if (!installsList.targetPath.isEmpty())
collectApplicationData(node, deploymentData);
collectApplicationData(file, deploymentData);
break;
case ProjectType::SharedLibraryTemplate:
case ProjectType::StaticLibraryTemplate:
collectLibraryData(file, deploymentData);
break;
case ProjectType::SubDirsTemplate:
node->forEachNode({}, [this, &deploymentData](Node *subNode) {
if (auto subProject = dynamic_cast<QmakeProFileNode *>(subNode)) {
QTC_ASSERT(subProject->priFile(), return );
if (subProject->priFile()->includedInExactParse())
collectData(subProject, deploymentData);
}
});
for (const QmakePriFile *const subPriFile : file->subPriFilesExact()) {
auto subProFile = dynamic_cast<const QmakeProFile *>(subPriFile);
if (subProFile)
collectData(subProFile, deploymentData);
}
break;
default:
break;
}
}
void QmakeProject::collectApplicationData(const QmakeProFileNode *node, DeploymentData &deploymentData)
void QmakeProject::collectApplicationData(const QmakeProFile *file, DeploymentData &deploymentData)
{
QString executable = executableFor(node);
QString executable = executableFor(file);
if (!executable.isEmpty())
deploymentData.addFile(executable, node->proFile()->installsList().targetPath,
deploymentData.addFile(executable, file->installsList().targetPath,
DeployableFile::TypeExecutable);
}
@@ -1305,17 +1302,16 @@ void QmakeProject::warnOnToolChainMismatch(const QmakeProFile *pro) const
getFullPathOf(pro, Variable::QmakeCxx, bc));
}
QString QmakeProject::executableFor(const QmakeProFileNode *node)
QString QmakeProject::executableFor(const QmakeProFile *file)
{
const Kit *const kit = activeTarget() ? activeTarget()->kit() : nullptr;
const ToolChain *const tc = ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (!tc)
return QString();
TargetInformation ti = node->targetInformation();
TargetInformation ti = file->targetInformation();
QString target;
QmakeProFile *file = node->proFile();
QTC_ASSERT(file, return QString());
if (tc->targetAbi().os() == Abi::DarwinOS

View File

@@ -126,7 +126,7 @@ private:
void setAllBuildConfigurationsEnabled(bool enabled);
QString executableFor(const QmakeProFileNode *node);
QString executableFor(const QmakeProFile *file);
void updateRunConfigurations();
void updateCppCodeModel();
@@ -135,8 +135,8 @@ private:
static bool equalFileList(const QStringList &a, const QStringList &b);
void updateBuildSystemData();
void collectData(const QmakeProFileNode *node, ProjectExplorer::DeploymentData &deploymentData);
void collectApplicationData(const QmakeProFileNode *file,
void collectData(const QmakeProFile *file, ProjectExplorer::DeploymentData &deploymentData);
void collectApplicationData(const QmakeProFile *file,
ProjectExplorer::DeploymentData &deploymentData);
void collectLibraryData(const QmakeProFile *file,
ProjectExplorer::DeploymentData &deploymentData);

View File

@@ -318,6 +318,8 @@ void ItemLibraryWidget::setupImportTagWidget()
void ItemLibraryWidget::updateModel()
{
QTC_ASSERT(m_itemLibraryModel, return);
m_itemLibraryModel->update(m_itemLibraryInfo.data(), m_model.data());
updateImports();
updateSearch();

View File

@@ -72,7 +72,7 @@ WidgetInfo StatesEditorView::widgetInfo()
void StatesEditorView::rootNodeTypeChanged(const QString &/*type*/, int /*majorVersion*/, int /*minorVersion*/)
{
checkForWindow();
checkForStatesAvailability();
}
void StatesEditorView::toggleStatesViewExpanded()
@@ -200,11 +200,10 @@ void StatesEditorView::duplicateCurrentState()
setCurrentState(newState);
}
void StatesEditorView::checkForWindow()
void StatesEditorView::checkForStatesAvailability()
{
if (m_statesEditorWidget)
m_statesEditorWidget->showAddNewStatesButton(!rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Window")
&& !rootModelNode().metaInfo().isSubclassOf("QtQuick.Window.Popup"));
m_statesEditorWidget->showAddNewStatesButton(rootModelNode().metaInfo().isSubclassOf("QtQuick.Item"));
}
void StatesEditorView::setCurrentState(const QmlModelState &state)
@@ -314,7 +313,7 @@ void StatesEditorView::modelAttached(Model *model)
if (m_statesEditorWidget)
m_statesEditorWidget->setNodeInstanceView(nodeInstanceView());
checkForWindow();
checkForStatesAvailability();
resetModel();
}

View File

@@ -93,7 +93,7 @@ private:
void resetModel();
void addState();
void duplicateCurrentState();
void checkForWindow();
void checkForStatesAvailability();
private:
QPointer<StatesEditorModel> m_statesEditorModel;

View File

@@ -1550,6 +1550,7 @@ bool NodeMetaInfo::isGraphicalItem() const
{
return isSubclassOf("QtQuick.Item")
|| isSubclassOf("QtQuick.Window.Window")
|| isSubclassOf("QtQuick.Dialogs.Dialog")
|| isSubclassOf("QtQuick.Controls.Popup");
}

View File

@@ -51,10 +51,7 @@ bool QmlItemNode::isItemOrWindow(const ModelNode &modelNode)
if (modelNode.metaInfo().isSubclassOf("QtQuick.Item"))
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Window.Window") && modelNode.isRootNode())
return true;
if (modelNode.metaInfo().isSubclassOf("QtQuick.Controls.Popup"))
if (modelNode.metaInfo().isGraphicalItem() && modelNode.isRootNode())
return true;
return false;

View File

@@ -62,6 +62,7 @@ DocumentWarningWidget::DocumentWarningWidget(QWidget *parent)
m_headerLabel->setFont(boldFont);
m_messageLabel->setForegroundRole(QPalette::ToolTipText);
m_messageLabel->setWordWrap(true);
m_messageLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
m_ignoreWarningsCheckBox->setText(tr("Always ignore these warnings about features "
"not supported by Qt Quick Designer."));

View File

@@ -87,9 +87,11 @@ void TimelineView::nodeAboutToBeRemoved(const ModelNode &removedNode)
toolBar->removeTimeline(QmlTimeline(removedNode));
QString currentId = toolBar->currentTimelineId();
removedNode.setAuxiliaryData("removed@Internal", true);
if (currentId.isEmpty())
m_timelineWidget->graphicsScene()->clearTimeline();
else if (lastId != currentId)
if (lastId != currentId)
m_timelineWidget->setTimelineId(currentId);
}
}
@@ -397,7 +399,7 @@ QList<QmlTimeline> TimelineView::getTimelines() const
return timelines;
for (const ModelNode &modelNode : allModelNodes()) {
if (QmlTimeline::isValidQmlTimeline(modelNode)) {
if (QmlTimeline::isValidQmlTimeline(modelNode) && !modelNode.hasAuxiliaryData("removed@Internal")) {
timelines.append(modelNode);
}
}

View File

@@ -260,7 +260,7 @@ void TimelineWidget::connectToolbar()
}
}
setRecording(false);
setTimelineActive(false);
}
int TimelineWidget::adjacentFrame(const std::function<qreal(const QVector<qreal> &, qreal)> &fun) const
@@ -393,7 +393,7 @@ void TimelineWidget::setupScrollbar(int min, int max, int current)
void TimelineWidget::setTimelineId(const QString &id)
{
setRecording(!m_timelineView->getTimelines().isEmpty());
setTimelineActive(!m_timelineView->getTimelines().isEmpty());
if (m_timelineView->isAttached()) {
m_toolbar->setCurrentTimeline(m_timelineView->modelNodeForId(id));
m_toolbar->setCurrentState(m_timelineView->currentState().name());
@@ -401,7 +401,7 @@ void TimelineWidget::setTimelineId(const QString &id)
}
}
void TimelineWidget::setRecording(bool b)
void TimelineWidget::setTimelineActive(bool b)
{
if (b) {
m_toolbar->setVisible(true);

View File

@@ -68,7 +68,7 @@ public:
void setupScrollbar(int min, int max, int current);
void setTimelineId(const QString &id);
void setRecording(bool b);
void setTimelineActive(bool b);
public slots:
void selectionChanged();

View File

@@ -14,6 +14,12 @@
],
\"Category\" : \"Core\",
\"Description\" : \"Secondary Welcome Screen Plugin.\",
\"Arguments\" : [
{
\"Name\" : \"-notour\",
\"Description\" : \"Do not ask for taking a UI tour on startup\"
}
],
\"Url\" : \"http://www.qt.io\",
$$dependencyList
}

View File

@@ -51,7 +51,6 @@ void IntroductionWidget::askUserAboutIntroduction(QWidget *parent, QSettings *se
return;
auto messageBox = new CheckableMessageBox(parent);
messageBox->setWindowTitle(tr("Take a UI Tour"));
messageBox->setIconPixmap(QMessageBox::standardIcon(QMessageBox::Question));
messageBox->setText(
tr("Do you want to take a quick UI tour? This shows where the most important user "
"interface elements are, and how they are used, and will only take a minute. You can "

View File

@@ -132,16 +132,10 @@ class WelcomePlugin : public ExtensionSystem::IPlugin
public:
~WelcomePlugin() final { delete m_welcomeMode; }
bool initialize(const QStringList &, QString *) final
bool initialize(const QStringList &arguments, QString *) final
{
m_welcomeMode = new WelcomeMode;
return true;
}
void extensionsInitialized() final
{
m_welcomeMode->initPlugins();
ModeManager::activateMode(m_welcomeMode->id());
auto introAction = new QAction(tr("UI Tour"), this);
connect(introAction, &QAction::triggered, this, []() {
auto intro = new IntroductionWidget(ICore::mainWindow());
@@ -151,9 +145,21 @@ public:
ActionContainer *mhelp = ActionManager::actionContainer(Core::Constants::M_HELP);
if (QTC_GUARD(mhelp))
mhelp->addAction(cmd, Core::Constants::G_HELP_HELP);
connect(ICore::instance(), &ICore::coreOpened, this, []() {
IntroductionWidget::askUserAboutIntroduction(ICore::mainWindow(), ICore::settings());
}, Qt::QueuedConnection);
if (!arguments.contains("-notour")) {
connect(ICore::instance(), &ICore::coreOpened, this, []() {
IntroductionWidget::askUserAboutIntroduction(ICore::mainWindow(),
ICore::settings());
}, Qt::QueuedConnection);
}
return true;
}
void extensionsInitialized() final
{
m_welcomeMode->initPlugins();
ModeManager::activateMode(m_welcomeMode->id());
}
WelcomeMode *m_welcomeMode = nullptr;

View File

@@ -78,13 +78,13 @@ def menuVisibleAtEditor(editor, menuInList):
return True
return False
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
if platform.system() == 'Darwin':
menu.activateWindow()
success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0)))
if success:
menuInList[0] = menu
return success
except:
t, v = sys.exc_info()[:2]
test.log("Exception: %s" % str(t), str(v))
return False
# this function checks whether the given global point (QPoint)

View File

@@ -146,7 +146,7 @@ def main():
mainRect = getQModelIndexStr("text='Rectangle'", rootIndex)
doubleClick(waitForObject(mainRect))
if not object.exists(":DebugModeWidget_Debugger::Internal::ConsoleView"):
invokeMenuItem("Window", "Output Panes", "Debugger Console")
invokeMenuItem("Window", "Output Panes", "QML Debugger Console")
progressBarWait()
# color and float values have additional ZERO WIDTH SPACE (\u200b), different usage of
# whitespaces inside expressions is part of the test