Merge remote-tracking branch 'origin/4.8'

Conflicts:
	src/plugins/coreplugin/dialogs/externaltoolconfig.ui

Change-Id: Ie38e9028cee599578c59b22325d85c097335243e
This commit is contained in:
Eike Ziller
2019-01-07 13:24:12 +01:00
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 Double-click on entries in the \uicontrol {Debugger Perspectives} view to
switch between snapshots. The debugger views are updated to reflect the state switch between snapshots. The debugger views are updated to reflect the state
of the program at time of taking the snapshot. 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 \endomit
*/ */

View File

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

View File

@@ -3379,6 +3379,19 @@ class DumperBase:
def type(self, typeId): def type(self, typeId):
return self.typeData.get(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): def registerType(self, typeId, tdata):
#warn('REGISTER TYPE: %s' % typeId) #warn('REGISTER TYPE: %s' % typeId)
self.typeData[typeId] = tdata self.typeData[typeId] = tdata
@@ -3585,16 +3598,6 @@ class DumperBase:
def pointer(self): def pointer(self):
return self.dumper.createPointerType(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): def target(self):
return self.typeData().ltarget return self.typeData().ltarget
@@ -3613,9 +3616,6 @@ class DumperBase:
def bitsize(self): def bitsize(self):
if self.lbitsize is not None: if self.lbitsize is not None:
return self.lbitsize return self.lbitsize
if self.code == TypeCodeArray:
(innerType, itemCount) = self.splitArrayType()
return itemCount * innerType.bitsize()
error('DONT KNOW SIZE: %s' % self) error('DONT KNOW SIZE: %s' % self)
def isMovableType(self): def isMovableType(self):
@@ -3748,14 +3748,23 @@ class DumperBase:
error('Expected type in createArrayType(), got %s' error('Expected type in createArrayType(), got %s'
% type(targetType)) % type(targetType))
targetTypeId = targetType.typeId 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 = self.TypeData(self)
tdata.name = '%s[%d]' % (targetType.name, count) tdata.name = type_name
tdata.typeId = typeId tdata.typeId = type_id
tdata.code = TypeCodeArray tdata.code = TypeCodeArray
tdata.ltarget = targetType tdata.ltarget = targetType
self.registerType(typeId, tdata) tdata.lbitsize = targetType.lbitsize * count
return self.Type(self, typeId) self.registerType(type_id, tdata)
return self.Type(self, type_id)
def createBitfieldType(self, targetType, bitsize): def createBitfieldType(self, targetType, bitsize):
if not isinstance(targetType, self.Type): if not isinstance(targetType, self.Type):
@@ -3796,13 +3805,6 @@ class DumperBase:
#typish.check() #typish.check()
return typish return typish
if isinstance(typish, str): 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): def knownSize(tn):
if tn[0] == 'Q': if tn[0] == 'Q':
if tn in ('QByteArray', 'QString', 'QList', 'QStringList', if tn in ('QByteArray', 'QString', 'QList', 'QStringList',

View File

@@ -247,8 +247,14 @@ class Dumper(DumperBase):
if targetType.code == gdb.TYPE_CODE_ARRAY: if targetType.code == gdb.TYPE_CODE_ARRAY:
val = self.Value(self) val = self.Value(self)
else: else:
# Cast may fail (e.g for arrays, see test for Bug5799) try:
val = self.fromNativeValue(nativeValue.cast(targetType)) # 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) #warn('CREATED TYPEDEF: %s' % val)
else: else:
val = self.Value(self) 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) static ULONG extractArraySize(const std::string &typeName, size_t openArrayPos = 0)
{ {
if (openArrayPos == 0) if (openArrayPos == 0)
openArrayPos = typeName.find_last_of('['); openArrayPos = typeName.find_first_of('[');
const auto closeArrayPos = typeName.find_last_of(']'); if (openArrayPos == std::string::npos)
if (openArrayPos == std::string::npos || closeArrayPos == std::string::npos) return 0;
const auto closeArrayPos = typeName.find_first_of(']', openArrayPos);
if (closeArrayPos == std::string::npos)
return 0; return 0;
const std::string arraySizeString = typeName.substr(openArrayPos + 1, const std::string arraySizeString = typeName.substr(openArrayPos + 1,
closeArrayPos - openArrayPos - 1); closeArrayPos - openArrayPos - 1);
@@ -327,8 +329,15 @@ std::string PyType::targetName() const
const std::string &typeName = name(); const std::string &typeName = name();
if (isPointerType(typeName)) if (isPointerType(typeName))
return stripPointerType(typeName); return stripPointerType(typeName);
if (isArrayType(typeName)) if (isArrayType(typeName)) {
return typeName.substr(0, typeName.find_last_of('[')); 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; return typeName;
} }

View File

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

View File

@@ -186,7 +186,8 @@ bool SaveFile::commit()
const QString &renameError = m_tempFile->errorString(); const QString &renameError = m_tempFile->errorString();
m_tempFile->remove(); m_tempFile->remove();
setErrorString(renameError); 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); QFile::remove(backupName);

View File

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

View File

@@ -247,6 +247,13 @@ int AndroidManager::minimumSDK(const ProjectExplorer::Kit *kit)
return minSDKVersion; 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) QString AndroidManager::buildTargetSDK(ProjectExplorer::Target *target)
{ {
auto androidBuildApkStep auto androidBuildApkStep

View File

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

View File

@@ -123,9 +123,25 @@ QString AndroidQtVersion::targetArch() const
return m_targetArch; return m_targetArch;
} }
int AndroidQtVersion::mininmumNDK() const
{
ensureMkSpecParsed();
return m_minNdk;
}
void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const void AndroidQtVersion::parseMkSpec(ProFileEvaluator *evaluator) const
{ {
m_targetArch = evaluator->value(QLatin1String("ANDROID_TARGET_ARCH")); 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); BaseQtVersion::parseMkSpec(evaluator);
} }

View File

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

View File

@@ -107,7 +107,7 @@ static QString testClass(const CppTools::CppModelManager *modelManager,
if (!macro.isFunctionLike()) if (!macro.isFunctionLike())
continue; continue;
const QByteArray name = macro.macro().name(); 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); const CPlusPlus::Document::Block arg = macro.arguments().at(0);
return QLatin1String(fileContent.mid(int(arg.bytesBegin()), return QLatin1String(fileContent.mid(int(arg.bytesBegin()),
int(arg.bytesEnd() - 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) 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) QWidget *TestResultsPane::outputWidget(QWidget *parent)

View File

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

View File

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

View File

@@ -28,7 +28,7 @@
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="headerDefaultSectionSize"> <attribute name="headerDefaultSectionSize">
<number>0</number> <number>21</number>
</attribute> </attribute>
</widget> </widget>
</item> </item>
@@ -82,222 +82,266 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QWidget" name="infoWidget" native="true"> <widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>10</horstretch> <horstretch>10</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <property name="frameShape">
<property name="fieldGrowthPolicy"> <enum>QFrame::NoFrame</enum>
<enum>QFormLayout::ExpandingFieldsGrow</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>
<property name="leftMargin"> <layout class="QVBoxLayout" name="verticalLayout_2">
<number>0</number> <property name="leftMargin">
</property> <number>0</number>
<property name="topMargin"> </property>
<number>0</number> <property name="topMargin">
</property> <number>0</number>
<property name="rightMargin"> </property>
<number>0</number> <property name="rightMargin">
</property> <number>0</number>
<property name="bottomMargin"> </property>
<number>0</number> <property name="bottomMargin">
</property> <number>0</number>
<item row="0" column="0"> </property>
<widget class="QLabel" name="descriptionLabel"> <item>
<property name="text"> <widget class="QWidget" name="infoWidget" native="true">
<string>Description:</string> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
</widget> <horstretch>10</horstretch>
</item> <verstretch>0</verstretch>
<item row="0" column="1"> </sizepolicy>
<widget class="QLineEdit" name="description"/> </property>
</item> <layout class="QFormLayout" name="formLayout">
<item row="1" column="0"> <property name="fieldGrowthPolicy">
<widget class="QLabel" name="executableLabel"> <enum>QFormLayout::ExpandingFieldsGrow</enum>
<property name="text"> </property>
<string>Executable:</string> <property name="leftMargin">
</property> <number>0</number>
</widget> </property>
</item> <property name="topMargin">
<item row="1" column="1"> <number>0</number>
<widget class="Utils::PathChooser" name="executable"> </property>
<property name="expectedKind"> <property name="rightMargin">
<enum>Utils::PathChooser::Command</enum> <number>0</number>
</property> </property>
</widget> <property name="bottomMargin">
</item> <number>0</number>
<item row="2" column="0"> </property>
<widget class="QLabel" name="argumentsLabel"> <item row="0" column="0">
<property name="text"> <widget class="QLabel" name="descriptionLabel">
<string>Arguments:</string> <property name="text">
</property> <string>Description:</string>
</widget> </property>
</item> </widget>
<item row="2" column="1"> </item>
<widget class="QLineEdit" name="arguments"/> <item row="0" column="1">
</item> <widget class="QLineEdit" name="description"/>
<item row="3" column="0"> </item>
<widget class="QLabel" name="workingDirectoryLabel"> <item row="1" column="0">
<property name="text"> <widget class="QLabel" name="executableLabel">
<string>Working directory:</string> <property name="text">
</property> <string>Executable:</string>
</widget> </property>
</item> </widget>
<item row="3" column="1"> </item>
<widget class="Utils::PathChooser" name="workingDirectory"> <item row="1" column="1">
<property name="expectedKind"> <widget class="Utils::PathChooser" name="executable" native="true"/>
<enum>Utils::PathChooser::Directory</enum> </item>
</property> <item row="2" column="0">
</widget> <widget class="QLabel" name="argumentsLabel">
</item> <property name="text">
<item row="4" column="0"> <string>Arguments:</string>
<widget class="QLabel" name="outputLabel"> </property>
<property name="toolTip"> </widget>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt; </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;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; &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> </string>
</property> </property>
<property name="text"> <property name="text">
<string>Output:</string> <string>Output:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QComboBox" name="outputBehavior"> <widget class="QComboBox" name="outputBehavior">
<item> <item>
<property name="text"> <property name="text">
<string>Ignore</string> <string>Ignore</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Show in Pane</string> <string>Show in Pane</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Replace Selection</string> <string>Replace Selection</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="errorOutputLabel"> <widget class="QLabel" name="errorOutputLabel">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head&gt;&lt;body&gt; <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;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;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;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;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> &lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Error output:</string> <string>Error output:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QComboBox" name="errorOutputBehavior"> <widget class="QComboBox" name="errorOutputBehavior">
<item> <item>
<property name="text"> <property name="text">
<string>Ignore</string> <string>Ignore</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Show in Pane</string> <string>Show in Pane</string>
</property> </property>
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Replace Selection</string> <string>Replace Selection</string>
</property> </property>
</item> </item>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
<property name="text"> <property name="text">
<string>Environment:</string> <string>Environment:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="environmentLabel"> <widget class="QLabel" name="environmentLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>No changes to apply.</string> <string>No changes to apply.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="environmentButton"> <widget class="QPushButton" name="environmentButton">
<property name="text"> <property name="text">
<string>Change...</string> <string>Change...</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="8" column="1"> <item row="8" column="1">
<widget class="QCheckBox" name="modifiesDocumentCheckbox"> <widget class="QCheckBox" name="modifiesDocumentCheckbox">
<property name="toolTip"> <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> <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>
<property name="text"> <property name="text">
<string>Modifies current document</string> <string>Modifies current document</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0"> <item row="9" column="0">
<widget class="QLabel" name="inputLabel"> <widget class="QLabel" name="inputLabel">
<property name="toolTip"> <property name="toolTip">
<string>Text to pass to the executable via standard input. Leave empty if the executable should not receive any input.</string> <string>Text to pass to the executable via standard input. Leave empty if the executable should not receive any input.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Input:</string> <string>Input:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1"> <item row="9" column="1">
<widget class="QPlainTextEdit" name="inputText"> <widget class="QPlainTextEdit" name="inputText">
<property name="lineWrapMode"> <property name="sizePolicy">
<enum>QPlainTextEdit::NoWrap</enum> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
</property> <horstretch>0</horstretch>
</widget> <verstretch>10</verstretch>
</item> </sizepolicy>
<item row="6" column="0"> </property>
<widget class="QLabel" name="baseEnvironmentLabel"> <property name="lineWrapMode">
<property name="text"> <enum>QPlainTextEdit::NoWrap</enum>
<string>Base environment:</string> </property>
</property> </widget>
</widget> </item>
</item> <item row="6" column="0">
<item row="6" column="1"> <widget class="QLabel" name="baseEnvironmentLabel">
<widget class="QComboBox" name="baseEnvironment"> <property name="text">
<property name="sizePolicy"> <string>Base environment:</string>
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> </property>
<horstretch>0</horstretch> </widget>
<verstretch>0</verstretch> </item>
</sizepolicy> <item row="6" column="1">
</property> <widget class="QComboBox" name="baseEnvironment">
</widget> <property name="sizePolicy">
</item> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</layout> <horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
</layout> </layout>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -77,7 +77,8 @@ void AndroidQmakeBuildConfiguration::initialize(const BuildInfo *info)
void AndroidQmakeBuildConfiguration::addToEnvironment(Utils::Environment &env) const 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); env.set(QLatin1String("ANDROID_NDK_PLATFORM"), androidNdkPlatform);
} }

View File

@@ -99,13 +99,24 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
} }
comboBox->setCurrentIndex(m_currentComboBoxIndex); comboBox->setCurrentIndex(m_currentComboBoxIndex);
comboBox->setToolTip(comboBox->currentText());
connect(this, &ZoomAction::reseted, comboBox, [this, comboBox]() { connect(this, &ZoomAction::reseted, comboBox, [this, comboBox]() {
blockSignals(true); blockSignals(true);
comboBox->setCurrentIndex(m_currentComboBoxIndex); comboBox->setCurrentIndex(m_currentComboBoxIndex);
blockSignals(false); blockSignals(false);
}); });
connect(comboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 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); connect(this, &ZoomAction::indexChanged, comboBox, &QComboBox::setCurrentIndex);
comboBox->setProperty("hideborder", true); comboBox->setProperty("hideborder", true);
@@ -113,15 +124,4 @@ QWidget *ZoomAction::createWidget(QWidget *parent)
return comboBox; 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 } // namespace QmlDesigner

View File

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

View File

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

View File

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

View File

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

View File

@@ -387,6 +387,17 @@ void RewriterView::deactivateTextMofifierChangeSignals()
textModifier()->deactivateChangeSignals(); 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() void RewriterView::applyModificationGroupChanges()
{ {
Q_ASSERT(transactionLevel == 0); Q_ASSERT(transactionLevel == 0);
@@ -498,8 +509,13 @@ QString RewriterView::auxiliaryDataAsQML() const
const QVariant value = data.value(key.toUtf8()); const QVariant value = data.value(key.toUtf8());
QString strValue = value.toString(); 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 + "\""; strValue = "\"" + strValue + "\"";
}
if (!strValue.isEmpty()) { if (!strValue.isEmpty()) {
str += replaceIllegalPropertyNameChars(key) + ":"; str += replaceIllegalPropertyNameChars(key) + ":";

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@@ -5383,6 +5383,23 @@ void tst_Dumpers::dumper_data()
+ Check("s32s", "-2147483648", TypeDef("int", "@qint32")); + 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") QTest::newRow("Float")
<< Data("#include <QFloat16>\n", << Data("#include <QFloat16>\n",
"qfloat16 f1 = 45.3f; unused(&f1);\n" "qfloat16 f1 = 45.3f; unused(&f1);\n"
@@ -5441,10 +5458,10 @@ void tst_Dumpers::dumper_data()
QTest::newRow("Array") QTest::newRow("Array")
<< Data("", << Data("",
"double a1[3][3];\n" "double a1[3][4];\n"
"for (int i = 0; i != 3; ++i)\n" "for (int i = 0; i != 3; ++i)\n"
" for (int j = 0; j != 3; ++j)\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" "unused(&a1);\n\n"
"char a2[20] = { 0 };\n" "char a2[20] = { 0 };\n"
@@ -5455,11 +5472,11 @@ void tst_Dumpers::dumper_data()
"a2[4] = 0;\n" "a2[4] = 0;\n"
"unused(&a2);\n") "unused(&a2);\n")
+ Check("a1", Pointer(), "double [3][3]") + Check("a1", Pointer(), "double[3][4]")
+ Check("a1.0", "[0]", Pointer(), "double [3]") + Check("a1.0", "[0]", Pointer(), "double[4]")
+ Check("a1.0.0", "[0]", FloatValue("0"), "double") + Check("a1.0.0", "[0]", FloatValue("0"), "double")
+ Check("a1.0.2", "[2]", FloatValue("2"), "double") + Check("a1.0.2", "[2]", FloatValue("20"), "double")
+ Check("a1.2", "[2]", Pointer(), "double [3]") + Check("a1.2", "[2]", Pointer(), "double[4]")
+ Check("a2", Value("\"abcd" + QString(16, 0) + '"'), "char [20]") + Check("a2", Value("\"abcd" + QString(16, 0) + '"'), "char [20]")
+ Check("a2.0", "[0]", "97", "char") + Check("a2.0", "[0]", "97", "char")

View File

@@ -1697,6 +1697,13 @@ TEST_F(TokenProcessor, DISABLED_NonConstArgumentConstructor)
ASSERT_THAT(infos[3], HasMixin(HighlightingType::OutputArgument)); 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; Data *TokenProcessor::d;
void TokenProcessor::SetUpTestCase() void TokenProcessor::SetUpTestCase()