Merge "Merge remote-tracking branch 'origin/4.13' into master"

This commit is contained in:
The Qt Project
2020-09-07 11:58:43 +00:00
36 changed files with 70 additions and 28 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -214,8 +214,8 @@
\c y properties of \e icon to those of the rectangles. \c y properties of \e icon to those of the rectangles.
\list 1 \list 1
\li In the \uicontrol States view, click the \inlineimage plus.png \li In the \uicontrol States view, select \uicontrol {Create New State}
button three times to create \e State1, \e State2, and \e State3. three times to create \e State1, \e State2, and \e State3.
\li Select \e State1 in \uicontrol States. \li Select \e State1 in \uicontrol States.
\li Select \inlineimage icons/action-icon.png \li Select \inlineimage icons/action-icon.png
to open the \uicontrol Actions menu, and then select to open the \uicontrol Actions menu, and then select

View File

@@ -229,7 +229,7 @@
\section1 Using States to Change Component Property Values \section1 Using States to Change Component Property Values
\list 1 \list 1
\li In the \uicontrol States view, select \inlineimage plus.png \li In the \uicontrol States view, select \uicontrol {Create New State}
twice to create two new states. twice to create two new states.
\image qmldesigner-borderimage-states.png "Active and inactive states" \image qmldesigner-borderimage-states.png "Active and inactive states"
\li Select \uicontrol State1. \li Select \uicontrol State1.

View File

@@ -68,9 +68,9 @@
\image qmldesigner-transitions.png "States view" \image qmldesigner-transitions.png "States view"
To add states, click the \inlineimage plus.png To add states, select \uicontrol {Create New State}. Click the new state to
button. Click the new state to switch to it in \uicontrol {Form Editor}, switch to it in \uicontrol {Form Editor}, and then modify the properties of
and then modify the properties of components in \uicontrol Properties. components in \uicontrol Properties.
For example, to change the appearance of a button, you can hide the button For example, to change the appearance of a button, you can hide the button
image and show another image in its place. Or, to add movement to the view, image and show another image in its place. Or, to add movement to the view,

View File

@@ -101,7 +101,7 @@
We create the states for displaying the Trip, Standard, and Navigation We create the states for displaying the Trip, Standard, and Navigation
screens by moving from viewport to viewport in \e Screen01.ui.qml and screens by moving from viewport to viewport in \e Screen01.ui.qml and
clicking \inlineimage plus.png "Add button" in the \uicontrol States view selecting \uicontrol {Create New State} in the \uicontrol States view
when the appropriate screen is displayed in the viewport. when the appropriate screen is displayed in the viewport.
We then create states for animations that are run when moving between the We then create states for animations that are run when moving between the

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -114,8 +114,7 @@
components in the \uicontrol {Form Editor}: components in the \uicontrol {Form Editor}:
\list 1 \list 1
\li In the \uicontrol States view, select the \inlineimage plus.png \li In the \uicontrol States view, select \uicontrol {Create New State}.
button.
\image loginui3-login-state.png "States view" \image loginui3-login-state.png "States view"
\li Enter \e loginState as the state name. \li Enter \e loginState as the state name.
\li Select \e verifyPasswordField in the \uicontrol Navigator, \li Select \e verifyPasswordField in the \uicontrol Navigator,

View File

@@ -257,10 +257,10 @@
in \uicontrol Timeline: in \uicontrol Timeline:
\list 1 \list 1
\li In \uicontrol States, select the \inlineimage plus.png \li In \uicontrol States, select \uicontrol {Create New State} twice to
button twice to add two states called \e loginState and add two states called \e loginState and \e registerState. You don't
\e registerState. You don't need to make any property changes this need to make any property changes this time, because you'll bind the
time, because you'll bind the states to property animations. states to property animations.
\li In \uicontrol Timeline, select the \inlineimage animation.png \li In \uicontrol Timeline, select the \inlineimage animation.png
(\uicontrol {Timeline Settings (S)}) button on the toolbar (or press (\uicontrol {Timeline Settings (S)}) button on the toolbar (or press
\key S to open the \uicontrol {Timeline Settings} dialog. \key S to open the \uicontrol {Timeline Settings} dialog.

View File

@@ -142,8 +142,8 @@
another animation is run that closes the side menu. When the animation another animation is run that closes the side menu. When the animation
finishes, the side menu returns to the \e closed state. finishes, the side menu returns to the \e closed state.
We select the \inlineimage plus.png We select \uicontrol {Create New State} in the \uicontrol States view to add
(\uicontrol Add) button in the \uicontrol States view to add the states: the states:
\image sidemenu-states.png "Side menu states" \image sidemenu-states.png "Side menu states"

View File

@@ -216,6 +216,7 @@ public:
PostPrintAction postPrintAction; PostPrintAction postPrintAction;
bool boldFontEnabled = true; bool boldFontEnabled = true;
bool prependCarriageReturn = false; bool prependCarriageReturn = false;
bool prependLineFeed = false;
}; };
OutputFormatter::OutputFormatter() : d(new Private) { } OutputFormatter::OutputFormatter() : d(new Private) { }
@@ -436,6 +437,7 @@ void OutputFormatter::append(const QString &text, const QTextCharFormat &format)
d->cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor); d->cursor.movePosition(QTextCursor::StartOfBlock, QTextCursor::KeepAnchor);
startPos = crPos + 1; startPos = crPos + 1;
} }
flushTrailingNewline();
if (startPos < text.count()) if (startPos < text.count())
d->cursor.insertText(text.mid(startPos), format); d->cursor.insertText(text.mid(startPos), format);
} }
@@ -495,6 +497,14 @@ void OutputFormatter::flushIncompleteLine()
d->incompleteLine.first.clear(); d->incompleteLine.first.clear();
} }
void Utils::OutputFormatter::flushTrailingNewline()
{
if (d->prependLineFeed) {
d->cursor.insertText("\n");
d->prependLineFeed = false;
}
}
void OutputFormatter::dumpIncompleteLine(const QString &line, OutputFormat format) void OutputFormatter::dumpIncompleteLine(const QString &line, OutputFormat format)
{ {
if (line.isEmpty()) if (line.isEmpty())
@@ -560,6 +570,7 @@ void OutputFormatter::flush()
{ {
if (!d->incompleteLine.first.isEmpty()) if (!d->incompleteLine.first.isEmpty())
flushIncompleteLine(); flushIncompleteLine();
flushTrailingNewline();
d->escapeCodeHandler.endFormatScope(); d->escapeCodeHandler.endFormatScope();
for (OutputLineParser * const p : qAsConst(d->lineParsers)) for (OutputLineParser * const p : qAsConst(d->lineParsers))
p->flush(); p->flush();
@@ -641,7 +652,8 @@ void OutputFormatter::appendMessage(const QString &text, OutputFormat format)
dumpIncompleteLine(out.mid(startPos), format); dumpIncompleteLine(out.mid(startPos), format);
break; break;
} }
doAppendMessage(out.mid(startPos, eolPos - startPos + 1), format); doAppendMessage(out.mid(startPos, eolPos - startPos), format);
d->prependLineFeed = true;
startPos = eolPos + 1; startPos = eolPos + 1;
} }
} }

View File

@@ -83,8 +83,8 @@ public:
void setDemoteErrorsToWarnings(bool demote); void setDemoteErrorsToWarnings(bool demote);
bool demoteErrorsToWarnings() const; bool demoteErrorsToWarnings() const;
// line contains at most one line feed character, and if it does occur, it's the last character. // Represents a single line, without a trailing line feed character.
// Either way, the input is to be considered "complete" for parsing purposes. // The input is to be considered "complete" for parsing purposes.
virtual Result handleLine(const QString &line, OutputFormat format) = 0; virtual Result handleLine(const QString &line, OutputFormat format) = 0;
virtual bool handleLink(const QString &href) { Q_UNUSED(href); return false; } virtual bool handleLink(const QString &href) { Q_UNUSED(href); return false; }
@@ -183,6 +183,7 @@ private:
void append(const QString &text, const QTextCharFormat &format); void append(const QString &text, const QTextCharFormat &format);
void initFormats(); void initFormats();
void flushIncompleteLine(); void flushIncompleteLine();
void flushTrailingNewline();
void dumpIncompleteLine(const QString &line, OutputFormat format); void dumpIncompleteLine(const QString &line, OutputFormat format);
void clearLastLine(); void clearLastLine();
QList<FormattedText> parseAnsi(const QString &text, const QTextCharFormat &format); QList<FormattedText> parseAnsi(const QString &text, const QTextCharFormat &format);

View File

@@ -396,6 +396,8 @@ bool CppHighlighter::highlightRawStringLiteral(const QStringView &_text, const T
if (text.at(tk.utf16charsEnd() - 1) != '"') if (text.at(tk.utf16charsEnd() - 1) != '"')
return false; return false;
const int endDelimiterOffset = tk.utf16charsEnd() - 1 - delimiter.length(); const int endDelimiterOffset = tk.utf16charsEnd() - 1 - delimiter.length();
if (endDelimiterOffset <= delimiterOffset)
return false;
if (text.mid(endDelimiterOffset, delimiter.length()) != delimiter) if (text.mid(endDelimiterOffset, delimiter.length()) != delimiter)
return false; return false;
if (text.at(endDelimiterOffset - 1) != ')') if (text.at(endDelimiterOffset - 1) != ')')

View File

@@ -104,6 +104,11 @@ static TextEditor::TextStyle styleForFormat(int format)
case Format_Squash: return C_ENUMERATION; case Format_Squash: return C_ENUMERATION;
case Format_Fixup: return C_NUMBER; case Format_Fixup: return C_NUMBER;
case Format_Exec: return C_LABEL; case Format_Exec: return C_LABEL;
case Format_Break: return C_PREPROCESSOR;
case Format_Drop: return C_REMOVED_LINE;
case Format_Label: return C_LABEL;
case Format_Reset: return C_LABEL;
case Format_Merge: return C_LABEL;
case Format_Count: case Format_Count:
QTC_CHECK(false); // should never get here QTC_CHECK(false); // should never get here
return C_TEXT; return C_TEXT;
@@ -125,6 +130,11 @@ GitRebaseHighlighter::GitRebaseHighlighter(QTextDocument *parent) :
m_actions << RebaseAction("^(s|squash)\\b", Format_Squash); m_actions << RebaseAction("^(s|squash)\\b", Format_Squash);
m_actions << RebaseAction("^(f|fixup)\\b", Format_Fixup); m_actions << RebaseAction("^(f|fixup)\\b", Format_Fixup);
m_actions << RebaseAction("^(x|exec)\\b", Format_Exec); m_actions << RebaseAction("^(x|exec)\\b", Format_Exec);
m_actions << RebaseAction("^(b|break)\\b", Format_Break);
m_actions << RebaseAction("^(d|drop)\\b", Format_Drop);
m_actions << RebaseAction("^(l|label)\\b", Format_Label);
m_actions << RebaseAction("^(t|reset)\\b", Format_Reset);
m_actions << RebaseAction("^(m|merge)\\b", Format_Merge);
} }
void GitRebaseHighlighter::highlightBlock(const QString &text) void GitRebaseHighlighter::highlightBlock(const QString &text)

View File

@@ -42,6 +42,11 @@ enum Format {
Format_Squash, Format_Squash,
Format_Fixup, Format_Fixup,
Format_Exec, Format_Exec,
Format_Break,
Format_Drop,
Format_Label,
Format_Reset,
Format_Merge,
Format_Count Format_Count
}; };

View File

@@ -57,7 +57,7 @@ LinuxIccParser::LinuxIccParser() :
// ".pch/Qt5Core.pchi.cpp": creating precompiled header file ".pch/Qt5Core.pchi" // ".pch/Qt5Core.pchi.cpp": creating precompiled header file ".pch/Qt5Core.pchi"
// "animation/qabstractanimation.cpp": using precompiled header file ".pch/Qt5Core.pchi" // "animation/qabstractanimation.cpp": using precompiled header file ".pch/Qt5Core.pchi"
m_pchInfoLine.setPattern(QLatin1String("^\".*?\": (creating|using) precompiled header file \".*?\"\n$")); m_pchInfoLine.setPattern(QLatin1String("^\".*?\": (creating|using) precompiled header file \".*?\"$"));
QTC_CHECK(m_pchInfoLine.isValid()); QTC_CHECK(m_pchInfoLine.isValid());
} }

View File

@@ -115,11 +115,10 @@ TestTerminator::TestTerminator(OutputParserTester *t) :
Utils::OutputLineParser::Result TestTerminator::handleLine(const QString &line, Utils::OutputFormat type) Utils::OutputLineParser::Result TestTerminator::handleLine(const QString &line, Utils::OutputFormat type)
{ {
QTC_CHECK(line.endsWith('\n'));
if (type == Utils::StdOutFormat) if (type == Utils::StdOutFormat)
m_tester->m_receivedStdOutChildLine.append(line); m_tester->m_receivedStdOutChildLine.append(line + '\n');
else else
m_tester->m_receivedStdErrChildLine.append(line); m_tester->m_receivedStdErrChildLine.append(line + '\n');
return Status::Done; return Status::Done;
} }

View File

@@ -67,7 +67,7 @@ Task::Task(TaskType type_, const QString &description,
const QIcon &icon, Options options) : const QIcon &icon, Options options) :
taskId(s_nextId), type(type_), options(options), summary(description), taskId(s_nextId), type(type_), options(options), summary(description),
line(line_), movedLine(line_), category(category_), line(line_), movedLine(line_), category(category_),
icon(icon.isNull() ? taskTypeIcon(type_) : icon) m_icon(icon)
{ {
++s_nextId; ++s_nextId;
setFile(file_); setFile(file_);
@@ -108,7 +108,7 @@ void Task::clear()
line = -1; line = -1;
movedLine = -1; movedLine = -1;
category = Utils::Id(); category = Utils::Id();
icon = QIcon(); m_icon = QIcon();
formats.clear(); formats.clear();
m_mark.clear(); m_mark.clear();
} }
@@ -133,6 +133,13 @@ QString Task::description() const
return desc; return desc;
} }
QIcon Task::icon() const
{
if (m_icon.isNull())
m_icon = taskTypeIcon(type);
return m_icon;
}
// //
// functions // functions
// //

View File

@@ -74,6 +74,7 @@ public:
void clear(); void clear();
void setFile(const Utils::FilePath &file); void setFile(const Utils::FilePath &file);
QString description() const; QString description() const;
QIcon icon() const;
unsigned int taskId = 0; unsigned int taskId = 0;
TaskType type = Unknown; TaskType type = Unknown;
@@ -85,7 +86,6 @@ public:
int line = -1; int line = -1;
int movedLine = -1; // contains a line number if the line was moved in the editor int movedLine = -1; // contains a line number if the line was moved in the editor
Utils::Id category; Utils::Id category;
QIcon icon;
// Having a container of QTextLayout::FormatRange in Task isn't that great // Having a container of QTextLayout::FormatRange in Task isn't that great
// It would be cleaner to split up the text into // It would be cleaner to split up the text into
@@ -101,6 +101,7 @@ private:
void setMark(TextEditor::TextMark *mark); void setMark(TextEditor::TextMark *mark);
QSharedPointer<TextEditor::TextMark> m_mark; QSharedPointer<TextEditor::TextMark> m_mark;
mutable QIcon m_icon;
static unsigned int s_nextId; static unsigned int s_nextId;
friend class TaskHub; friend class TaskHub;

View File

@@ -78,8 +78,8 @@ public:
} else { } else {
setToolTip(task.description()); setToolTip(task.description());
} }
setIcon(task.icon); setIcon(task.icon());
setVisible(!task.icon.isNull()); setVisible(!task.icon().isNull());
} }
bool isClickable() const override; bool isClickable() const override;

View File

@@ -255,7 +255,7 @@ QVariant TaskModel::data(const QModelIndex &index, int role) const
else if (role == TaskModel::Category) else if (role == TaskModel::Category)
return m_tasks.at(index.row()).category.uniqueIdentifier(); return m_tasks.at(index.row()).category.uniqueIdentifier();
else if (role == TaskModel::Icon) else if (role == TaskModel::Icon)
return m_tasks.at(index.row()).icon; return m_tasks.at(index.row()).icon();
else if (role == TaskModel::Task_t) else if (role == TaskModel::Task_t)
return QVariant::fromValue(task(index)); return QVariant::fromValue(task(index));
return QVariant(); return QVariant();

View File

@@ -334,6 +334,8 @@ extend_qtc_plugin(QmlDesigner
navigatortreeview.cpp navigatortreeview.h navigatortreeview.cpp navigatortreeview.h
navigatorview.cpp navigatorview.h navigatorview.cpp navigatorview.h
navigatorwidget.cpp navigatorwidget.h navigatorwidget.cpp navigatorwidget.h
choosetexturepropertydialog.cpp choosetexturepropertydialog.h
choosetexturepropertydialog.ui
) )
extend_qtc_plugin(QmlDesigner extend_qtc_plugin(QmlDesigner

View File

@@ -610,6 +610,9 @@ Project {
"navigator/navigatorview.h", "navigator/navigatorview.h",
"navigator/navigatorwidget.cpp", "navigator/navigatorwidget.cpp",
"navigator/navigatorwidget.h", "navigator/navigatorwidget.h",
"navigator/choosetexturepropertydialog.cpp",
"navigator/choosetexturepropertydialog.h",
"navigator/choosetexturepropertydialog.ui",
"propertyeditor/aligndistribute.cpp", "propertyeditor/aligndistribute.cpp",
"propertyeditor/aligndistribute.h", "propertyeditor/aligndistribute.h",
"propertyeditor/designerpropertymap.cpp", "propertyeditor/designerpropertymap.cpp",

View File

@@ -511,6 +511,7 @@ void QtSupportPlugin::testQtOutputFormatter_appendMixedAssertAndAnsi()
"Blue\n"; "Blue\n";
formatter.appendMessage(inputText, StdOutFormat); formatter.appendMessage(inputText, StdOutFormat);
formatter.flush();
QCOMPARE(edit.toPlainText(), outputText); QCOMPARE(edit.toPlainText(), outputText);