Merge remote-tracking branch 'origin/13.0'

Conflicts:
	src/plugins/remotelinux/linuxdevice.cpp

Change-Id: Iad28a1bfa4632922931d351d2fe27757cf21dec3
This commit is contained in:
Eike Ziller
2024-04-15 08:33:39 +02:00
27 changed files with 113 additions and 53 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -11,6 +11,9 @@
You can connect Android devices to the development PC using USB cables to
build, run, debug, and analyze applications from \QC.
\note \QC only detects a device and connects to it after you
\l{Debugging on Android Devices}{enable USB debugging on it}.
To develop for Android, you must install a tool chain for building
applications for Android devices on the development PC. \QC can automatically
download and install the tool chain and create a suitable build and run

View File

@@ -1,4 +1,4 @@
// Copyright (C) 2018 The Qt Company Ltd.
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
// **********************************************************************
@@ -47,13 +47,13 @@
border on the line where the \c startNewGame() function is
called (1).
\image qtquick-example-setting-breakpoint1.png
\image qtquick-example-setting-breakpoint1.webp {Breakpoint in the code editor}
The red circle indicates that a breakpoint is now set on that line
number.
\li Select \uicontrol Debug > \uicontrol {Start Debugging} >
\uicontrol {Start Debugging of Startup Project} or press
\li Go to \uicontrol Debug > \uicontrol {Start Debugging} >
\uicontrol {Start Debugging of Startup Project}, or press
\key{F5}.
\li Once the Same Game application starts, select \uicontrol {Puzzle}
@@ -63,26 +63,26 @@
\li When the debugger hits the breakpoint, it interrupts the
application. \QC displays the nested function calls leading to the
current position as a call stack trace (1).
current position as a call stack trace.
\image qtquick-example-setting-breakpoint2.png
\image qtquick-example-setting-breakpoint2.webp {Debugger view}
\li Click the \inlineimage icons/debugger_stepinto_small.png
(\uicontrol {Step Into}) button on the toolbar or press \key F11 to step
\li Select \inlineimage icons/debugger_stepinto_small.png
(\uicontrol {Step Into}) on the toolbar or press \key F11 to step
into the code in the stack. The samegame.js file opens in the code
editor at the function that starts a new game.
\image qtquick-example-stack.png
\image qtquick-example-stack.webp {Stack view}
\li Examine the local variables in the \uicontrol Locals
view. Step through the code to see how the information changes in
the view.
\li Add a breakpoint at the end of the \c {startNewGame()} function, and
click \inlineimage icons/qtcreator-debugging-continue.png
select \inlineimage icons/qtcreator-debugging-continue.png
(\uicontrol Continue) to hit the breakpoint.
\image qtquick-example-setting-breakpoint3.png
\image qtquick-example-setting-breakpoint3.webp {Second breakpoint in the Breakpoints view}
\li To execute JavaScript commands in the current context, open the
\uicontrol {QML Debugger Console}.
@@ -97,11 +97,11 @@
\image qtquick-example-qml-inspector.png
\li Select \uicontrol Debug > \uicontrol {Show Application on Top} to
\li Go to \uicontrol Debug > \uicontrol {Show Application on Top} to
keep the application visible while you interact with the debugger.
\li Select \uicontrol Debug > \uicontrol Select to activate selection
mode and then click the \uicontrol Menu button to move into the
\li Go to \uicontrol Debug > \uicontrol Select to activate selection
mode, and then select \uicontrol Menu to move into the
\uicontrol menuButton component in the \uicontrol Locals view and
the code editor.

View File

@@ -79,7 +79,11 @@
If you hide the annotations, you can move the mouse pointer over an icon to
view them.
\sa {Analyze code with Clang-Tidy and Clazy}, {JavaScript and QML Checks}
\if defined(qtcreator)
\sa {Analyze code with Clang-Tidy and Clazy}
\endif
\sa {JavaScript and QML Checks}
*/
/*!

View File

@@ -45,7 +45,11 @@ signals:
void lostFocus();
private:
void focusOutEvent(QFocusEvent *) override { emit lostFocus(); }
void focusOutEvent(QFocusEvent *e) override
{
QPlainTextEdit::focusOutEvent(e);
emit lostFocus();
}
};
} // namespace Internal

View File

@@ -209,7 +209,8 @@ static bool isChildOf(const FilePath &path, const FilePaths &prefixes)
static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
const FilePath &sourceDirectory,
const FilePath &buildDirectory,
bool relativeLibs)
bool relativeLibs,
const QSet<FilePath> &artifacts)
{
const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir);
@@ -341,14 +342,17 @@ static CMakeBuildTarget toBuildTarget(const TargetDetails &t,
librarySeachPaths.append(tmp);
if (buildDir.osType() == OsTypeWindows && dllName) {
if (tmp.pathAppended(*dllName).exists())
const auto validPath = [&artifacts](const FilePath& path) {
return path.exists() || artifacts.contains(path);
};
if (validPath(tmp.pathAppended(*dllName)))
librarySeachPaths.append(tmp);
// Libraries often have their import libs in ../lib and the
// actual dll files in ../bin on windows. Qt is one example of that.
if (tmp.fileName() == "lib" && buildDir.osType() == OsTypeWindows) {
if (tmp.fileName() == "lib") {
const FilePath path = tmp.parentDir().pathAppended("bin");
if (path.isDir() && path.pathAppended(*dllName).exists())
if (path.isDir() && validPath(path.pathAppended(*dllName)))
librarySeachPaths.append(path);
}
}
@@ -367,12 +371,17 @@ static QList<CMakeBuildTarget> generateBuildTargets(const QFuture<void> &cancelF
const FilePath &buildDirectory,
bool relativeLibs)
{
QSet<FilePath> artifacts;
for (const TargetDetails &t : input.targetDetails)
for (const FilePath &p: t.artifacts)
artifacts.insert(buildDirectory.resolvePath(p));
QList<CMakeBuildTarget> result;
result.reserve(input.targetDetails.size());
for (const TargetDetails &t : input.targetDetails) {
if (cancelFuture.isCanceled())
return {};
result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs));
result.append(toBuildTarget(t, sourceDirectory, buildDirectory, relativeLibs, artifacts));
}
return result;
}

View File

@@ -1035,12 +1035,57 @@ void ICore::addPreCloseListener(const std::function<bool ()> &listener)
d->m_preCloseListeners.append(listener);
}
QString uiConfigInformation()
{
QString info("UI configuration:\n\n");
info.append(QString("Color: %1\n").arg(StyleHelper::requestedBaseColor().name()));
info.append(QString("Theme: %1 \"%2\"\n").arg(creatorTheme()->id())
.arg(creatorTheme()->displayName()));
const QString toolbarStyle =
StyleHelper::toolbarStyle() == StyleHelper::ToolbarStyleCompact ? "Compact" : "Relaxed";
info.append(QString("Toolbar style: Utils::StyleHelper::ToolbarStyle%1\n").arg(toolbarStyle));
const QString policy =
QVariant::fromValue(QApplication::highDpiScaleFactorRoundingPolicy()).toString();
QString userInterfaceLanguage = ICore::userInterfaceLanguage();
if (userInterfaceLanguage.isEmpty())
userInterfaceLanguage = QLocale::system().name() + " (System Language)";
info.append(QString("Language: %1\n").arg(userInterfaceLanguage));
info.append(QString("Device pixel ratio: %1, Qt::HighDpiScaleFactorRoundingPolicy::%2\n")
.arg(qApp->devicePixelRatio()).arg(policy));
info.append(QString("Font DPI: %1\n").arg(qApp->fontMetrics().fontDpi()));
info.append(QString("Utils::StyleHelper::UiElement:\n"));
#define QTC_ADD_UIELEMENT_FONT(uiElement) ( \
info.append(QString(" %1: %2\n").arg(#uiElement) \
.arg(StyleHelper::uiFont(StyleHelper::UiElement##uiElement).toString())) \
);
QTC_ADD_UIELEMENT_FONT(H1);
QTC_ADD_UIELEMENT_FONT(H2);
QTC_ADD_UIELEMENT_FONT(H3);
QTC_ADD_UIELEMENT_FONT(H4);
QTC_ADD_UIELEMENT_FONT(H5);
QTC_ADD_UIELEMENT_FONT(H6);
QTC_ADD_UIELEMENT_FONT(H6Capital);
QTC_ADD_UIELEMENT_FONT(Body1);
QTC_ADD_UIELEMENT_FONT(Body2);
QTC_ADD_UIELEMENT_FONT(ButtonMedium);
QTC_ADD_UIELEMENT_FONT(ButtonSmall);
QTC_ADD_UIELEMENT_FONT(CaptionStrong);
QTC_ADD_UIELEMENT_FONT(Caption);
QTC_ADD_UIELEMENT_FONT(IconStandard);
QTC_ADD_UIELEMENT_FONT(IconActive);
#undef QTC_ADD_UIELEMENT_FONT
return info;
}
/*!
\internal
*/
QString ICore::systemInformation()
{
return PluginManager::systemInformation() + '\n' + aboutInformationCompact() + '\n';
return PluginManager::systemInformation() + '\n' + uiConfigInformation() + '\n'
+ aboutInformationCompact() + '\n';
}
static const QString &screenShotsPath()

View File

@@ -194,10 +194,10 @@ DeviceSettings::DeviceSettings()
displayName.setValueAcceptor(
[validateDisplayName](const QString &old,
const QString &newValue) -> std::optional<QString> {
if (validateDisplayName(old, newValue))
if (!validateDisplayName(old, newValue))
return std::nullopt;
return old;
return newValue;
});
}

View File

@@ -1,10 +1,7 @@
# Copyright (C) 2016 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
try:
import __builtin__ # Python 2
except ImportError:
import builtins as __builtin__ # Python 3
import builtins
# for easier re-usage (because Python hasn't an enum type)
class Targets:
@@ -128,7 +125,7 @@ class QtPath:
@staticmethod
def toVersionTuple(versionString):
return tuple(map(__builtin__.int, versionString.split(".")))
return tuple(map(builtins.int, versionString.split(".")))
@staticmethod
def getQtVersion(target):

View File

@@ -603,7 +603,7 @@ def __writeProjectTreeFile__(projectTree, filename):
def __getTestData__(record):
return [testData.field(record, "text"),
__builtin__.int(testData.field(record, "nestinglevel"))]
builtins.int(testData.field(record, "nestinglevel"))]
def compareProjectTree(rootObject, dataset):
root = waitForObject(rootObject)

View File

@@ -12,11 +12,7 @@ import subprocess;
import sys
import errno;
from datetime import datetime,timedelta;
if sys.version_info.major > 2:
import builtins as __builtin__
else:
import __builtin__
import builtins
srcPath = ''
SettingsPath = []

View File

@@ -71,15 +71,15 @@ def verifyEnabled(objectSpec, expectedState = True):
# param itemName is the item to be selected in the combo box
# returns True if selection was changed or False if the wanted value was already selected
def selectFromCombo(objectSpec, itemName):
object = verifyEnabled(objectSpec)
if itemName == str(object.currentText):
comboObject = verifyEnabled(objectSpec)
if itemName == str(comboObject.currentText):
return False
else:
mouseClick(object)
mouseClick(comboObject)
snooze(1)
# params required here
mouseClick(waitForObjectItem(object, itemName.replace(".", "\\.")), 5, 5, 0, Qt.LeftButton)
test.verify(waitFor("str(object.currentText)==itemName", 5000),
mouseClick(waitForObjectItem(comboObject, itemName.replace(".", "\\.")))
test.verify(waitFor("str(comboObject.currentText)==itemName", 5000),
"Switched combo item to '%s'" % itemName)
return True
@@ -588,15 +588,12 @@ def getHelpTitle():
def isString(sth):
if sys.version_info.major > 2:
return isinstance(sth, str)
else:
return isinstance(sth, (str, unicode))
return isinstance(sth, str)
# helper function to ensure we get str, converts bytes if necessary
def stringify(obj):
stringTypes = (str, unicode) if sys.version_info.major == 2 else (str)
if isinstance(obj, stringTypes):
if isString(obj):
return obj
if isinstance(obj, bytes):
if not platform.system() in ('Microsoft', 'Windows'):

View File

@@ -33,7 +33,7 @@ def main():
__modifyFile__(fileName, modification)
test.log("Reverting all files...")
fileModifications = dict(zip(fileModifications.keys(),
(__builtin__.bool(v) for v in fileModifications.values())))
(builtins.bool(v) for v in fileModifications.values())))
revertChanges(fileModifications)
invokeMenuItem("File", "Exit")

View File

@@ -12,8 +12,8 @@ def cmakeSupported():
versionLine = next(iter(versionLines))
test.log("Using " + versionLine)
matcher = re.match("cmake version (\d+)\.(\d+)\.\d+", versionLine)
major = __builtin__.int(matcher.group(1))
minor = __builtin__.int(matcher.group(2))
major = builtins.int(matcher.group(1))
minor = builtins.int(matcher.group(2))
except:
return False

View File

@@ -79,7 +79,12 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
menu = ":Qt Creator.Project.Menu.Folder_QMenu"
else:
menu = ":Qt Creator.Project.Menu.File_QMenu"
activateItem(waitForObjectItem(menu, "Rename..."))
try:
activateItem(waitForObjectItem(menu, "Rename...", 5000))
except:
# Try getting an enabled item by reopening the menu
openItemContextMenu(treeview, oldItemText, 5, 5, 0)
activateItem(waitForObjectItem(menu, "Rename...", 5000))
replaceEdit = waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit")
test.compare(replaceEdit.selectedText, oldname.rsplit(".", 1)[0],
"Only the filename without the extension is selected?")

View File

@@ -104,7 +104,7 @@ def __writeOutlineFile__(outlinePseudoTree, filename):
def retrieveData(record):
return (testData.field(record, "element"),
__builtin__.int(testData.field(record, "nestinglevel")),
builtins.int(testData.field(record, "nestinglevel")),
testData.field(record, "value"))
def verifyOutline(outlinePseudoTree, datasetFileName):

View File

@@ -243,7 +243,7 @@ def main():
# QString QTextCursor::selectedText () const:
# "Note: If the selection obtained from an editor spans a line break, the text will contain a
# Unicode U+2029 paragraph separator character instead of a newline \n character."
newParagraph = chr(0x2029) if sys.version_info.major > 2 else unichr(0x2029)
newParagraph = chr(0x2029)
selectedText = str(editor.textCursor().selectedText()).replace(newParagraph, "\n")
invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...")
test.compare(waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit").plainText,