Merge "Merge remote-tracking branch 'origin/4.8'"

This commit is contained in:
Eike Ziller
2019-01-07 12:43:43 +00:00
committed by The Qt Project
39 changed files with 1074 additions and 880 deletions

View File

@@ -619,6 +619,11 @@
Double-click on entries in the \uicontrol {Debugger Perspectives} view to
switch between snapshots. The debugger views are updated to reflect the state
of the program at time of taking the snapshot.
\note Creating snapshots involves creating core files of the debugged process,
requiring significant amount of disk space. For details, see
\l{https://sourceware.org/gdb/onlinedocs/gdb/Core-File-Generation.html}.
\endomit
*/

View File

@@ -189,7 +189,7 @@ class Dumper(DumperBase):
self.nativeStructAlignment(nativeType)
if code == TypeCodeEnum:
tdata.enumDisplay = lambda intval, addr, form : \
self.nativeTypeEnumDisplay(nativeType, addr, form)
self.nativeTypeEnumDisplay(nativeType, intval, form)
tdata.templateArguments = self.listTemplateParameters(nativeType.name())
self.registerType(typeId, tdata) # Fix up fields and template args
return self.Type(self, typeId)
@@ -215,11 +215,11 @@ class Dumper(DumperBase):
align = handleItem(f.type(), align)
return align
def nativeTypeEnumDisplay(self, nativeType, addr, form):
value = cdbext.createValue(addr, nativeType)
def nativeTypeEnumDisplay(self, nativeType, intval, form):
value = self.nativeParseAndEvaluate('(%s)%d' % (nativeType.name(), intval))
if value is None:
return ''
return enumDisplay(value)
return self.enumValue(value)
def enumExpression(self, enumType, enumValue):
ns = self.qtNamespace()

View File

@@ -3379,6 +3379,19 @@ class DumperBase:
def type(self, typeId):
return self.typeData.get(typeId)
def splitArrayType(self, type_name):
# "foo[2][3][4]" -> ("foo", "[3][4]", 2)
pos1 = len(type_name)
# In case there are more dimensions we need the inner one.
while True:
pos1 = type_name.rfind('[', 0, pos1 - 1)
pos2 = type_name.find(']', pos1)
if type_name[pos1 - 1] != ']':
break
item_count = type_name[pos1+1:pos2]
return (type_name[0:pos1].strip(), type_name[pos2+1:].strip(), int(item_count))
def registerType(self, typeId, tdata):
#warn('REGISTER TYPE: %s' % typeId)
self.typeData[typeId] = tdata
@@ -3585,16 +3598,6 @@ class DumperBase:
def pointer(self):
return self.dumper.createPointerType(self)
def splitArrayType(self):
# -> (inner type, count)
if not self.code == TypeCodeArray:
error('Not an array')
s = self.name
pos1 = s.rfind('[')
pos2 = s.find(']', pos1)
itemCount = s[pos1+1:pos2]
return (self.dumper.createType(s[0:pos1].strip()), int(s[pos1+1:pos2]))
def target(self):
return self.typeData().ltarget
@@ -3613,9 +3616,6 @@ class DumperBase:
def bitsize(self):
if self.lbitsize is not None:
return self.lbitsize
if self.code == TypeCodeArray:
(innerType, itemCount) = self.splitArrayType()
return itemCount * innerType.bitsize()
error('DONT KNOW SIZE: %s' % self)
def isMovableType(self):
@@ -3748,14 +3748,23 @@ class DumperBase:
error('Expected type in createArrayType(), got %s'
% type(targetType))
targetTypeId = targetType.typeId
typeId = '%s[%d]' % (targetTypeId, count)
if targetTypeId.endswith(']'):
(prefix, suffix, inner_count) = self.splitArrayType(targetTypeId)
type_id = '%s[%d][%d]%s' % (prefix, count, inner_count, suffix)
type_name = type_id
else:
type_id = '%s[%d]' % (targetTypeId, count)
type_name = '%s[%d]' % (targetType.name, count)
tdata = self.TypeData(self)
tdata.name = '%s[%d]' % (targetType.name, count)
tdata.typeId = typeId
tdata.name = type_name
tdata.typeId = type_id
tdata.code = TypeCodeArray
tdata.ltarget = targetType
self.registerType(typeId, tdata)
return self.Type(self, typeId)
tdata.lbitsize = targetType.lbitsize * count
self.registerType(type_id, tdata)
return self.Type(self, type_id)
def createBitfieldType(self, targetType, bitsize):
if not isinstance(targetType, self.Type):
@@ -3796,13 +3805,6 @@ class DumperBase:
#typish.check()
return typish
if isinstance(typish, str):
if typish.endswith(']') and not typish.endswith('[]'):
# Array fallback.
pos1 = typish.rfind('[')
itemType = self.createType(typish[0:pos1].strip())
itemCount = int(typish[pos1+1:-1])
return self.createArrayType(itemType, itemCount)
def knownSize(tn):
if tn[0] == 'Q':
if tn in ('QByteArray', 'QString', 'QList', 'QStringList',

View File

@@ -247,8 +247,14 @@ class Dumper(DumperBase):
if targetType.code == gdb.TYPE_CODE_ARRAY:
val = self.Value(self)
else:
# Cast may fail (e.g for arrays, see test for Bug5799)
val = self.fromNativeValue(nativeValue.cast(targetType))
try:
# Cast may fail for arrays, for typedefs to __uint128_t with
# gdb.error: That operation is not available on integers
# of more than 8 bytes.
# See test for Bug5799, QTCREATORBUG-18450.
val = self.fromNativeValue(nativeValue.cast(targetType))
except:
val = self.Value(self)
#warn('CREATED TYPEDEF: %s' % val)
else:
val = self.Value(self)

View File

@@ -105,9 +105,11 @@ static bool isArrayType(const std::string &typeName)
static ULONG extractArraySize(const std::string &typeName, size_t openArrayPos = 0)
{
if (openArrayPos == 0)
openArrayPos = typeName.find_last_of('[');
const auto closeArrayPos = typeName.find_last_of(']');
if (openArrayPos == std::string::npos || closeArrayPos == std::string::npos)
openArrayPos = typeName.find_first_of('[');
if (openArrayPos == std::string::npos)
return 0;
const auto closeArrayPos = typeName.find_first_of(']', openArrayPos);
if (closeArrayPos == std::string::npos)
return 0;
const std::string arraySizeString = typeName.substr(openArrayPos + 1,
closeArrayPos - openArrayPos - 1);
@@ -327,8 +329,15 @@ std::string PyType::targetName() const
const std::string &typeName = name();
if (isPointerType(typeName))
return stripPointerType(typeName);
if (isArrayType(typeName))
return typeName.substr(0, typeName.find_last_of('['));
if (isArrayType(typeName)) {
const auto openArrayPos = typeName.find_first_of('[');
if (openArrayPos == std::string::npos)
return typeName;
const auto closeArrayPos = typeName.find_first_of(']', openArrayPos);
if (closeArrayPos == std::string::npos)
return typeName;
return typeName.substr(0, openArrayPos) + typeName.substr(closeArrayPos + 1);
}
return typeName;
}

View File

@@ -144,7 +144,7 @@ QString FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const
if (originalPath.isEmpty()) // e.g. qrc://
originalPath = fileUrl.path();
QString result;
QString result = originalPath;
bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) {
result = fileName;
});

View File

@@ -186,7 +186,8 @@ bool SaveFile::commit()
const QString &renameError = m_tempFile->errorString();
m_tempFile->remove();
setErrorString(renameError);
result = false;
QFile::rename(backupName, finalFileName); // rollback to backup if possible ...
return false; // ... or keep the backup copy at least
}
QFile::remove(backupName);

View File

@@ -186,9 +186,10 @@ void AndroidDebugSupport::start()
gdbServer.setPort(m_runner->gdbServerPort().number());
setRemoteChannel(gdbServer);
int sdkVersion = qMax(AndroidManager::minimumSDK(target), AndroidManager::minimumNDK(target));
Utils::FileName sysRoot = AndroidConfigurations::currentConfig().ndkLocation()
.appendPath("platforms")
.appendPath(QString("android-%1").arg(AndroidManager::minimumSDK(target)))
.appendPath(QString("android-%1").arg(sdkVersion))
.appendPath(toNdkArch(AndroidManager::targetArch(target)));
setSysRoot(sysRoot);
qCDebug(androidDebugSupportLog) << "Sysroot: " << sysRoot;

View File

@@ -247,6 +247,13 @@ int AndroidManager::minimumSDK(const ProjectExplorer::Kit *kit)
return minSDKVersion;
}
int AndroidManager::minimumNDK(ProjectExplorer::Target *target)
{
auto qt = static_cast<Android::Internal::AndroidQtVersion *>(
QtSupport::QtKitInformation::qtVersion(target->kit()));
return qt->mininmumNDK();
}
QString AndroidManager::buildTargetSDK(ProjectExplorer::Target *target)
{
auto androidBuildApkStep

View File

@@ -89,6 +89,7 @@ public:
static int minimumSDK(ProjectExplorer::Target *target);
static int minimumSDK(const ProjectExplorer::Kit *kit);
static int minimumNDK(ProjectExplorer::Target *target);
static QString targetArch(ProjectExplorer::Target *target);

View File

@@ -123,9 +123,25 @@ QString AndroidQtVersion::targetArch() const
return m_targetArch;
}
int AndroidQtVersion::mininmumNDK() const
{
ensureMkSpecParsed();
return m_minNdk;
}
void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
{
m_targetArch = evaluator->value(QLatin1String("ANDROID_TARGET_ARCH"));
const QString androidPlatform = evaluator->value(QLatin1String("ANDROID_PLATFORM"));
if (!androidPlatform.isEmpty()) {
const QRegExp regex("android-(\\d+)");
if (regex.exactMatch(androidPlatform)) {
bool ok = false;
int tmp = regex.cap(1).toInt(&ok);
if (ok)
m_minNdk = tmp;
}
}
BaseQtVersion::parseMkSpec(evaluator);
}

View File

@@ -55,10 +55,12 @@ public:
QString description() const override;
QString targetArch() const;
int mininmumNDK() const;
protected:
void parseMkSpec(ProFileEvaluator *) const override;
private:
mutable QString m_targetArch;
mutable int m_minNdk = -1;
};
} // namespace Internal

View File

@@ -107,7 +107,7 @@ static QString testClass(const CppTools::CppModelManager *modelManager,
if (!macro.isFunctionLike())
continue;
const QByteArray name = macro.macro().name();
if (QTestUtils::isQTestMacro(name)) {
if (QTestUtils::isQTestMacro(name) && !macro.arguments().isEmpty()) {
const CPlusPlus::Document::Block arg = macro.arguments().at(0);
return QLatin1String(fileContent.mid(int(arg.bytesBegin()),
int(arg.bytesEnd() - arg.bytesBegin())));

View File

@@ -237,7 +237,7 @@ void TestResultsPane::addTestResult(const TestResultPtr &result)
void TestResultsPane::addOutput(const QByteArray &output)
{
m_textOutput->appendPlainText(QString::fromLatin1(TestOutputReader::chopLineBreak(output)));
m_textOutput->appendPlainText(QString::fromUtf8(TestOutputReader::chopLineBreak(output)));
}
QWidget *TestResultsPane::outputWidget(QWidget *parent)

View File

@@ -63,6 +63,7 @@ CMakeKitConfigWidget::CMakeKitConfigWidget(Kit *kit,
m_comboBox(new QComboBox),
m_manageButton(new QPushButton(KitConfigWidget::msgManage()))
{
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
m_comboBox->setEnabled(false);
m_comboBox->setToolTip(toolTip());

View File

@@ -411,6 +411,8 @@ ExternalToolConfig::ExternalToolConfig(QWidget *parent) :
m_model(new ExternalToolModel(this))
{
ui->setupUi(this);
ui->scrollArea->viewport()->setAutoFillBackground(false);
ui->scrollAreaWidgetContents->setAutoFillBackground(false);
ui->toolTree->setModel(m_model);
ui->toolTree->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);

View File

@@ -28,7 +28,7 @@
<bool>false</bool>
</attribute>
<attribute name="headerDefaultSectionSize">
<number>0</number>
<number>21</number>
</attribute>
</widget>
</item>
@@ -82,222 +82,266 @@
</layout>
</item>
<item>
<widget class="QWidget" name="infoWidget" native="true">
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>396</width>
<height>444</height>
</rect>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="descriptionLabel">
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="description"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="executableLabel">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="executable">
<property name="expectedKind">
<enum>Utils::PathChooser::Command</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="argumentsLabel">
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="arguments"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="workingDirectoryLabel">
<property name="text">
<string>Working directory:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="workingDirectory">
<property name="expectedKind">
<enum>Utils::PathChooser::Directory</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="outputLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="infoWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>10</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="descriptionLabel">
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="description"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="executableLabel">
<property name="text">
<string>Executable:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="executable" native="true"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="argumentsLabel">
<property name="text">
<string>Arguments:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="arguments"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="workingDirectoryLabel">
<property name="text">
<string>Working directory:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="workingDirectory" native="true"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="outputLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;What to do with the executable's standard output.
&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it.&lt;/li&gt;&lt;li&gt;Show in pane: Show it in the general output pane.&lt;/li&gt;&lt;li&gt;Replace selection: Replace the current selection in the current document with it.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
</string>
</property>
<property name="text">
<string>Output:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="outputBehavior">
<item>
<property name="text">
<string>Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace Selection</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="errorOutputLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;body&gt;
</property>
<property name="text">
<string>Output:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="outputBehavior">
<item>
<property name="text">
<string>Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace Selection</string>
</property>
</item>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="errorOutputLabel">
<property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;body&gt;
&lt;p &gt;What to do with the executable's standard error output.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Ignore: Do nothing with it.&lt;/li&gt;
&lt;li&gt;Show in pane: Show it in the general output pane.&lt;/li&gt;
&lt;li&gt;Replace selection: Replace the current selection in the current document with it.&lt;/li&gt;
&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Error output:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="errorOutputBehavior">
<item>
<property name="text">
<string>Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace Selection</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Environment:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="environmentLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>No changes to apply.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="environmentButton">
<property name="text">
<string>Change...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="modifiesDocumentCheckbox">
<property name="toolTip">
<string>If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished.</string>
</property>
<property name="text">
<string>Modifies current document</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="inputLabel">
<property name="toolTip">
<string>Text to pass to the executable via standard input. Leave empty if the executable should not receive any input.</string>
</property>
<property name="text">
<string>Input:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QPlainTextEdit" name="inputText">
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="baseEnvironmentLabel">
<property name="text">
<string>Base environment:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="baseEnvironment">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</property>
<property name="text">
<string>Error output:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="errorOutputBehavior">
<item>
<property name="text">
<string>Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace Selection</string>
</property>
</item>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Environment:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="environmentLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>No changes to apply.</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="environmentButton">
<property name="text">
<string>Change...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="modifiesDocumentCheckbox">
<property name="toolTip">
<string>If the tool modifies the current document, set this flag to ensure that the document is saved before running the tool and is reloaded after the tool finished.</string>
</property>
<property name="text">
<string>Modifies current document</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="inputLabel">
<property name="toolTip">
<string>Text to pass to the executable via standard input. Leave empty if the executable should not receive any input.</string>
</property>
<property name="text">
<string>Input:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QPlainTextEdit" name="inputText">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>10</verstretch>
</sizepolicy>
</property>
<property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="baseEnvironmentLabel">
<property name="text">
<string>Base environment:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="baseEnvironment">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>

View File

@@ -56,6 +56,11 @@
#include <QStyle>
#include <QStyledItemDelegate>
const int kInitialWidth = 750;
const int kInitialHeight = 450;
const int kMaxMinimumWidth = 250;
const int kMaxMinimumHeight = 250;
static const char pageKeyC[] = "General/LastPreferencePage";
const int categoryIconSize = 24;
@@ -362,8 +367,8 @@ private:
QSize minSize = inner->minimumSizeHint();
minSize += QSize(fw, fw);
minSize += QSize(scrollBarWidth(), 0);
minSize.setHeight(qMin(minSize.height(), 450));
minSize.setWidth(qMin(minSize.width(), 810));
minSize.setWidth(qMin(minSize.width(), kMaxMinimumWidth));
minSize.setHeight(qMin(minSize.height(), kMaxMinimumHeight));
return minSize;
}
return QSize(0, 0);
@@ -547,7 +552,6 @@ void SettingsDialog::createGui()
m_stackedLayout->setMargin(0);
QWidget *emptyWidget = new QWidget(this);
emptyWidget->setMinimumSize(QSize(500, 500));
m_stackedLayout->addWidget(emptyWidget); // no category selected, for example when filtering
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok |
@@ -740,6 +744,8 @@ bool SettingsDialog::execDialog()
static const QLatin1String kPreferenceDialogSize("Core/PreferenceDialogSize");
if (ICore::settings()->contains(kPreferenceDialogSize))
resize(ICore::settings()->value(kPreferenceDialogSize).toSize());
else
resize(kInitialWidth, kInitialHeight);
exec();
m_running = false;
m_instance = nullptr;

View File

@@ -54,6 +54,11 @@
\" <!-- Additions to freedesktop: -->\",
\" <glob pattern=\'*.h\' weight=\'70\'/>\",
\" <glob pattern=\'*.H\' weight=\'70\'/>\",
\" <glob pattern=\'*.inl\' weight=\'70\'/>\",
\" <glob pattern=\'*.tcc\' weight=\'70\'/>\",
\" <glob pattern=\'*.tpp\' weight=\'70\'/>\",
\" <glob pattern=\'*.t++\' weight=\'70\'/>\",
\" <glob pattern=\'*.txx\' weight=\'70\'/>\",
\" <!-- Find include guards of header files without extension, for\",
\" example, STL ones like <string>. Those can have a big initial\",
\" comment exceeding 1000 chars, though. -->\",
@@ -74,11 +79,6 @@
\" <glob pattern=\'*.c++\' weight=\'70\'/>\",
\" <!-- Additions to freedesktop: -->\",
\" <glob pattern=\'*.cp\' weight=\'70\'/>\",
\" <glob pattern=\'*.inl\' weight=\'70\'/>\",
\" <glob pattern=\'*.tcc\' weight=\'70\'/>\",
\" <glob pattern=\'*.tpp\' weight=\'70\'/>\",
\" <glob pattern=\'*.t++\' weight=\'70\'/>\",
\" <glob pattern=\'*.txx\' weight=\'70\'/>\",
\" <magic priority=\'30\'>\",
\" <match value=\'-*- C++ -*-\' type=\'string\' offset=\'0:30\'/>\",
\" </magic>\",

View File

@@ -102,6 +102,8 @@ public:
TextMark::updateLineNumber(lineNumber);
QTC_ASSERT(m_bp, return);
m_bp->setLineNumber(lineNumber);
if (GlobalBreakpoint gbp = m_bp->globalBreakpoint())
gbp->m_params.lineNumber = lineNumber;
}
void updateFileName(const FileName &fileName) final
@@ -109,6 +111,8 @@ public:
TextMark::updateFileName(fileName);
QTC_ASSERT(m_bp, return);
m_bp->setFileName(fileName.toString());
if (GlobalBreakpoint gbp = m_bp->globalBreakpoint())
gbp->m_params.fileName = fileName.toString();
}
bool isDraggable() const final { return true; }

View File

@@ -67,6 +67,7 @@ DebuggerKitConfigWidget::DebuggerKitConfigWidget(Kit *workingCopy, const KitInfo
: KitConfigWidget(workingCopy, ki)
{
m_comboBox = new QComboBox;
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
m_comboBox->setEnabled(true);
refresh();

View File

@@ -203,7 +203,7 @@ static QVector<FolderNode *> renamableFolderNodes(const Utils::FileName &before,
ProjectTree::forEachNode([&](Node *node) {
if (node->nodeType() == NodeType::File && node->filePath() == before
&& node->parentFolderNode()
&& node->parentFolderNode()->renameFile(before.toString(), after.toString())) {
&& node->parentFolderNode()->canRenameFile(before.toString(), after.toString())) {
folderNodes.append(node->parentFolderNode());
}
});
@@ -239,7 +239,7 @@ bool FolderNavigationModel::setData(const QModelIndex &index, const QVariant &va
Utils::FileName::fromString(afterFilePath));
QVector<FolderNode *> failedNodes;
for (FolderNode *folder : folderNodes) {
if (!folder->canRenameFile(beforeFilePath, afterFilePath))
if (!folder->renameFile(beforeFilePath, afterFilePath))
failedNodes.append(folder);
}
if (!failedNodes.isEmpty()) {

View File

@@ -150,6 +150,7 @@ ToolChainInformationConfigWidget::ToolChainInformationConfigWidget(Kit *k, const
foreach (Core::Id l, languageList) {
layout->addWidget(new QLabel(ToolChainManager::displayNameOfLanguageId(l) + ':'), row, 0);
auto cb = new QComboBox;
cb->setSizePolicy(QSizePolicy::Ignored, cb->sizePolicy().verticalPolicy());
cb->setToolTip(toolTip());
m_languageComboboxMap.insert(l, cb);
@@ -325,6 +326,7 @@ DeviceInformationConfigWidget::DeviceInformationConfigWidget(Kit *workingCopy, c
m_comboBox(new QComboBox),
m_model(new DeviceManagerModel(DeviceManager::instance()))
{
m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
m_comboBox->setModel(m_model);
m_manageButton = new QPushButton(KitConfigWidget::msgManage());

View File

@@ -47,7 +47,6 @@ ToolChainConfigWidget::ToolChainConfigWidget(ToolChain *tc) :
auto centralWidget = new Utils::DetailsWidget;
centralWidget->setState(Utils::DetailsWidget::NoSummary);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setFrameShape(QFrame::NoFrame);
setWidgetResizable(true);
setFocusPolicy(Qt::NoFocus);

View File

@@ -77,7 +77,8 @@ void AndroidQmakeBuildConfiguration::initialize(const BuildInfo *info)
void AndroidQmakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const
{
QString androidNdkPlatform = AndroidConfigurations::currentConfig().bestNdkPlatformMatch(AndroidManager::minimumSDK(target()));
QString androidNdkPlatform = AndroidConfigurations::currentConfig().bestNdkPlatformMatch(
qMax(AndroidManager::minimumNDK(target()), AndroidManager::minimumSDK(target())));
env.set(QLatin1String("ANDROID_NDK_PLATFORM"), androidNdkPlatform);
}

View File

@@ -99,13 +99,24 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
}
comboBox->setCurrentIndex(m_currentComboBoxIndex);
comboBox->setToolTip(comboBox->currentText());
connect(this, &ZoomAction::reseted, comboBox, [this, comboBox]() {
blockSignals(true);
comboBox->setCurrentIndex(m_currentComboBoxIndex);
blockSignals(false);
});
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &ZoomAction::emitZoomLevelChanged);
[this, comboBox](int index) {
m_currentComboBoxIndex = index;
if (index == -1)
return;
const QModelIndex modelIndex(m_comboBoxModel.data()->index(index, 0));
setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toFloat());
comboBox->setToolTip(modelIndex.data().toString());
});
connect(this, &ZoomAction::indexChanged, comboBox, &QComboBox::setCurrentIndex);
comboBox->setProperty("hideborder", true);
@@ -113,15 +124,4 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
return comboBox;
}
void ZoomAction::emitZoomLevelChanged(int index)
{
m_currentComboBoxIndex = index;
if (index == -1)
return;
const QModelIndex modelIndex(m_comboBoxModel.data()->index(index, 0));
setZoomLevel(m_comboBoxModel.data()->data(modelIndex, Qt::UserRole).toFloat());
}
} // namespace QmlDesigner

View File

@@ -56,9 +56,6 @@ signals:
void indexChanged(int);
void reseted();
private:
void emitZoomLevelChanged(int index);
private:
QPointer<QAbstractItemModel> m_comboBoxModel;
float m_zoomLevel;

View File

@@ -88,7 +88,7 @@ PropertyEditorView::PropertyEditorView(QWidget *parent) :
m_stackedWidget->setStyleSheet(Theme::replaceCssColors(
QString::fromUtf8(Utils::FileReader::fetchQrc(QStringLiteral(":/qmldesigner/stylesheet.css")))));
m_stackedWidget->setMinimumWidth(320);
m_stackedWidget->setMinimumWidth(340);
m_stackedWidget->move(0, 0);
connect(m_stackedWidget, &PropertyEditorWidget::resized, this, &PropertyEditorView::updateSize);

View File

@@ -109,6 +109,8 @@ public:
void reactivateTextMofifierChangeSignals();
void deactivateTextMofifierChangeSignals();
void auxiliaryDataChanged(const ModelNode &node, const PropertyName &name, const QVariant &data) override;
Internal::ModelNodePositionStorage *positionStorage() const;
QList<DocumentMessage> warnings() const;

View File

@@ -26,8 +26,6 @@
#include "nodeinstanceview.h"
#include <QUrl>
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QMultiHash>
#include <QTimerEvent>

View File

@@ -387,6 +387,17 @@ void RewriterView::deactivateTextMofifierChangeSignals()
textModifier()->deactivateChangeSignals();
}
void RewriterView::auxiliaryDataChanged(const ModelNode &, const PropertyName &name, const QVariant &)
{
if (name.endsWith("@NodeInstance"))
return;
if (name.endsWith("@Internal"))
return;
m_textModifier->textDocument()->setModified(true);
}
void RewriterView::applyModificationGroupChanges()
{
Q_ASSERT(transactionLevel == 0);
@@ -498,8 +509,13 @@ QString RewriterView::auxiliaryDataAsQML() const
const QVariant value = data.value(key.toUtf8());
QString strValue = value.toString();
if (static_cast<QMetaType::Type>(value.type()) == QMetaType::QString)
auto metaType = static_cast<QMetaType::Type>(value.type());
if (metaType == QMetaType::QString
|| metaType == QMetaType::QColor) {
strValue = "\"" + strValue + "\"";
}
if (!strValue.isEmpty()) {
str += replaceIllegalPropertyNameChars(key) + ":";

View File

@@ -44,6 +44,7 @@ QtKitConfigWidget::QtKitConfigWidget(ProjectExplorer::Kit *k, const ProjectExplo
KitConfigWidget(k, ki)
{
m_combo = new QComboBox;
m_combo->setSizePolicy(QSizePolicy::Ignored, m_combo->sizePolicy().verticalPolicy());
m_combo->addItem(tr("None"), -1);
QList<int> versionIds = Utils::transform(QtVersionManager::versions(), &BaseQtVersion::uniqueId);

View File

@@ -152,6 +152,8 @@ ColorSchemeEdit::ColorSchemeEdit(QWidget *parent) :
{
setContentsMargins(0, layoutSpacing, 0, 0);
m_ui->setupUi(this);
m_ui->detailsScrollArea->viewport()->setAutoFillBackground(false);
m_ui->scrollAreaWidgetContents->setAutoFillBackground(false);
m_ui->itemList->setModel(m_formatsModel);
populateUnderlineStyleComboBox();

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>614</width>
<width>639</width>
<height>306</height>
</rect>
</property>
@@ -173,7 +173,7 @@
<item row="1" column="0" colspan="3">
<widget class="TextEditor::Internal::ColorSchemeEdit" name="schemeEdit" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>

View File

@@ -135,12 +135,6 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>233</height>
</size>
</property>
</spacer>
</item>
</layout>

View File

@@ -372,7 +372,8 @@ void TokenInfo::identifierKind(const Cursor &cursor, Recursion recursion)
break;
case CXCursor_ParmDecl:
case CXCursor_VarDecl:
variableKind(cursor);
case CXCursor_VariableRef:
variableKind(cursor.referenced());
break;
case CXCursor_DeclRefExpr:
identifierKind(cursor.referenced(), Recursion::RecursivePass);

View File

@@ -5383,6 +5383,23 @@ void tst_Dumpers::dumper_data()
+ Check("s32s", "-2147483648", TypeDef("int", "@qint32"));
QTest::newRow("Int128")
<< Data("#include <limits.h>\n",
"using typedef_s128 = __int128_t;\n"
"using typedef_u128 = __uint128_t;\n"
"__int128_t s128 = 12;\n"
"__uint128_t u128 = 12;\n"
"typedef_s128 ts128 = 12;\n"
"typedef_u128 tu128 = 12;\n"
"unused(&u128, &s128, &tu128, &ts128);\n")
// Sic! The expected type is what gcc 8.2.0 records.
+ GdbEngine
+ Check("s128", "12", "__int128")
+ Check("u128", "12", "__int128 unsigned")
+ Check("ts128", "12", "typedef_s128")
+ Check("tu128", "12", "typedef_u128") ;
QTest::newRow("Float")
<< Data("#include <QFloat16>\n",
"qfloat16 f1 = 45.3f; unused(&f1);\n"
@@ -5441,10 +5458,10 @@ void tst_Dumpers::dumper_data()
QTest::newRow("Array")
<< Data("",
"double a1[3][3];\n"
"double a1[3][4];\n"
"for (int i = 0; i != 3; ++i)\n"
" for (int j = 0; j != 3; ++j)\n"
" a1[i][j] = i + j;\n"
" a1[i][j] = i + 10 * j;\n"
"unused(&a1);\n\n"
"char a2[20] = { 0 };\n"
@@ -5455,11 +5472,11 @@ void tst_Dumpers::dumper_data()
"a2[4] = 0;\n"
"unused(&a2);\n")
+ Check("a1", Pointer(), "double [3][3]")
+ Check("a1.0", "[0]", Pointer(), "double [3]")
+ Check("a1", Pointer(), "double[3][4]")
+ Check("a1.0", "[0]", Pointer(), "double[4]")
+ Check("a1.0.0", "[0]", FloatValue("0"), "double")
+ Check("a1.0.2", "[2]", FloatValue("2"), "double")
+ Check("a1.2", "[2]", Pointer(), "double [3]")
+ Check("a1.0.2", "[2]", FloatValue("20"), "double")
+ Check("a1.2", "[2]", Pointer(), "double[4]")
+ Check("a2", Value("\"abcd" + QString(16, 0) + '"'), "char [20]")
+ Check("a2.0", "[0]", "97", "char")

View File

@@ -1697,6 +1697,13 @@ TEST_F(TokenProcessor, DISABLED_NonConstArgumentConstructor)
ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument));
}
TEST_F(TokenProcessor, LambdaLocalVariableCapture)
{
const auto infos = translationUnit.tokenInfosInRange(sourceRange(442, 47));
ASSERT_THAT(infos[4], HasOnlyType(HighlightingType::LocalVariable));
}
Data *TokenProcessor::d;
void TokenProcessor::SetUpTestCase()