Merge remote-tracking branch 'origin/4.2'

Conflicts:
	src/plugins/clangrefactoring/refactoringengine.cpp
	src/tools/clangrefactoringbackend/source/symbolfinder.cpp

Change-Id: I7c1c87f3b8ade43a07f6668565501042e967fa8b
This commit is contained in:
Eike Ziller
2016-11-16 16:04:59 +01:00
72 changed files with 693 additions and 544 deletions

View File

@@ -25,7 +25,8 @@ Prerequisites:
* cmake
* On Mac OS X: latest Xcode
* On Linux: g++ 4.8 or later
* LLVM 3.8.0 or later (optional, needed for the Clang Code Model)
* LLVM 3.9.0 or later (optional, needed for the Clang Code Model)
* Qbs 1.7.x (optional, sources also contain Qbs itself)
The installed toolchains have to match the one Qt was compiled with.
@@ -33,6 +34,8 @@ You can build Qt Creator with
# Optional, needed for the Clang Code Model:
export LLVM_INSTALL_DIR=/path/to/llvm (or "set" on Windows)
# Optional, needed to let the QbsProjectManager plugin use system Qbs:
export QBS_INSTALL_DIR=/path/to/qbs
cd $SOURCE_DIRECTORY
qmake -r

View File

@@ -132,7 +132,7 @@
\list 1
\li Acquire Clang 3.8.0 or higher in one of the following ways:
\li Acquire Clang 3.9.0 or higher in one of the following ways:
\list

View File

@@ -1,7 +1,7 @@
var Environment = loadExtension("qbs.Environment")
var File = loadExtension("qbs.File")
var FileInfo = loadExtension("qbs.FileInfo")
var MinimumLLVMVersion = "3.8.0"
var MinimumLLVMVersion = "3.9.0"
var Process = loadExtension("qbs.Process")
function readOutput(executable, args)
@@ -28,7 +28,7 @@ function llvmConfig(qbs, qtcFunctions)
{
var llvmInstallDirFromEnv = Environment.getEnv("LLVM_INSTALL_DIR")
var llvmConfigVariants = [
"llvm-config", "llvm-config-3.8", "llvm-config-3.9", "llvm-config-4.0", "llvm-config-4.1"
"llvm-config", "llvm-config-3.9", "llvm-config-4.0", "llvm-config-4.1"
];
// Prefer llvm-config* from LLVM_INSTALL_DIR

View File

@@ -574,7 +574,7 @@ class DumperBase:
res = []
for item in targs[::-1]:
c = ord(item[0])
if c == '-' or (c >= 48 and c < 58):
if c in (45, 46) or (c >= 48 and c < 58): # '-', '.' or digit.
if item.find('.') > -1:
res.append(float(item))
else:
@@ -2759,6 +2759,20 @@ class DumperBase:
self.targetValue = None # For references.
self.isBaseClass = None
def copy(self):
val = self.dumper.Value(self.dumper)
val.dumper = self.dumper
val.name = self.name
val.type = self.type
val.ldata = self.ldata
val.laddress = self.laddress
val.lIsInScope = self.lIsInScope
val.ldisplay = self.ldisplay
val.lbitpos = self.lbitpos
val.lbitsize = self.lbitsize
val.targetValue = self.targetValue
return val
def check(self):
if self.laddress is not None and not self.dumper.isInt(self.laddress):
error('INCONSISTENT ADDRESS: %s' % type(self.laddress))
@@ -2848,12 +2862,18 @@ class DumperBase:
members = self.members(True)
for member in members:
#warn('CHECKING FIELD %s' % member.name)
if member.type.code == TypeCodeTypedef:
member = member.detypedef()
if member.name == name:
return member
for member in members:
#warn('CHECKING BASE %s' % member.name)
#if member.name == name:
# return member
if member.type.code == TypeCodeTypedef:
member = member.detypedef()
if member.name == name:
return member
if member.type.code == TypeCodeStruct:
res = member.findMemberByName(name)
if res is not None:
@@ -2979,6 +2999,9 @@ class DumperBase:
res = []
anonNumber = 0
for field in fields:
if isinstance(field, self.dumper.Value):
res.append(field)
continue
if field.isBaseClass and not includeBases:
continue
if field.name is None or len(field.name) == 0:
@@ -3029,10 +3052,8 @@ class DumperBase:
self.check()
if self.type.code != TypeCodeTypedef:
error("WRONG")
val = self.dumper.Value(self.dumper)
val = self.copy()
val.type = self.type.ltarget
val.ldata = self.ldata
val.laddress = self.laddress
#warn("DETYPEDEF FROM: %s" % self)
#warn("DETYPEDEF TO: %s" % val)
return val

View File

@@ -1014,30 +1014,34 @@ class Dumper(DumperBase):
if not self.currentQtNamespaceGuess is None:
return self.currentQtNamespaceGuess
# This only works when called from a valid frame.
try:
cand = 'QArrayData::shared_null'
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
return ns
except:
pass
for objfile in gdb.objfiles():
name = objfile.filename
if name.find('/libQt5Core') >= 0:
ns = ''
try:
# This is Qt, but not 5.x.
cand = 'QByteArray::shared_null'
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
# This only works when called from a valid frame.
try:
cand = 'QArrayData::shared_null'
symbol = gdb.lookup_symbol(cand)[0]
if symbol:
ns = symbol.name[:-len(cand)]
except:
try:
# Some GDB 7.11.1 on Arch Linux.
cand = 'QArrayData::shared_null[0]'
val = gdb.parse_and_eval(cand)
if val.type is not None:
typeobj = val.type.unqualified()
ns = typeobj.name[:-len('QArrayData')]
except:
pass
# This might be wrong, but we can't do better: We found
# a libQt5Core and could not extract a namespace.
# The best guess is that there isn't any.
self.qtNamespaceToReport = ns
self.qtNamespace = lambda: ns
self.fallbackQtVersion = 0x40800
return ns
except:
pass
self.currentQtNamespaceGuess = ''
return ''

View File

@@ -247,7 +247,7 @@ class Dumper(DumperBase):
if bitsize > 0:
#bitpos = bitpos % bitsize
bitpos = bitpos % 8 # Reported type is always wrapping type!
fieldBits[f.name] = (bitsize, bitpos)
fieldBits[f.name] = (bitsize, bitpos, f.IsBitfield())
# Normal members and non-empty base classes.
for i in range(fakeValue.GetNumChildren()):
@@ -259,11 +259,12 @@ class Dumper(DumperBase):
nativeFieldType = nativeField.GetType()
if field.name in fieldBits:
(field.lbitsize, field.lbitpos) = fieldBits[field.name]
(field.lbitsize, field.lbitpos, isBitfield) = fieldBits[field.name]
else:
field.lbitsize = nativeFieldType.GetByteSize() * 8
isBitfield = False
if field.lbitsize != nativeFieldType.GetByteSize() * 8:
if isBitfield:
field.ltype = self.createBitfieldType(self.typeName(nativeFieldType), field.lbitsize)
else:
fakeMember = fakeValue.GetChildAtIndex(i)

View File

@@ -62,7 +62,7 @@ def qdump____m512d(d, value):
d.putArrayData(value.address(), 8, d.lookupType('double'))
def qdump____m128i(d, value):
data = d.hexencode(value.data())
data = d.hexencode(value.data(16))
d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 32, 4)))
if d.isExpanded():
with Children(d):
@@ -73,7 +73,7 @@ def qdump____m128i(d, value):
d.putArrayItem('uint64x2', addr, 2, 'unsigned long long')
def qdump____m256i(d, value):
data = d.hexencode(value.data())
data = d.hexencode(value.data(32))
d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 64, 4)))
if d.isExpanded():
with Children(d):
@@ -84,7 +84,7 @@ def qdump____m256i(d, value):
d.putArrayItem('uint64x4', addr, 4, 'unsigned long long')
def qdump____m512i(d, value):
data = d.hexencode(value.data())
data = d.hexencode(value.data(64))
d.putValue(':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(0, 64, 4))
+ ', ' + ':'.join('%04x' % int(data[i:i+4], 16) for i in xrange(64, 128, 4)))
if d.isExpanded():

View File

@@ -38,13 +38,9 @@ def qdump__QBasicAtomicInt(d, value):
def qdump__QAtomicPointer(d, value):
d.putType(value.type)
p = value.extractPointer()
d.putValue('@0x%x' % p)
d.putNumChild(1 if p else 0)
if d.isExpanded():
with Children(d):
d.putSubItem('[pointee]', value.dereference())
d.putItem(value.cast(value.type[0].pointer()))
d.putBetterType(value.type)
def qform__QByteArray():
return [Latin1StringFormat, SeparateLatin1StringFormat,
@@ -1064,6 +1060,7 @@ def qdump__QRegExp(d, value):
privAddress = d.extractPointer(value)
(eng, pattern) = d.split('p{QString}', privAddress)
d.putStringValue(pattern)
d.putNumChild(1)
if d.isExpanded():
with Children(d):
d.call('void', value, 'capturedTexts') # Warm up internal cache.

View File

@@ -511,10 +511,17 @@ def qdump__std____1__map__const_iterator(d, value):
def qdump__std____1__set__iterator(d, value):
d.putEmptyValue()
d.putNumChild(1)
if value.type.name.endswith("::iterator"):
treeTypeName = value.type.name[:-len("::iterator")]
elif value.type.name.endswith("::const_iterator"):
treeTypeName = value.type.name[:-len("::const_iterator")]
treeType = d.lookupType(treeTypeName)
keyType = treeType[0]
if d.isExpanded():
with Children(d):
node = value['__ptr_'].dereference()['__value_']
node = node.cast(value.type[0])
node = node.cast(keyType)
d.putSubItem('value', node)
def qdump__std____1__set_const_iterator(d, value):

View File

@@ -124,7 +124,7 @@ TextColorHighlight=ffff0000
TextColorLink=textColorLink
TextColorLinkVisited=textColorLinkVisited
TextColorNormal=text
TodoItemTextColor=text
TodoItemTextColor=ff000000
ToggleButtonBackgroundColor=shadowBackground
ToolBarBackgroundColor=shadowBackground
TreeViewArrowColorNormal=hoverBackground

View File

@@ -122,7 +122,7 @@ TextColorHighlight=ffff0000
TextColorLink=ff007af4
TextColorLinkVisited=ffa57aff
TextColorNormal=text
TodoItemTextColor=text
TodoItemTextColor=ff000000
ToggleButtonBackgroundColor=shadowBackground
ToolBarBackgroundColor=shadowBackground
TreeViewArrowColorNormal=hoverBackground

View File

@@ -120,7 +120,7 @@ TextColorHighlight=ffff0000
TextColorLink=ff007af4
TextColorLinkVisited=ffa57aff
TextColorNormal=text
TodoItemTextColor=text
TodoItemTextColor=ff000000
ToggleButtonBackgroundColor=shadowBackground
ToolBarBackgroundColor=shadowBackground
TreeViewArrowColorNormal=hoverBackground

View File

@@ -1,177 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru">
<context>
<name></name>
<message>
<source>Zoom In</source>
<translation>Увеличить</translation>
</message>
<message>
<source>Zoom In (Ctrl + + / Ctrl + Wheel)</source>
<translation>Увеличить (Ctrl++ / Ctrl+Колёсико)</translation>
</message>
<message>
<source>Zoom Out</source>
<translation>Уменьшить</translation>
</message>
<message>
<source>Zoom Out (Ctrl + - / Ctrl + Wheel)</source>
<translation>Уменьшить (Ctrl+- / Ctrl+Колёсико)</translation>
</message>
<message>
<source>Fit to View</source>
<translation>Растянуть на окно</translation>
</message>
<message>
<source>Fit to View (F11)</source>
<translation>Растянуть на окно (F11)</translation>
</message>
<message>
<source>Panning</source>
<translation>Панорамирование</translation>
</message>
<message>
<source>Panning (Shift)</source>
<translation>Панорамирование (Shift)</translation>
</message>
<message>
<source>Magnifier</source>
<translation>Лупа</translation>
</message>
<message>
<source>Magnifier Tool (Alt)</source>
<translation>Лупа (Alt)</translation>
</message>
<message>
<source>Navigator</source>
<translation>Навигатор</translation>
</message>
<message>
<source>Navigator (Ctrl+E)</source>
<translation>Навигатор (Ctrl+E)</translation>
</message>
<message>
<source>Copy</source>
<translation>Копировать</translation>
</message>
<message>
<source>Copy (Ctrl + C)</source>
<translation>Копировать (Ctrl+C)</translation>
</message>
<message>
<source>Cut</source>
<translation>Вырезать</translation>
</message>
<message>
<source>Cut (Ctrl + X)</source>
<translation>Вырезать (Ctrl+X)</translation>
</message>
<message>
<source>Paste</source>
<translation>Вставить</translation>
</message>
<message>
<source>Paste (Ctrl + V)</source>
<translation>Вставить (Ctrl+V)</translation>
</message>
<message>
<source>Screenshot</source>
<translation>Снимок экрана</translation>
</message>
<message>
<source>Screenshot (Ctrl + Shift + C)</source>
<translation>Снимок экрана (Ctrl+Shift+C)</translation>
</message>
<message>
<source>Export to Image</source>
<translation>В изображение</translation>
</message>
<message>
<source>Toggle Full Namespace</source>
<translation>Переключить пространство имён</translation>
</message>
<message>
<source>Align Left</source>
<translation>По левому краю</translation>
</message>
<message>
<source>Align Left (Ctrl+L,1)</source>
<translation>По левому краю (Ctrl + L,1)</translation>
</message>
<message>
<source>Align Right</source>
<translation>По правому краю</translation>
</message>
<message>
<source>Align Right (Ctrl+L,2)</source>
<translation>По правому краю (Ctrl+L,2)</translation>
</message>
<message>
<source>Align Top</source>
<translation>По верху</translation>
</message>
<message>
<source>Align Top (Ctrl+L,3)</source>
<translation>По верху (Ctrl+L,3)</translation>
</message>
<message>
<source>Align Bottom</source>
<translation>По низу</translation>
</message>
<message>
<source>Align Bottom (Ctrl+L,4)</source>
<translation>По низу (Ctrl+L,4)</translation>
</message>
<message>
<source>Align Horizontal</source>
<translation>Выравнить гоизонтально</translation>
</message>
<message>
<source>Align Horizontal (Ctrl+L,5)</source>
<translation>Выравнить гоизонтально (Ctrl+L,5)</translation>
</message>
<message>
<source>Align Vertical</source>
<translation>Выравнить вертикально</translation>
</message>
<message>
<source>Align Vertical (Ctrl+L,6)</source>
<translation>Выравнить гоизонтально (Ctrl+L,6)</translation>
</message>
<message>
<source>Adjust Width</source>
<translation>Подогнать ширину</translation>
</message>
<message>
<source>Adjust Width (Ctrl+L,7)</source>
<translation>Подогнать ширину (Ctrl+L,7)</translation>
</message>
<message>
<source>Adjust Height</source>
<translation>Подогнать высоту</translation>
</message>
<message>
<source>Adjust Height (Ctrl+L,8)</source>
<translation>Подогнать высоту (Ctrl+L,8)</translation>
</message>
<message>
<source>Adjust Size</source>
<translation>Подогнать размер</translation>
</message>
<message>
<source>Adjust Size (Ctrl+L,9)</source>
<translation>Подогнать размер (Ctrl+L,9)</translation>
</message>
<message>
<source>Show Statistics...</source>
<translation>Показать статистику...</translation>
</message>
<message>
<source>Show Statistics</source>
<translation>Показать статистику</translation>
</message>
</context>
<context>
<name>AddSignalHandlerDialog</name>
<message>
@@ -4129,7 +3958,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Генератор CMake не создаёт файл CodeBlocks. Qt Creator не сможет обрабатывать проект CMake.</translation>
</message>
<message>
<source>Generator: %1&lt;br&gt;Extra Generator: %2</source>
<source>Generator: %1&lt;br&gt;Extra generator: %2</source>
<translation>Генератор: %1&lt;br&gt;Дополнительный генератор: %2</translation>
</message>
<message>
@@ -4259,8 +4088,8 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Настройка «%1»</translation>
</message>
<message>
<source>*** cmake process crashed!</source>
<translation>*** процесс cmake аварийно завершился!</translation>
<source>*** cmake process crashed.</source>
<translation>*** процесс cmake аварийно завершился.</translation>
</message>
<message>
<source>*** cmake process exited with exit code %1.</source>
@@ -4454,7 +4283,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Изменить...</translation>
</message>
<message>
<source>CMake Generator:</source>
<source>CMake generator:</source>
<translation>Генератор CMake:</translation>
</message>
<message>
@@ -4474,7 +4303,7 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Генератор:</translation>
</message>
<message>
<source>Extra Generator:</source>
<source>Extra generator:</source>
<translation>Дополнительный генератор:</translation>
</message>
<message>
@@ -8626,6 +8455,10 @@ Do you want to kill it?</source>
</context>
<context>
<name>Core::Internal::ThemeChooser</name>
<message>
<source>Current theme: %1</source>
<translation>Текущая тема: %1</translation>
</message>
<message>
<source>Restart Required</source>
<translation>Требуется перезапуск</translation>
@@ -11099,10 +10932,6 @@ Flags: %3</source>
<source>Pat&amp;h:</source>
<translation>Пут&amp;ь:</translation>
</message>
<message>
<source>&lt;p&gt;Specifying the module (base name of the library or executable) for function or file type breakpoints can significantly speed up debugger start-up times (CDB, LLDB).</source>
<translation>&lt;p&gt;Указание модуля (имени библиотеки или программы) для точек останова на функциях или исходниках может значительно повысить скорость запуска отладчика (CDB, LLDB).</translation>
</message>
<message>
<source>&amp;Module:</source>
<translation>&amp;Модуль:</translation>
@@ -11159,14 +10988,6 @@ Flags: %3</source>
<source>Edit Selected Breakpoints...</source>
<translation>Изменить выбранные точки останова...</translation>
</message>
<message>
<source>Associate Breakpoint With All Threads</source>
<translation>Сопоставить точку останова со всеми потоками</translation>
</message>
<message>
<source>Associate Breakpoint With Thread %1</source>
<translation>Сопоставить точку останова с потоком %1</translation>
</message>
<message>
<source>Disable Selected Breakpoints</source>
<translation>Деактивировать выбранные точки останова</translation>
@@ -11319,6 +11140,14 @@ Flags: %3</source>
<source>Function Name:</source>
<translation>Имя функции:</translation>
</message>
<message>
<source>Associate Breakpoint with All Threads</source>
<translation>Сопоставить точку останова со всеми потоками</translation>
</message>
<message>
<source>Associate Breakpoint with Thread %1</source>
<translation>Сопоставить точку останова с потоком %1</translation>
</message>
<message>
<source>Line Number:</source>
<translation>Номер строки:</translation>
@@ -11359,6 +11188,10 @@ Flags: %3</source>
<source>Breakpoint on QML Signal Emit</source>
<translation>Точка остановка на инициировании сигнала QML</translation>
</message>
<message>
<source>&lt;p&gt;Specifying the module (base name of the library or executable) for function or file type breakpoints can significantly speed up debugger startup times (CDB, LLDB).</source>
<translation>&lt;p&gt;Указание модуля (имени библиотеки или программы) для точек останова на функциях или исходниках может значительно повысить скорость запуска отладчика (CDB, LLDB).</translation>
</message>
<message>
<source>Function</source>
<translation>Функция</translation>
@@ -11623,17 +11456,6 @@ Flags: %3</source>
</context>
<context>
<name>Debugger::Internal::CommonOptionsPage</name>
<message>
<source>Stop when %1() is called</source>
<translation>Остановиться на вызове %1()</translation>
</message>
<message>
<source>Always adds a breakpoint on the &lt;i&gt;%1()&lt;/i&gt; function.</source>
<translation>Всегда устанавливать точку останова на функцию &lt;i&gt;%1()&lt;/i&gt;.</translation>
</message>
</context>
<context>
<name>Debugger::Internal::CommonOptionsPageWidget</name>
<message>
<source>Behavior</source>
<translation>Поведение</translation>
@@ -11642,6 +11464,10 @@ Flags: %3</source>
<source>Use alternating row colors in debug views</source>
<translation>Чередование цвета строк в представлении отладчика</translation>
</message>
<message>
<source>Changes the font size in the debugger views when the font size in the main editor changes.</source>
<translation>Менять размер шрифта в окне отладчика при изменении его в основном окне редактора.</translation>
</message>
<message>
<source>Debugger font size follows main editor</source>
<translation>Размер шрифта отладчика соответствует редактору</translation>
@@ -11650,34 +11476,6 @@ Flags: %3</source>
<source>Use tooltips in main editor while debugging</source>
<translation>Использовать подсказки в основном редакторе при отладке</translation>
</message>
<message>
<source>Changes the font size in the debugger views when the font size in the main editor changes.</source>
<translation>Менять размер шрифта в окне отладчика при изменении его в основном окне редактора.</translation>
</message>
<message>
<source>Switch to previous mode on debugger exit</source>
<translation>Переключаться в предыдущий режим при завершении отладчика</translation>
</message>
<message>
<source>Bring Qt Creator to foreground when application interrupts</source>
<translation>Переходить в окно Qt Creator при прерывании приложения</translation>
</message>
<message>
<source>Enables a full file path in breakpoints by default also for GDB.</source>
<translation>Включение полного пути к исходным файлам для точек останова так же для GDB.</translation>
</message>
<message>
<source>Registers Qt Creator for debugging crashed applications.</source>
<translation>Зарегистрировать Qt Creator для отладки приложений, завершённых аварийно.</translation>
</message>
<message>
<source>Shows a warning when starting the debugger on a binary with insufficient debug information.</source>
<translation>Показывать предупреждение при запуске отладчика на программе без отладочной информации.</translation>
</message>
<message>
<source>Show QML object tree</source>
<translation>Показывать дерево объектов QML</translation>
</message>
<message>
<source>Stopping and stepping in the debugger will automatically open views associated with the current location.</source>
<translation>Остановка и пошаговая отладка автоматически открывают обзор кода соответствующий текущему положению.</translation>
@@ -11698,14 +11496,34 @@ Flags: %3</source>
<source>Select this option to close automatically opened memory views when the debugger exits.</source>
<translation>Включение закрытия автоматически открытых обзоров памяти при завершении отладки.</translation>
</message>
<message>
<source>Switch to previous mode on debugger exit</source>
<translation>Переключаться в предыдущий режим при завершении отладчика</translation>
</message>
<message>
<source>Bring Qt Creator to foreground when application interrupts</source>
<translation>Переходить в окно Qt Creator при прерывании приложения</translation>
</message>
<message>
<source>Shows QML object tree in Locals and Expressions when connected and not stepping.</source>
<translation>Показывать дерево объектов QML в окне «Переменные и выражения» при подключении, но не при пошаговой отладке.</translation>
</message>
<message>
<source>Show QML object tree</source>
<translation>Показывать дерево объектов QML</translation>
</message>
<message>
<source>Enables a full file path in breakpoints by default also for GDB.</source>
<translation>Включение по умолчанию полного пути к исходным файлам для точек останова также и для GDB.</translation>
</message>
<message>
<source>Set breakpoints using a full absolute path</source>
<translation>Задавать полный путь к точкам останова</translation>
</message>
<message>
<source>Registers Qt Creator for debugging crashed applications.</source>
<translation>Зарегистрировать Qt Creator для отладки приложений, завершённых аварийно.</translation>
</message>
<message>
<source>Use Qt Creator for post-mortem debugging</source>
<translation>Назначить Qt Creator системным отладчиком</translation>
@@ -11714,6 +11532,10 @@ Flags: %3</source>
<source>Warn when debugging &quot;Release&quot; builds</source>
<translation>Предупреждать при отладке «выпускаемых» сборок</translation>
</message>
<message>
<source>Shows a warning when starting the debugger on a binary with insufficient debug information.</source>
<translation>Показывать предупреждение при запуске отладчика на программе без отладочной информации.</translation>
</message>
<message>
<source>Keep editor stationary when stepping</source>
<translation>Сохранять позицию редактора при пошаговой отладке</translation>
@@ -11730,6 +11552,14 @@ Flags: %3</source>
<source>&lt;unlimited&gt;</source>
<translation>&lt;бесконечна&gt;</translation>
</message>
<message>
<source>Stop when %1() is called</source>
<translation>Остановиться на вызове %1()</translation>
</message>
<message>
<source>Always adds a breakpoint on the &lt;i&gt;%1()&lt;/i&gt; function.</source>
<translation>Всегда устанавливать точку останова на функцию &lt;i&gt;%1()&lt;/i&gt;.</translation>
</message>
</context>
<context>
<name>Debugger::Internal::Console</name>
@@ -13939,7 +13769,7 @@ Do you want to retry?</source>
<translation>Шестнадцатеричный</translation>
</message>
<message>
<source>DecimalFormat</source>
<source>Decimal</source>
<translation>Десятичный</translation>
</message>
<message>
@@ -14674,6 +14504,18 @@ Do you want to retry?</source>
<source>Automatic</source>
<translation>Автоматический</translation>
</message>
<message>
<source>Note: Evaluators will be re-evaluated after each step. For details, see the &lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions&quot;&gt;documentation&lt;/a&gt;.</source>
<translation>Замечание: выражения вычисляются после каждого шага. Подробнее читайте в &lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions&quot;&gt;документации&lt;/a&gt;.</translation>
</message>
<message>
<source>Stop the program when the data at the address is modified.</source>
<translation>Останавливать программу при изменении данных по указанному адресу.</translation>
</message>
<message>
<source>Stop the program when the data at the address given by the expression is modified.</source>
<translation>Останавливать программу при изменении данных по адресу, заданному выражением.</translation>
</message>
<message>
<source>Raw Data</source>
<translation>Сырые данные</translation>
@@ -14760,10 +14602,6 @@ Do you want to retry?</source>
<source>Enter an expression to evaluate.</source>
<translation>Введите выражение для вычисления.</translation>
</message>
<message>
<source>Note: Evaluators will be re-evaluated after each step. For details check the &lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions&quot;&gt;documentation&lt;/a&gt;.</source>
<translation>Замечание: выражения вычисляются после каждого шага. Подробнее читайте в &lt;a href=&quot;qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions&quot;&gt;документации&lt;/a&gt;.</translation>
</message>
<message>
<source>New Evaluated Expression</source>
<translation>Новое вычисляемое выражение</translation>
@@ -14808,10 +14646,6 @@ Do you want to retry?</source>
<source>Add Data Breakpoint at Object&apos;s Address (0x%1)</source>
<translation>Добавить контрольную точку на адрес объекта (0x%1)</translation>
</message>
<message>
<source>Setting a data breakpoint on an address will cause the program to stop when the data at the address is modified.</source>
<translation>Установка контрольной точки на адрес приведёт к остановке программы при изменении данных по этому адресу.</translation>
</message>
<message>
<source>Add Data Breakpoint at Pointer&apos;s Address (0x%1)</source>
<translation>Добавить контрольную точку по адресу указателя (0x%1)</translation>
@@ -14828,10 +14662,6 @@ Do you want to retry?</source>
<source>Add Data Breakpoint at Expression</source>
<translation>Добавить контрольную точку на вычисляемый адрес</translation>
</message>
<message>
<source>Setting a data breakpoint on an expression will cause the program to stop when the data at the address given by the expression is modified.</source>
<translation>Установка контрольной точки на адрес приведёт к остановке программы при изменении данных по этому адресу.</translation>
</message>
<message>
<source>Open Memory Editor</source>
<translation>Открыть редактор памяти</translation>
@@ -17541,6 +17371,10 @@ Would you like to terminate it?</source>
<source>copied</source>
<translation>скопирован</translation>
</message>
<message>
<source>typechange</source>
<translation>смена типа</translation>
</message>
<message>
<source> by both</source>
<translation> обоими</translation>
@@ -20352,38 +20186,6 @@ Ids must begin with a lowercase letter.</source>
<source>Simulator application process error %1</source>
<translation>Приложение из эмулятора вернуло ошибку %1</translation>
</message>
<message>
<source>Application install on Simulator failed. %1</source>
<translation>Не удалось установить приложение на эмулятор. %1</translation>
</message>
<message>
<source>Application install on Simulator failed. Simulator not running.</source>
<translation>Не удалось установить приложение на эмулятор. Он не запущен.</translation>
</message>
<message>
<source>Application launch on Simulator failed. Invalid Bundle path %1</source>
<translation>Запуск приложения на эмуляторе не удался. Неверный путь пакета %1</translation>
</message>
<message>
<source>Spawning the Application process on Simulator failed.</source>
<translation>Не удалось породить процесс приложения на эмуляторе.</translation>
</message>
<message>
<source>Application launch on Simulator failed. Simulator not running.</source>
<translation>Не удалось запустить приложение на эмуляторе. Он не запущен.</translation>
</message>
<message>
<source>Application launch on Simulator failed. %1</source>
<translation>Запуск приложения на эмуляторе не удался. %1</translation>
</message>
<message>
<source>Spawning the Application process on Simulator failed. Spawning timed out.</source>
<translation>Не удалось породить процесс приложения на эмуляторе. Время порождения истекло.</translation>
</message>
<message>
<source>Simulator application process error %1</source>
<translation>Приложение из эмулятора вернуло ошибку %1</translation>
</message>
</context>
<context>
<name>IosDeployStepWidget</name>
@@ -21402,6 +21204,10 @@ Ids must begin with a lowercase letter.</source>
<source>Nim source file </source>
<translation>Исходник Nim</translation>
</message>
<message>
<source>Nim script file </source>
<translation>Файл сценария Nim</translation>
</message>
<message>
<source>Qt Creator Python project file</source>
<translation>Проект Qt Creator для Python</translation>
@@ -21422,6 +21228,14 @@ Ids must begin with a lowercase letter.</source>
<source>QML file</source>
<translation>Файл QML</translation>
</message>
<message>
<source>Linguist compiled translations</source>
<translation>Скомпилированные переводы Linguist</translation>
</message>
<message>
<source>Linguist source translations</source>
<translation>Исходные переводы Linguist</translation>
</message>
<message>
<source>SCXML State Chart</source>
<translation>Диаграмма состояний SCXML</translation>
@@ -21502,14 +21316,6 @@ Ids must begin with a lowercase letter.</source>
<source>QML Project file</source>
<translation>Файл проекта QML</translation>
</message>
<message>
<source>Linguist translated messages (machine-readable)</source>
<translation>Сообщения переведенные через Linguist (удобные для машины)</translation>
</message>
<message>
<source>Linguist message catalog</source>
<translation>Каталог сообщений Linguist</translation>
</message>
<message>
<source>Qt Resource file</source>
<translation>Файл ресурсов Qt</translation>
@@ -24524,11 +24330,11 @@ cannot be found in the path.</source>
<translation>Имя в файловой системе:</translation>
</message>
<message>
<source>Select a file as icon</source>
<translation>Выберите файл значка</translation>
<source>Select Icon File</source>
<translation>Выбор файла значка</translation>
</message>
<message>
<source>Reset to the device default icon</source>
<source>Reset to Device Default Icon</source>
<translation>Назначить стандартный для устройства значок</translation>
</message>
<message>
@@ -24959,6 +24765,14 @@ to project &quot;%2&quot;.</source>
<source>Projects</source>
<translation>Проекты</translation>
</message>
<message>
<source>Import Existing Build...</source>
<translation>Импорт сборки...</translation>
</message>
<message>
<source>Manage Kits...</source>
<translation>Управление...</translation>
</message>
<message>
<source>Import directory</source>
<translation>Импортируемый каталог</translation>
@@ -25111,17 +24925,6 @@ to project &quot;%2&quot;.</source>
<translation>Новое название конфигурации установки &lt;b&gt;%1&lt;/b&gt;:</translation>
</message>
</context>
<context>
<name>ProjectExplorer::Internal::SelectorModel</name>
<message>
<source>Import Existing Build...</source>
<translation>Импорт сборки...</translation>
</message>
<message>
<source>Manage Kits...</source>
<translation>Управление...</translation>
</message>
</context>
<context>
<name>ProjectExplorer::Internal::SessionDialog</name>
<message>
@@ -26182,7 +25985,7 @@ Preselects a desktop Qt for building the application if available.</source>
</message>
<message>
<source>Material</source>
<translation type="unfinished">Материальный</translation>
<translation>Материальный</translation>
</message>
<message>
<source>Universal</source>
@@ -26316,6 +26119,14 @@ Preselects a desktop Qt for building the application if available.</source>
<source>Nim File</source>
<translation>Файл Nim</translation>
</message>
<message>
<source>Creates an empty Nim script file using UTF-8 charset.</source>
<translation>Создание пустого файла сценария Nim с использованием кодировки UTF-8.</translation>
</message>
<message>
<source>Nim Script File</source>
<translation>Файл сценария Nim</translation>
</message>
<message>
<source>State Chart Name and Location</source>
<translation>Название и размещение диаграммы состояний</translation>
@@ -28653,9 +28464,8 @@ These files are preserved.</source>
<context>
<name>QbsProjectManager::Internal::QbsProject</name>
<message>
<source>Failed!</source>
<translatorcomment>Очень плохое сообщение, скорее всего не дописали</translatorcomment>
<translation>Ошибка</translation>
<source>Failed</source>
<translation>Сбой</translation>
</message>
<message>
<source>Could not write project file %1.</source>
@@ -30203,12 +30013,12 @@ Neither the path to the library nor the path to its includes is added to the .pr
<translation>Закрытие сетевого соединения</translation>
</message>
<message>
<source>Socket state changed to BoundState. This should not happen!</source>
<translation>Состояние сокета изменилось на BoundState. Это не должно было произойти!</translation>
<source>Socket state changed to BoundState. This should not happen.</source>
<translation>Состояние сокета изменилось на BoundState. Это не должно было произойти.</translation>
</message>
<message>
<source>Socket state changed to ListeningState. This should not happen!</source>
<translation>Состояние сокета изменилось на ListeningState. Это не должно было произойти!</translation>
<source>Socket state changed to ListeningState. This should not happen.</source>
<translation>Состояние сокета изменилось на ListeningState. Это не должно было произойти.</translation>
</message>
<message>
<source>Unknown state %1</source>
@@ -31628,7 +31438,7 @@ This is independent of the visibility property in QML.</source>
<translation>Файл или каталог не найден.</translation>
</message>
<message>
<source>QML module not found(%1).
<source>QML module not found (%1).
Import paths:
%2
@@ -33474,8 +33284,8 @@ Do you want to retry?</source>
Повторить?</translation>
</message>
<message>
<source>Failed to connect!</source>
<translation>Не удалось подключиться!</translation>
<source>Failed to connect.</source>
<translation>Не удалось подключиться.</translation>
</message>
<message>
<source>Disable Profiling</source>
@@ -36406,6 +36216,177 @@ Description: %4</source>
Описание: %4</translation>
</message>
</context>
<context>
<name>ScxmlEditor::PluginInterface::ActionHandler</name>
<message>
<source>Zoom In</source>
<translation>Увеличить</translation>
</message>
<message>
<source>Zoom In (Ctrl + + / Ctrl + Wheel)</source>
<translation>Увеличить (Ctrl++ / Ctrl+Колёсико)</translation>
</message>
<message>
<source>Zoom Out</source>
<translation>Уменьшить</translation>
</message>
<message>
<source>Zoom Out (Ctrl + - / Ctrl + Wheel)</source>
<translation>Уменьшить (Ctrl+- / Ctrl+Колёсико)</translation>
</message>
<message>
<source>Fit to View</source>
<translation>Растянуть на окно</translation>
</message>
<message>
<source>Fit to View (F11)</source>
<translation>Растянуть на окно (F11)</translation>
</message>
<message>
<source>Panning</source>
<translation>Панорамирование</translation>
</message>
<message>
<source>Panning (Shift)</source>
<translation>Панорамирование (Shift)</translation>
</message>
<message>
<source>Magnifier</source>
<translation>Лупа</translation>
</message>
<message>
<source>Magnifier Tool (Alt)</source>
<translation>Лупа (Alt)</translation>
</message>
<message>
<source>Navigator</source>
<translation>Навигатор</translation>
</message>
<message>
<source>Navigator (Ctrl+E)</source>
<translation>Навигатор (Ctrl+E)</translation>
</message>
<message>
<source>Copy</source>
<translation>Копировать</translation>
</message>
<message>
<source>Copy (Ctrl + C)</source>
<translation>Копировать (Ctrl+C)</translation>
</message>
<message>
<source>Cut</source>
<translation>Вырезать</translation>
</message>
<message>
<source>Cut (Ctrl + X)</source>
<translation>Вырезать (Ctrl+X)</translation>
</message>
<message>
<source>Paste</source>
<translation>Вставить</translation>
</message>
<message>
<source>Paste (Ctrl + V)</source>
<translation>Вставить (Ctrl+V)</translation>
</message>
<message>
<source>Screenshot</source>
<translation>Снимок экрана</translation>
</message>
<message>
<source>Screenshot (Ctrl + Shift + C)</source>
<translation>Снимок экрана (Ctrl+Shift+C)</translation>
</message>
<message>
<source>Export to Image</source>
<translation>В изображение</translation>
</message>
<message>
<source>Toggle Full Namespace</source>
<translation>Переключить пространство имён</translation>
</message>
<message>
<source>Align Left</source>
<translation>По левому краю</translation>
</message>
<message>
<source>Align Left (Ctrl+L,1)</source>
<translation>По левому краю (Ctrl + L,1)</translation>
</message>
<message>
<source>Align Right</source>
<translation>По правому краю</translation>
</message>
<message>
<source>Align Right (Ctrl+L,2)</source>
<translation>По правому краю (Ctrl+L,2)</translation>
</message>
<message>
<source>Align Top</source>
<translation>По верху</translation>
</message>
<message>
<source>Align Top (Ctrl+L,3)</source>
<translation>По верху (Ctrl+L,3)</translation>
</message>
<message>
<source>Align Bottom</source>
<translation>По низу</translation>
</message>
<message>
<source>Align Bottom (Ctrl+L,4)</source>
<translation>По низу (Ctrl+L,4)</translation>
</message>
<message>
<source>Align Horizontal</source>
<translation>Выравнить гоизонтально</translation>
</message>
<message>
<source>Align Horizontal (Ctrl+L,5)</source>
<translation>Выравнить гоизонтально (Ctrl+L,5)</translation>
</message>
<message>
<source>Align Vertical</source>
<translation>Выравнить вертикально</translation>
</message>
<message>
<source>Align Vertical (Ctrl+L,6)</source>
<translation>Выравнить гоизонтально (Ctrl+L,6)</translation>
</message>
<message>
<source>Adjust Width</source>
<translation>Подогнать ширину</translation>
</message>
<message>
<source>Adjust Width (Ctrl+L,7)</source>
<translation>Подогнать ширину (Ctrl+L,7)</translation>
</message>
<message>
<source>Adjust Height</source>
<translation>Подогнать высоту</translation>
</message>
<message>
<source>Adjust Height (Ctrl+L,8)</source>
<translation>Подогнать высоту (Ctrl+L,8)</translation>
</message>
<message>
<source>Adjust Size</source>
<translation>Подогнать размер</translation>
</message>
<message>
<source>Adjust Size (Ctrl+L,9)</source>
<translation>Подогнать размер (Ctrl+L,9)</translation>
</message>
<message>
<source>Show Statistics...</source>
<translation>Показать статистику...</translation>
</message>
<message>
<source>Show Statistics</source>
<translation>Показать статистику</translation>
</message>
</context>
<context>
<name>ScxmlEditor::PluginInterface::BaseItem</name>
<message>
@@ -36981,11 +36962,11 @@ with a password, which you can enter below.</source>
<context>
<name>StatesDelegate</name>
<message>
<source>Set when condition</source>
<source>Set when Condition</source>
<translation>Задать условие when</translation>
</message>
<message>
<source>Reset when condition</source>
<source>Reset when Condition</source>
<translation>Сбросить условие when</translation>
</message>
</context>
@@ -37589,9 +37570,13 @@ with a password, which you can enter below.</source>
<source>Aborting replace.</source>
<translation>Прерывание замены.</translation>
</message>
<message>
<source>%1 found</source>
<translation>найдено: %1</translation>
<message numerus="yes">
<source>%n found</source>
<translation>
<numerusform>%n найден</numerusform>
<numerusform>%n найдено</numerusform>
<numerusform>%n найдено</numerusform>
</translation>
</message>
</context>
<context>
@@ -43536,6 +43521,10 @@ should a repository require SSH-authentication (see documentation on SSH and the
<source>Auto width</source>
<translation>Автоширина</translation>
</message>
<message>
<source>&lt;font color=red&gt;Invalid syntax.&lt;/font&gt;</source>
<translation>&lt;font color=red&gt;Неверный синтаксис.&lt;/font&gt;</translation>
</message>
<message>
<source>Box</source>
<translation>Коробкой</translation>
@@ -43576,10 +43565,6 @@ should a repository require SSH-authentication (see documentation on SSH and the
<source>Boundaries</source>
<translation>Границы</translation>
</message>
<message>
<source>&lt;font color=red&gt;Invalid syntax!&lt;/font&gt;</source>
<translation>&lt;font color=red&gt;Неверный синтаксис!&lt;/font&gt;</translation>
</message>
<message>
<source>Multi-Selection</source>
<translation>Множественное выделение</translation>

View File

@@ -33,6 +33,16 @@ Item {
property int screenDependHeightDistance: Math.min(50, Math.max(16, height / 30))
DropArea {
anchors.fill: parent
keys: ["text/uri-list"]
onDropped: {
if ((drop.supportedActions & Qt.CopyAction != 0)
&& welcomeMode.openDroppedFiles(drop.urls))
drop.accept(Qt.CopyAction);
}
}
SideBar {
id: sideBar
model: pagesModel

View File

@@ -369,9 +369,12 @@ template <typename ForwardIterator, typename InitFunction, typename MapFunction,
QFuture<ReduceResult>
mapReduce(ForwardIterator begin, ForwardIterator end, InitFunction &&init, MapFunction &&map,
ReduceFunction &&reduce, CleanUpFunction &&cleanup,
MapReduceOption option = MapReduceOption::Unordered, int size = -1)
MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority,
int size = -1)
{
return runAsync(Internal::blockingIteratorMapReduce<
return runAsync(priority,
Internal::blockingIteratorMapReduce<
ForwardIterator,
typename std::decay<InitFunction>::type,
typename std::decay<MapFunction>::type,
@@ -438,9 +441,11 @@ template <typename Container, typename InitFunction, typename MapFunction,
QFuture<ReduceResult>
mapReduce(Container &&container, InitFunction &&init, MapFunction &&map,
ReduceFunction &&reduce, CleanUpFunction &&cleanup,
MapReduceOption option = MapReduceOption::Unordered)
MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority)
{
return runAsync(Internal::blockingContainerMapReduce<
return runAsync(priority,
Internal::blockingContainerMapReduce<
typename std::decay<Container>::type,
typename std::decay<InitFunction>::type,
typename std::decay<MapFunction>::type,
@@ -458,9 +463,11 @@ template <typename Container, typename InitFunction, typename MapFunction,
QFuture<ReduceResult>
mapReduce(std::reference_wrapper<Container> containerWrapper, InitFunction &&init, MapFunction &&map,
ReduceFunction &&reduce, CleanUpFunction &&cleanup,
MapReduceOption option = MapReduceOption::Unordered)
MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority)
{
return runAsync(Internal::blockingContainerRefMapReduce<
return runAsync(priority,
Internal::blockingContainerRefMapReduce<
Container,
typename std::decay<InitFunction>::type,
typename std::decay<MapFunction>::type,
@@ -478,14 +485,15 @@ template <typename ForwardIterator, typename MapFunction, typename State, typena
typename MapResult = typename Internal::resultType<MapFunction>::type>
QFuture<StateResult>
mapReduce(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState,
ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, int size = -1)
ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority, int size = -1)
{
return mapReduce(begin, end,
Internal::StateWrapper<State>(std::forward<State>(initialState)),
std::forward<MapFunction>(map),
Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)),
&Internal::cleanupReportingState<StateResult>,
option, size);
option, priority, size);
}
template <typename Container, typename MapFunction, typename State, typename ReduceFunction,
@@ -493,14 +501,15 @@ template <typename Container, typename MapFunction, typename State, typename Red
typename MapResult = typename Internal::resultType<MapFunction>::type>
QFuture<StateResult>
mapReduce(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce,
MapReduceOption option = MapReduceOption::Unordered)
MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority)
{
return mapReduce(std::forward<Container>(container),
Internal::StateWrapper<State>(std::forward<State>(initialState)),
std::forward<MapFunction>(map),
Internal::ReduceWrapper<StateResult, MapResult, ReduceFunction>(std::forward<ReduceFunction>(reduce)),
&Internal::cleanupReportingState<StateResult>,
option);
option, priority);
}
template <typename ForwardIterator, typename MapFunction, typename State, typename ReduceFunction,
@@ -509,12 +518,13 @@ template <typename ForwardIterator, typename MapFunction, typename State, typena
Q_REQUIRED_RESULT
StateResult
mappedReduced(ForwardIterator begin, ForwardIterator end, MapFunction &&map, State &&initialState,
ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered, int size = -1)
ReduceFunction &&reduce, MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority, int size = -1)
{
return mapReduce(begin, end,
std::forward<MapFunction>(map), std::forward<State>(initialState),
std::forward<ReduceFunction>(reduce),
option, size).result();
option, priority, size).result();
}
template <typename Container, typename MapFunction, typename State, typename ReduceFunction,
@@ -523,38 +533,41 @@ template <typename Container, typename MapFunction, typename State, typename Red
Q_REQUIRED_RESULT
StateResult
mappedReduced(Container &&container, MapFunction &&map, State &&initialState, ReduceFunction &&reduce,
MapReduceOption option = MapReduceOption::Unordered)
MapReduceOption option = MapReduceOption::Unordered,
QThread::Priority priority = QThread::InheritPriority)
{
return mapReduce(std::forward<Container>(container), std::forward<MapFunction>(map),
std::forward<State>(initialState), std::forward<ReduceFunction>(reduce),
option).result();
option, priority).result();
}
template <typename ForwardIterator, typename MapFunction,
typename MapResult = typename Internal::resultType<MapFunction>::type>
QFuture<MapResult>
map(ForwardIterator begin, ForwardIterator end, MapFunction &&map,
MapReduceOption option = MapReduceOption::Ordered, int size = -1)
MapReduceOption option = MapReduceOption::Ordered,
QThread::Priority priority = QThread::InheritPriority, int size = -1)
{
return mapReduce(begin, end,
&Internal::dummyInit<MapResult>,
std::forward<MapFunction>(map),
Internal::DummyReduce<MapResult>(),
&Internal::dummyCleanup<MapResult>,
option, size);
option, priority, size);
}
template <typename Container, typename MapFunction,
typename MapResult = typename Internal::resultType<MapFunction>::type>
QFuture<MapResult>
map(Container &&container, MapFunction &&map, MapReduceOption option = MapReduceOption::Ordered)
map(Container &&container, MapFunction &&map, MapReduceOption option = MapReduceOption::Ordered,
QThread::Priority priority = QThread::InheritPriority)
{
return mapReduce(std::forward<Container>(container),
Internal::dummyInit<MapResult>,
std::forward<MapFunction>(map),
Internal::DummyReduce<MapResult>(),
Internal::dummyCleanup<MapResult>,
option);
option, priority);
}
template <template<typename> class ResultContainer, typename ForwardIterator, typename MapFunction,
@@ -562,11 +575,12 @@ template <template<typename> class ResultContainer, typename ForwardIterator, ty
Q_REQUIRED_RESULT
ResultContainer<MapResult>
mapped(ForwardIterator begin, ForwardIterator end, MapFunction &&mapFun,
MapReduceOption option = MapReduceOption::Ordered, int size = -1)
MapReduceOption option = MapReduceOption::Ordered,
QThread::Priority priority = QThread::InheritPriority, int size = -1)
{
return Utils::transform<ResultContainer>(map(begin, end,
std::forward<MapFunction>(mapFun),
option, size).results(),
option, priority, size).results(),
[](const MapResult &r) { return r; });
}
@@ -574,11 +588,13 @@ template <template<typename> class ResultContainer, typename Container, typename
typename MapResult = typename Internal::resultType<MapFunction>::type>
Q_REQUIRED_RESULT
ResultContainer<MapResult>
mapped(Container &&container, MapFunction &&mapFun, MapReduceOption option = MapReduceOption::Ordered)
mapped(Container &&container, MapFunction &&mapFun,
MapReduceOption option = MapReduceOption::Ordered,
QThread::Priority priority = QThread::InheritPriority)
{
return Utils::transform<ResultContainer>(map(container,
std::forward<MapFunction>(mapFun),
option).results(),
option, priority).results(),
[](const MapResult &r) { return r; });
}

View File

@@ -25,6 +25,8 @@
#pragma once
#include <qsystemdetection.h>
#include <cstdlib>
#include <cstring>
#include <memory>
@@ -35,7 +37,7 @@ namespace Memory {
inline char *allocate(std::size_t size)
{
#ifdef WIN32
#ifdef Q_OS_WIN32
return static_cast<char*>(_aligned_malloc(size, 64));
#else
return static_cast<char*>(std::malloc(size));
@@ -44,7 +46,7 @@ inline char *allocate(std::size_t size)
inline void deallocate(char *memory)
{
#ifdef WIN32
#ifdef Q_OS_WIN32
_aligned_free(memory);
#else
#pragma GCC diagnostic push
@@ -58,7 +60,7 @@ inline void deallocate(char *memory)
inline char *reallocate(char *oldMemory, std::size_t newSize)
{
#ifdef WIN32
#ifdef Q_OS_WIN32
return static_cast<char*>(_aligned_realloc(oldMemory, newSize, 64));
#else
return static_cast<char*>(std::realloc(oldMemory, newSize));

View File

@@ -5,16 +5,6 @@
<file>images/sort@2x.png</file>
<file>images/leafsort.png</file>
<file>images/leafsort@2x.png</file>
<file>images/debug.png</file>
<file>images/fail.png</file>
<file>images/fatal.png</file>
<file>images/pass.png</file>
<file>images/skip.png</file>
<file>images/warn.png</file>
<file>images/xfail.png</file>
<file>images/xpass.png</file>
<file>images/blacklisted_fail.png</file>
<file>images/blacklisted_pass.png</file>
<file>images/benchmark.png</file>
<file>images/runselected_boxes.png</file>
<file>images/runselected_boxes@2x.png</file>

View File

@@ -38,5 +38,39 @@ const Utils::Icon RUN_SELECTED_OVERLAY({
{QLatin1String(":/images/runselected_boxes.png"), Utils::Theme::BackgroundColorDark},
{QLatin1String(":/images/runselected_tickmarks.png"), Utils::Theme::IconsBaseColor}});
const Utils::Icon RESULT_PASS({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_FAIL({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFailTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_XFAIL({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestXFailTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_XPASS({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestXPassTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_SKIP({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestSkipTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_BLACKLISTEDPASS({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestPassTextColor},
{":/projectexplorer/images/buildstepdisable.png", Utils::Theme::PanelTextColorDark}},
Utils::Icon::Tint | Utils::Icon::PunchEdges);
const Utils::Icon RESULT_BLACKLISTEDFAIL({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFailTextColor},
{":/projectexplorer/images/buildstepdisable.png", Utils::Theme::PanelTextColorDark}},
Utils::Icon::Tint | Utils::Icon::PunchEdges);
const Utils::Icon RESULT_BENCHMARK(":/images/benchmark.png");
const Utils::Icon RESULT_MESSAGEDEBUG({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestDebugTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_MESSAGEWARN({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestWarnTextColor}},
Utils::Icon::Tint);
const Utils::Icon RESULT_MESSAGEFATAL({
{":/utils/images/filledcircle.png", Utils::Theme::OutputPanes_TestFatalTextColor}},
Utils::Icon::Tint);
} // namespace Icons
} // namespace Autotest

View File

@@ -178,6 +178,7 @@ void AutotestPlugin::onRunSelectedTriggered()
void AutotestPlugin::updateMenuItemsEnabledState()
{
const bool enabled = !TestRunner::instance()->isTestRunning()
&& TestTreeModel::instance()->parser()->enabled()
&& TestTreeModel::instance()->parser()->state() == TestCodeParser::Idle;
const bool hasTests = TestTreeModel::instance()->hasTests();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 595 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

View File

@@ -81,7 +81,7 @@ TestCodeParser::~TestCodeParser()
void TestCodeParser::setState(State state)
{
if (m_parserState == Shutdown)
if (m_parserState == Shutdown || !m_enabled)
return;
qCDebug(LOG) << "setState(" << state << "), currentState:" << m_parserState;
// avoid triggering parse before code model parsing has finished, but mark as dirty
@@ -91,17 +91,13 @@ void TestCodeParser::setState(State state)
return;
}
if ((state == Disabled || state == Idle)
&& (m_parserState == PartialParse || m_parserState == FullParse)) {
if ((state == Idle) && (m_parserState == PartialParse || m_parserState == FullParse)) {
qCDebug(LOG) << "Not setting state, parse is running";
return;
}
m_parserState = state;
if (m_parserState == Disabled) {
m_fullUpdatePostponed = m_partialUpdatePostponed = false;
m_postponedFiles.clear();
} else if (m_parserState == Idle && ProjectExplorer::SessionManager::startupProject()) {
if (m_parserState == Idle && ProjectExplorer::SessionManager::startupProject()) {
if (m_fullUpdatePostponed || m_dirty) {
emitUpdateTestTree();
} else if (m_partialUpdatePostponed) {
@@ -115,7 +111,7 @@ void TestCodeParser::setState(State state)
void TestCodeParser::syncTestFrameworks(const QVector<Core::Id> &frameworkIds)
{
if (m_parserState != Disabled && m_parserState != Idle) {
if (m_enabled && m_parserState != Idle) {
// there's a running parse
m_fullUpdatePostponed = m_partialUpdatePostponed = false;
m_postponedFiles.clear();
@@ -129,7 +125,7 @@ void TestCodeParser::syncTestFrameworks(const QVector<Core::Id> &frameworkIds)
QTC_ASSERT(testParser, continue);
m_testCodeParsers.append(testParser);
}
if (m_parserState != Disabled)
if (m_enabled)
updateTestTree();
}
@@ -211,7 +207,7 @@ void TestCodeParser::onProjectPartsUpdated(ProjectExplorer::Project *project)
{
if (project != ProjectExplorer::SessionManager::startupProject())
return;
if (m_codeModelParsing || m_parserState == Disabled)
if (m_codeModelParsing || !m_enabled)
m_fullUpdatePostponed = true;
else
emitUpdateTestTree();
@@ -276,7 +272,6 @@ bool TestCodeParser::postponed(const QStringList &fileList)
m_partialUpdatePostponed = true;
}
return true;
case Disabled:
case Shutdown:
break;
}
@@ -297,7 +292,9 @@ static void parseFileForTests(const QVector<ITestParser *> &parsers,
void TestCodeParser::scanForTests(const QStringList &fileList)
{
if (m_parserState == Disabled || m_parserState == Shutdown) {
if (m_parserState == Shutdown)
return;
if (!m_enabled) {
m_dirty = true;
if (fileList.isEmpty()) {
m_fullUpdatePostponed = true;
@@ -357,7 +354,8 @@ void TestCodeParser::scanForTests(const QStringList &fileList)
[this](QFutureInterface<TestParseResultPtr> &fi, const QString &file) {
parseFileForTests(m_testCodeParsers, fi, file);
},
Utils::MapReduceOption::Unordered);
Utils::MapReduceOption::Unordered,
QThread::LowestPriority);
m_futureWatcher.setFuture(future);
if (list.size() > 5) {
Core::ProgressManager::addTask(future, tr("Scanning for Tests"),
@@ -419,11 +417,6 @@ void TestCodeParser::onFinished()
}
m_dirty = false;
break;
case Disabled: // can happen if all Test related widgets become hidden while parsing
qCDebug(LOG) << "emitting parsingFinished (onFinished, Disabled)";
emit parsingFinished();
qCDebug(LOG) << QDateTime::currentDateTime().toString("hh:mm:ss.zzz") << "ParsingFin";
break;
case Shutdown:
qCDebug(LOG) << "Shutdown complete - not emitting parsingFinished (onFinished)";
break;

View File

@@ -49,7 +49,6 @@ public:
Idle,
PartialParse,
FullParse,
Disabled,
Shutdown
};
@@ -57,6 +56,8 @@ public:
virtual ~TestCodeParser();
void setState(State state);
State state() const { return m_parserState; }
void setEnabled(bool enabled) { m_enabled = enabled; }
bool enabled() const { return m_enabled; }
bool isParsing() const { return m_parserState == PartialParse || m_parserState == FullParse; }
void setDirty() { m_dirty = true; }
void syncTestFrameworks(const QVector<Core::Id> &frameworkIds);
@@ -95,6 +96,7 @@ private:
TestTreeModel *m_model;
bool m_enabled = false;
bool m_codeModelParsing = false;
bool m_fullUpdatePostponed = false;
bool m_partialUpdatePostponed = false;
@@ -102,7 +104,7 @@ private:
bool m_singleShotScheduled = false;
bool m_reparseTimerTimedOut = false;
QSet<QString> m_postponedFiles;
State m_parserState = Disabled;
State m_parserState = Idle;
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
QVector<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
QTimer m_reparseTimer;

View File

@@ -115,7 +115,7 @@ TestNavigationWidget::~TestNavigationWidget()
void TestNavigationWidget::contextMenuEvent(QContextMenuEvent *event)
{
const bool enabled = !TestRunner::instance()->isTestRunning()
&& m_model->parser()->state() == TestCodeParser::Idle;
&& m_model->parser()->enabled() && m_model->parser()->state() == TestCodeParser::Idle;
const bool hasTests = m_model->hasTests();
QMenu menu;

View File

@@ -23,6 +23,7 @@
**
****************************************************************************/
#include "autotesticons.h"
#include "testresultdelegate.h"
#include "testresultmodel.h"
@@ -46,20 +47,20 @@ TestResultItem::~TestResultItem()
}
static QIcon testResultIcon(Result::Type result) {
static QIcon icons[] = {
QIcon(QLatin1String(":/images/pass.png")),
QIcon(QLatin1String(":/images/fail.png")),
QIcon(QLatin1String(":/images/xfail.png")),
QIcon(QLatin1String(":/images/xpass.png")),
QIcon(QLatin1String(":/images/skip.png")),
QIcon(QLatin1String(":/images/blacklisted_pass.png")),
QIcon(QLatin1String(":/images/blacklisted_fail.png")),
QIcon(QLatin1String(":/images/benchmark.png")),
QIcon(QLatin1String(":/images/debug.png")),
QIcon(QLatin1String(":/images/debug.png")), // Info get's the same handling as Debug for now
QIcon(QLatin1String(":/images/warn.png")),
QIcon(QLatin1String(":/images/fatal.png")),
QIcon(QLatin1String(":/images/fatal.png")), // System get's same handling as Fatal for now
const static QIcon icons[] = {
Icons::RESULT_PASS.icon(),
Icons::RESULT_FAIL.icon(),
Icons::RESULT_XFAIL.icon(),
Icons::RESULT_XPASS.icon(),
Icons::RESULT_SKIP.icon(),
Icons::RESULT_BLACKLISTEDPASS.icon(),
Icons::RESULT_BLACKLISTEDFAIL.icon(),
Icons::RESULT_BENCHMARK.icon(),
Icons::RESULT_MESSAGEDEBUG.icon(),
Icons::RESULT_MESSAGEDEBUG.icon(), // Info gets the same handling as Debug for now
Icons::RESULT_MESSAGEWARN.icon(),
Icons::RESULT_MESSAGEFATAL.icon(),
Icons::RESULT_MESSAGEFATAL.icon(), // System gets same handling as Fatal for now
}; // provide an icon for unknown??
if (result < 0 || result >= Result::MessageInternal) {

View File

@@ -90,6 +90,7 @@ void TestTreeModel::setupParsingConnections()
if (!m_connectionsInitialized)
m_parser->setDirty();
m_parser->setEnabled(true);
m_parser->setState(TestCodeParser::Idle);
if (m_connectionsInitialized)
return;
@@ -117,13 +118,13 @@ void TestTreeModel::setupParsingConnections()
void TestTreeModel::disableParsing()
{
if (!m_refCounter.deref() && !AutotestPlugin::instance()->settings()->alwaysParse)
m_parser->setState(TestCodeParser::Disabled);
m_parser->setEnabled(false);
}
void TestTreeModel::disableParsingFromSettings()
{
if (!m_refCounter.load())
m_parser->setState(TestCodeParser::Disabled);
m_parser->setEnabled(false);
}
bool TestTreeModel::setData(const QModelIndex &index, const QVariant &value, int role)

View File

@@ -401,9 +401,30 @@ static QStringList warningOptions(CppTools::ProjectPart *projectPart)
return CppTools::codeModelSettings()->clangDiagnosticConfig().commandLineOptions();
}
static QStringList precompiledHeaderOptions(
const QString& filePath,
CppTools::ProjectPart *projectPart)
{
using namespace CppTools;
if (CppTools::getPchUsage() == CompilerOptionsBuilder::PchUsage::None)
return QStringList();
if (projectPart->precompiledHeaders.contains(filePath))
return QStringList();
const CppTools::ProjectPart theProjectPart = projectPartForLanguageOption(projectPart);
CppTools::CompilerOptionsBuilder builder(theProjectPart);
builder.addPrecompiledHeaderOptions(CompilerOptionsBuilder::PchUsage::Use);
return builder.options();
}
static QStringList fileArguments(const QString &filePath, CppTools::ProjectPart *projectPart)
{
return languageOptions(filePath, projectPart) + warningOptions(projectPart);
return languageOptions(filePath, projectPart)
+ warningOptions(projectPart)
+ precompiledHeaderOptions(filePath, projectPart);
}
ClangBackEnd::FileContainer

View File

@@ -192,27 +192,6 @@ QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind
return LibClangOptionsBuilder::build(pPart, fileKind);
}
/// @return Option to speed up parsing with precompiled header
QStringList createPCHInclusionOptions(const QStringList &pchFiles)
{
QStringList opts;
foreach (const QString &pchFile, pchFiles) {
if (QFile(pchFile).exists()) {
opts += QLatin1String("-include-pch");
opts += pchFile;
}
}
return opts;
}
/// @return Option to speed up parsing with precompiled header
QStringList createPCHInclusionOptions(const QString &pchFile)
{
return createPCHInclusionOptions(QStringList() << pchFile);
}
ProjectPart::Ptr projectPartForFile(const QString &filePath)
{
if (const auto parser = CppTools::BaseEditorDocumentParser::get(filePath))

View File

@@ -34,7 +34,6 @@ QStringList createClangOptions(const CppTools::ProjectPart::Ptr &pPart,
CppTools::ProjectFile::Kind fileKind);
QStringList createClangOptions(const CppTools::ProjectPart::Ptr &pPart,
const QString &fileName = QString());
QStringList createPCHInclusionOptions(const QString &pchFile);
CppTools::ProjectPart::Ptr projectPartForFile(const QString &filePath);
CppTools::ProjectPart::Ptr projectPartForFileBasedOnProcessor(const QString &filePath);

View File

@@ -117,7 +117,8 @@ void RefactoringCompilerOptionsBuilder::addExtraOptions()
}
Utils::SmallStringVector RefactoringCompilerOptionsBuilder::build(CppTools::ProjectPart *projectPart,
CppTools::ProjectFile::Kind fileKind)
CppTools::ProjectFile::Kind fileKind,
PchUsage pchUsage)
{
if (projectPart == nullptr)
return Utils::SmallStringVector();
@@ -138,6 +139,7 @@ Utils::SmallStringVector RefactoringCompilerOptionsBuilder::build(CppTools::Proj
optionsBuilder.addPredefinedMacrosAndHeaderPathsOptions();
optionsBuilder.addWrappedQtHeadersIncludePath();
optionsBuilder.addHeaderPathOptions();
optionsBuilder.addPrecompiledHeaderOptions(pchUsage);
optionsBuilder.addProjectConfigFileInclude();
optionsBuilder.addMsvcCompatibilityVersion();

View File

@@ -41,7 +41,8 @@ class RefactoringCompilerOptionsBuilder : public CppTools::CompilerOptionsBuilde
{
public:
static Utils::SmallStringVector build(CppTools::ProjectPart *projectPart,
CppTools::ProjectFile::Kind fileKind);
CppTools::ProjectFile::Kind fileKind,
PchUsage pchUsage);
private:
RefactoringCompilerOptionsBuilder(CppTools::ProjectPart *projectPart);

View File

@@ -32,6 +32,8 @@
#include <refactoringserverinterface.h>
#include <requestsourcelocationforrenamingmessage.h>
#include <cpptools/cpptoolsreuse.h>
#include <QTextCursor>
#include <QTextDocument>
@@ -59,7 +61,8 @@ void RefactoringEngine::startLocalRenaming(const QTextCursor &textCursor,
client.setLocalRenamingCallback(std::move(renameSymbolsCallback));
auto commandLine = RefactoringCompilerOptionsBuilder::build(projectPart,
fileKindInProjectPart(projectPart, filePath.toString()));
fileKindInProjectPart(projectPart, filePath.toString()),
CppTools::getPchUsage());
commandLine.push_back(filePath.toString());

View File

@@ -40,6 +40,7 @@
#include <cpptools/compileroptionsbuilder.h>
#include <cpptools/cppmodelmanager.h>
#include <cpptools/cppprojectfile.h>
#include <cpptools/cpptoolsreuse.h>
#include <cpptools/projectinfo.h>
#include <projectexplorer/abi.h>
@@ -165,7 +166,8 @@ class ClangStaticAnalyzerOptionsBuilder : public CompilerOptionsBuilder
{
public:
static QStringList build(const CppTools::ProjectPart &projectPart,
CppTools::ProjectFile::Kind fileKind)
CppTools::ProjectFile::Kind fileKind,
PchUsage pchUsage)
{
ClangStaticAnalyzerOptionsBuilder optionsBuilder(projectPart);
@@ -184,6 +186,7 @@ public:
optionsBuilder.undefineClangVersionMacrosForMsvc();
optionsBuilder.undefineCppLanguageFeatureMacrosForMsvc2015();
optionsBuilder.addHeaderPathOptions();
optionsBuilder.addPrecompiledHeaderOptions(pchUsage);
optionsBuilder.addMsvcCompatibilityVersion();
if (type != ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID)
@@ -243,10 +246,17 @@ private:
QString includeOption() const override
{
if (m_isMsvcToolchain)
return QLatin1String("/I");
return QLatin1String("/FI");
return CompilerOptionsBuilder::includeOption();
}
QString includeDirOption() const override
{
if (m_isMsvcToolchain)
return QLatin1String("/I");
return CompilerOptionsBuilder::includeDirOption();
}
QString defineOption() const override
{
if (m_isMsvcToolchain)
@@ -376,8 +386,9 @@ static AnalyzeUnits unitsToAnalyzeFromProjectParts(const QList<ProjectPart::Ptr>
continue;
QTC_CHECK(file.kind != ProjectFile::Unclassified);
if (ProjectFile::isSource(file.kind)) {
const CompilerOptionsBuilder::PchUsage pchUsage = CppTools::getPchUsage();
const QStringList arguments
= ClangStaticAnalyzerOptionsBuilder::build(*projectPart.data(), file.kind);
= ClangStaticAnalyzerOptionsBuilder::build(*projectPart.data(), file.kind, pchUsage);
unitsToAnalyze << AnalyzeUnit(file.path, arguments);
}
}

View File

@@ -58,12 +58,12 @@ public:
bool isSupportedVersion() const
{
return majorNumber == 3 && minorNumber == 8;
return majorNumber == 3 && minorNumber == 9;
}
static QString supportedVersionAsString()
{
return QLatin1String("3.8");
return QLatin1String("3.9");
}
QString toString() const

View File

@@ -163,6 +163,8 @@ ActionManager::ActionManager(QObject *parent)
{
m_instance = this;
d = new ActionManagerPrivate;
if (Utils::HostOsInfo::isMacHost())
QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
}
/*!

View File

@@ -306,8 +306,6 @@ static QString msgActionWarning(QAction *newAction, Id id, QAction *oldAction)
void Action::addOverrideAction(QAction *action, const Context &context, bool scriptable)
{
if (Utils::HostOsInfo::isMacHost())
action->setIconVisibleInMenu(false);
// disallow TextHeuristic menu role, because it doesn't work with translations,
// e.g. QTCREATORBUG-13101
if (action->menuRole() == QAction::TextHeuristicRole)

View File

@@ -159,12 +159,6 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
d->m_forwardButton->setDefaultAction(d->m_goForwardAction);
if (Utils::HostOsInfo::isMacHost()) {
d->m_horizontalSplitAction->setIconVisibleInMenu(false);
d->m_verticalSplitAction->setIconVisibleInMenu(false);
d->m_splitNewWindowAction->setIconVisibleInMenu(false);
}
d->m_splitButton->setIcon(Utils::Icons::SPLIT_HORIZONTAL_TOOLBAR.icon());
d->m_splitButton->setToolTip(tr("Split"));
d->m_splitButton->setPopupMode(QToolButton::InstantPopup);

View File

@@ -4817,7 +4817,7 @@ void MoveFuncDefOutside::match(const CppQuickFixInterface &interface, QuickFixOp
}
}
if (!funcAST)
if (!funcAST || !funcAST->symbol)
return;
bool isHeaderFile = false;

View File

@@ -112,7 +112,7 @@ void CompilerOptionsBuilder::enableExceptions()
void CompilerOptionsBuilder::addHeaderPathOptions()
{
typedef ProjectPartHeaderPath HeaderPath;
const QString defaultPrefix = includeOption();
const QString defaultPrefix = includeDirOption();
QStringList result;
@@ -141,6 +141,24 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
m_options.append(result);
}
void CompilerOptionsBuilder::addPrecompiledHeaderOptions(PchUsage pchUsage)
{
if (pchUsage == PchUsage::None)
return;
QStringList result;
const QString includeOptionString = includeOption();
foreach (const QString &pchFile, m_projectPart.precompiledHeaders) {
if (QFile::exists(pchFile)) {
result += includeOptionString;
result += QDir::toNativeSeparators(pchFile);
}
}
m_options.append(result);
}
void CompilerOptionsBuilder::addToolchainAndProjectDefines()
{
addDefines(m_projectPart.toolchainDefines);
@@ -376,7 +394,7 @@ void CompilerOptionsBuilder::addDefineFloat128ForMingw()
addDefine("#define __float128 void");
}
QString CompilerOptionsBuilder::includeOption() const
QString CompilerOptionsBuilder::includeDirOption() const
{
return QLatin1String("-I");
}
@@ -399,6 +417,11 @@ QString CompilerOptionsBuilder::undefineOption() const
return QLatin1String("-U");
}
QString CompilerOptionsBuilder::includeOption() const
{
return QLatin1String("-include");
}
static bool isGccOrMinGwToolchain(const Core::Id &toolchainType)
{
return toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID

View File

@@ -34,6 +34,11 @@ namespace CppTools {
class CPPTOOLS_EXPORT CompilerOptionsBuilder
{
public:
enum class PchUsage {
None,
Use
};
CompilerOptionsBuilder(const ProjectPart &projectPart);
virtual ~CompilerOptionsBuilder() {}
@@ -48,6 +53,7 @@ public:
virtual void addTargetTriple();
virtual void enableExceptions();
void addHeaderPathOptions();
void addPrecompiledHeaderOptions(PchUsage pchUsage);
void addToolchainAndProjectDefines();
void addDefines(const QByteArray &defineDirectives);
virtual void addLanguageOption(ProjectFile::Kind fileKind);
@@ -67,6 +73,7 @@ protected:
virtual QString defineOption() const;
virtual QString undefineOption() const;
virtual QString includeOption() const;
virtual QString includeDirOption() const;
const ProjectPart m_projectPart;

View File

@@ -346,9 +346,9 @@ void CheckSymbols::run()
_usages << QVector<Result>::fromList(_macroUses);
flush();
}
}
emit codeWarningsUpdated(_doc, _diagMsgs);
emit codeWarningsUpdated(_doc, _diagMsgs);
}
reportFinished();
}

View File

@@ -288,4 +288,12 @@ bool fileSizeExceedsLimit(const QFileInfo &fileInfo, int sizeLimitInMb)
return false;
}
CompilerOptionsBuilder::PchUsage getPchUsage()
{
const QSharedPointer<CppCodeModelSettings> cms = codeModelSettings();
if (cms->pchUsage() == CppCodeModelSettings::PchUse_None)
return CompilerOptionsBuilder::PchUsage::None;
return CompilerOptionsBuilder::PchUsage::Use;
}
} // CppTools

View File

@@ -29,6 +29,8 @@
#include <texteditor/texteditor.h>
#include <cpptools/compileroptionsbuilder.h>
#include <cplusplus/CppDocument.h>
QT_BEGIN_NAMESPACE
@@ -72,6 +74,8 @@ void CPPTOOLS_EXPORT switchHeaderSource();
class CppCodeModelSettings;
QSharedPointer<CppCodeModelSettings> CPPTOOLS_EXPORT codeModelSettings();
CompilerOptionsBuilder::PchUsage CPPTOOLS_EXPORT getPchUsage();
int indexerFileSizeLimitInMb();
bool fileSizeExceedsLimit(const QFileInfo &fileInfo, int sizeLimitInMb);

View File

@@ -107,7 +107,7 @@ DebuggerKitChooser::DebuggerKitChooser(Mode mode, QWidget *parent)
{
setKitMatcher([this](const Kit *k) {
// Match valid debuggers and restrict local debugging to compatible toolchains.
if (!DebuggerKitInformation::isValidDebugger(k))
if (DebuggerKitInformation::configurationErrors(k))
return false;
if (m_mode == LocalDebugging)
return ToolChainKitInformation::targetAbi(k).os() == m_hostAbi.os();
@@ -223,7 +223,7 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent)
d->kitChooser = new KitChooser(this);
d->kitChooser->setKitMatcher([this](const Kit *k) {
return DebuggerKitInformation::isValidDebugger(k);
return !DebuggerKitInformation::configurationErrors(k);
});
d->kitChooser->populate();

View File

@@ -191,15 +191,7 @@ void DebuggerKitInformation::fix(Kit *k)
// Check the configuration errors and return a flag mask. Provide a quick check and
// a verbose one with a list of errors.
enum DebuggerConfigurationErrors {
NoDebugger = 0x1,
DebuggerNotFound = 0x2,
DebuggerNotExecutable = 0x4,
DebuggerNeedsAbsolutePath = 0x8,
DebuggerDoesNotMatch = 0x10
};
static unsigned debuggerConfigurationErrors(const Kit *k)
DebuggerKitInformation::ConfigurationErrors DebuggerKitInformation::configurationErrors(const Kit *k)
{
QTC_ASSERT(k, return NoDebugger);
@@ -210,7 +202,7 @@ static unsigned debuggerConfigurationErrors(const Kit *k)
if (item->command().isEmpty())
return NoDebugger;
unsigned result = 0;
ConfigurationErrors result = NoConfigurationError;
const QFileInfo fi = item->command().toFileInfo();
if (!fi.exists() || fi.isDir())
result |= DebuggerNotFound;
@@ -257,17 +249,12 @@ StandardRunnable DebuggerKitInformation::runnable(const Kit *kit)
return runnable;
}
bool DebuggerKitInformation::isValidDebugger(const Kit *k)
{
return debuggerConfigurationErrors(k) == 0;
}
QList<Task> DebuggerKitInformation::validateDebugger(const Kit *k)
{
QList<Task> result;
const unsigned errors = debuggerConfigurationErrors(k);
if (!errors)
const ConfigurationErrors errors = configurationErrors(k);
if (errors == NoConfigurationError)
return result;
QString path;

View File

@@ -52,8 +52,19 @@ public:
static const DebuggerItem *debugger(const ProjectExplorer::Kit *kit);
static ProjectExplorer::StandardRunnable runnable(const ProjectExplorer::Kit *kit);
enum ConfigurationError
{
NoConfigurationError = 0x0,
NoDebugger = 0x1,
DebuggerNotFound = 0x2,
DebuggerNotExecutable = 0x4,
DebuggerNeedsAbsolutePath = 0x8,
DebuggerDoesNotMatch = 0x10
};
Q_DECLARE_FLAGS(ConfigurationErrors, ConfigurationError)
static QList<ProjectExplorer::Task> validateDebugger(const ProjectExplorer::Kit *k);
static bool isValidDebugger(const ProjectExplorer::Kit *k);
static ConfigurationErrors configurationErrors(const ProjectExplorer::Kit *k);
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const override;
void addToMacroExpander(ProjectExplorer::Kit *kit, Utils::MacroExpander *expander) const override;

View File

@@ -583,7 +583,7 @@ static std::function<bool(const Kit *)> cdbMatcher(char wordWidth = 0)
{
return [wordWidth](const Kit *k) -> bool {
if (DebuggerKitInformation::engineType(k) != CdbEngineType
|| !DebuggerKitInformation::isValidDebugger(k)) {
|| DebuggerKitInformation::configurationErrors(k)) {
return false;
}
if (wordWidth)
@@ -1125,13 +1125,13 @@ static Kit *guessKitFromParameters(const DebuggerRunParameters &rp)
// Try exact abis.
kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
const Abi tcAbi = ToolChainKitInformation::targetAbi(k);
return abis.contains(tcAbi) && DebuggerKitInformation::isValidDebugger(k);
return abis.contains(tcAbi) && !DebuggerKitInformation::configurationErrors(k);
}));
if (!kit) {
// Or something compatible.
kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
const Abi tcAbi = ToolChainKitInformation::targetAbi(k);
return DebuggerKitInformation::isValidDebugger(k)
return !DebuggerKitInformation::configurationErrors(k)
&& Utils::contains(abis, [tcAbi](const Abi &a) { return a.isCompatibleWith(tcAbi); });
}));
}

View File

@@ -692,13 +692,6 @@ bool DebuggerToolTipContext::isSame(const DebuggerToolTipContext &other) const
&& filesMatch(fileName, other.fileName);
}
void DebuggerToolTipContext::appendFormatRequest(DebuggerCommand *cmd) const
{
cmd->arg("expression", expression);
cmd->arg("fileName", fileName);
cmd->arg("iname", iname);
}
QString DebuggerToolTipContext::toolTip() const
{
return DebuggerToolTipManager::tr("Expression %1 in function %2 from line %3 to %4")

View File

@@ -49,7 +49,6 @@ public:
bool isValid() const { return !expression.isEmpty(); }
bool matchesFrame(const StackFrame &frame) const;
bool isSame(const DebuggerToolTipContext &other) const;
void appendFormatRequest(DebuggerCommand *cmd) const;
QString toolTip() const;
QString fileName;

View File

@@ -1687,9 +1687,6 @@ void GdbEngine::handleShowVersion(const DebuggerResponse &response)
else
runCommand({"set target-async off", ConsoleCommand});
if (runParameters().multiProcess)
runCommand({"set detach-on-fork off", ConsoleCommand});
//runCommand("set build-id-verbose 2", ConsoleCommand);
}
}
@@ -4047,7 +4044,7 @@ void GdbEngine::startGdb(const QStringList &args)
runCommand({"set auto-solib-add on", ConsoleCommand});
}
if (boolSetting(MultiInferior)) {
if (boolSetting(MultiInferior) || runParameters().multiProcess) {
//runCommand("set follow-exec-mode new");
runCommand({"set detach-on-fork off"});
}

View File

@@ -39,7 +39,7 @@ class Project;
class Target;
// Documentation inside.
class PROJECTEXPLORER_EXPORT ProjectImporter
class PROJECTEXPLORER_EXPORT ProjectImporter : public QObject
{
public:
ProjectImporter(const Utils::FileName &path);

View File

@@ -518,6 +518,9 @@ public:
ProjectWindow::ProjectWindow()
{
setBackgroundRole(QPalette::Base);
// Request custom context menu but do not provide any to avoid
// the creation of the dock window selection menu.
setContextMenuPolicy(Qt::CustomContextMenu);
auto selectorModel = new SelectorModel(this, [this](QWidget *panel) { setPanel(panel); });
@@ -553,15 +556,6 @@ ProjectWindow::ProjectWindow()
auto selectorDock = addDockForWidget(selectorView, true);
addDockWidget(Qt::LeftDockWidgetArea, selectorDock);
connect(this, &QWidget::customContextMenuRequested,
selectorModel, &SelectorModel::openContextMenu);
}
void ProjectWindow::contextMenuEvent(QContextMenuEvent *event)
{
Q_UNUSED(event)
// Do nothing to avoid creation of the dock window selection menu.
}
void ProjectWindow::setPanel(QWidget *panel)

View File

@@ -56,7 +56,6 @@ public:
ProjectWindow();
private:
void contextMenuEvent(QContextMenuEvent *event) override;
void setPanel(QWidget *panel);
};

View File

@@ -32,6 +32,7 @@
#include <utils/wizardpage.h>
#include <QPointer>
#include <QString>
#include <QMap>
@@ -109,7 +110,7 @@ private:
KitMatcher m_requiredMatcher;
KitMatcher m_preferredMatcher;
ProjectImporter *m_importer = nullptr;
QPointer<ProjectImporter> m_importer = nullptr;
QLayout *m_baseLayout = nullptr;
QString m_projectPath;
QString m_defaultShadowBuildLocation;

View File

@@ -666,20 +666,24 @@ static bool isInLayoutable(NodeAbstractProperty &parentProperty)
static void reparentModelNodeToNodeProperty(NodeAbstractProperty &parentProperty, const ModelNode &modelNode)
{
if (!modelNode.hasParentProperty() || parentProperty != modelNode.parentProperty()) {
if (isInLayoutable(parentProperty)) {
removePosition(modelNode);
parentProperty.reparentHere(modelNode);
} else {
if (QmlItemNode::isValidQmlItemNode(modelNode)) {
QPointF scenePosition = QmlItemNode(modelNode).instanceScenePosition();
try {
if (!modelNode.hasParentProperty() || parentProperty != modelNode.parentProperty()) {
if (isInLayoutable(parentProperty)) {
removePosition(modelNode);
parentProperty.reparentHere(modelNode);
if (!scenePosition.isNull())
setScenePosition(modelNode, scenePosition);
} else {
parentProperty.reparentHere(modelNode);
if (QmlItemNode::isValidQmlItemNode(modelNode)) {
QPointF scenePosition = QmlItemNode(modelNode).instanceScenePosition();
parentProperty.reparentHere(modelNode);
if (!scenePosition.isNull())
setScenePosition(modelNode, scenePosition);
} else {
parentProperty.reparentHere(modelNode);
}
}
}
} catch (const RewritingException &exception) { //better safe than sorry! There always might be cases where we fail
exception.showException();
}
}

View File

@@ -52,6 +52,7 @@
#include <QDir>
#include <QQmlPropertyMap>
#include <QQuickImageProvider>
#include <QTimer>
#include <QtQuickWidgets/QQuickWidget>
#include <QtQml/QQmlContext>
@@ -135,6 +136,8 @@ public:
QStringList recentProjectsShortcuts() const { return m_recentProjectsShortcuts; }
QStringList sessionsShortcuts() const { return m_sessionsShortcuts; }
Q_INVOKABLE bool openDroppedFiles(const QList<QUrl> &urls);
public slots:
void setActivePlugin(int pos)
{
@@ -307,6 +310,18 @@ void WelcomeMode::initPlugins()
m_welcomePage->setSource(QUrl::fromLocalFile(path));
}
bool WelcomeMode::openDroppedFiles(const QList<QUrl> &urls)
{
const QList<QUrl> localUrls = Utils::filtered(urls, &QUrl::isLocalFile);
if (!localUrls.isEmpty()) {
QTimer::singleShot(0, [localUrls]() {
ICore::openFiles(Utils::transform(localUrls, &QUrl::toLocalFile), ICore::SwitchMode);
});
return true;
}
return false;
}
void WelcomeMode::welcomePluginAdded(QObject *obj)
{
IWelcomePage *page = qobject_cast<IWelcomePage*>(obj);

View File

@@ -2,7 +2,6 @@
\"Name\" : \"WinRt\",
\"Version\" : \"$$QTCREATOR_VERSION\",
\"CompatVersion\" : \"$$QTCREATOR_COMPAT_VERSION\",
\"Experimental\" : true,
\"Platform\" : \"Windows (8.1|10)\",
\"Vendor\" : \"The Qt Company Ltd\",
\"Copyright\" : \"(C) 2016 The Qt Company Ltd\",

View File

@@ -97,8 +97,8 @@ LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS
contains(QMAKE_DEFAULT_INCDIRS, $$LLVM_INCLUDEPATH): LLVM_INCLUDEPATH =
isEmpty(LLVM_VERSION): error("Cannot determine clang version at $$LLVM_INSTALL_DIR")
!versionIsAtLeast($$LLVM_VERSION, 3, 8, 0): {
error("LLVM/Clang version >= 3.8.0 required, version provided: $$LLVM_VERSION")
!versionIsAtLeast($$LLVM_VERSION, 3, 9, 0): {
error("LLVM/Clang version >= 3.9.0 required, version provided: $$LLVM_VERSION")
}
unix:LLVM_CXXFLAGS = -fno-rtti -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

View File

@@ -35,7 +35,7 @@ namespace ClangBackEnd {
using USRName = llvm::SmallVector<char, 128>;
// use std::filesystem::path if it is supported by all compilers
#ifdef WIN32
#ifdef _WIN32
const char nativeSeperator = '\\';
#else
const char nativeSeperator = '/';

View File

@@ -33,7 +33,7 @@ namespace {
std::string toNativePath(std::string &&path)
{
#ifdef WIN32
#ifdef _WIN32
std::replace(path.begin(), path.end(), '/', '\\');
#endif

View File

@@ -61,7 +61,7 @@ Utils::SmallString fromNativePath(Container container)
{
Utils::SmallString path(container.data(), container.size());
#ifdef WIN32
#ifdef _WIN32
std::replace(path.begin(), path.end(), '\\', '/');
#endif

View File

@@ -587,6 +587,7 @@ struct Profile
{
Profile(const QByteArray &contents) : contents(contents) {}
QByteArray includes;
QByteArray contents;
};
@@ -609,6 +610,7 @@ struct BoostProfile : public Profile
contents = QByteArray("INCLUDEPATH += ") + boostIncPath.constData();
else
contents = "macx:INCLUDEPATH += /usr/local/include";
includes = "#include <boost/version.hpp>\n";
}
};
@@ -668,6 +670,7 @@ public:
const Data &operator+(const Profile &profile) const
{
profileExtra += profile.contents;
includes += profile.includes;
return *this;
}
@@ -2752,6 +2755,7 @@ void tst_Dumpers::dumper_data()
"int pos1 = re.indexIn(str1); unused(&pos1);\n"
"int pos2 = re.indexIn(str2); unused(&pos2);\n")
+ CoreProfile()
+ UseDebugImage()
+ Check("re", "\"a(.*)b(.*)c\"", "@QRegExp")
+ Check("re.captures.0", "[0]", "\"a1121b344c\"", "@QString")
+ Check("re.captures.1", "[1]", "\"1121\"", "@QString")
@@ -2931,6 +2935,31 @@ void tst_Dumpers::dumper_data()
" QSharedDataPointer<EmployeeData> d;\n"
" };\n";
QTest::newRow("QAtomicPointer")
<< Data("#include <QAtomicPointer>\n"
"#include <QStringList>\n\n"
"template <class T> struct Pointer : QAtomicPointer<T> {\n"
" Pointer(T *value = 0) : QAtomicPointer<T>(value) {}\n"
"};\n\n"
"struct SomeStruct {\n"
" int a = 1;\n"
" long b = 2;\n"
" double c = 3.0;\n"
" QString d = \"4\";\n"
" QList<QString> e = {\"5\", \"6\" };\n"
"};\n\n"
"typedef Pointer<SomeStruct> SomeStructPointer;\n\n",
"SomeStruct *s = new SomeStruct; unused(s);\n"
"SomeStructPointer p(s); unused(p);\n"
"Pointer<SomeStruct> pp(s); unused(pp);\n"
"QAtomicPointer<SomeStruct> ppp(s); unused(ppp);\n")
+ Cxx11Profile()
+ Check("p.@1.a", "1", "int")
+ Check("p.@1.e", "<2 items>", "@QList<@QString>")
+ Check("pp.@1.a", "1", "int")
+ Check("ppp.a", "1", "int");
QTest::newRow("QScopedPointer")
<< Data("#include <QScopedPointer>\n"
@@ -5982,19 +6011,20 @@ void tst_Dumpers::dumper_data()
+ Check("tt.@2.@1.v", "45", "int") % LldbEngine
+ Check("dd.@1.@1.a", "1", "int") // B::a
+ Check("dd.@2.@1.a", "1", "int") // C::a
// C::a - fails with command line LLDB 3.8/360.x
+ Check("dd.@2.@1.a", "1", "int") % NoLldbEngine // C::a
+ Check("dd.@1.b", "2", "int")
+ Check("dd.@2.c", "3", "int")
+ Check("dd.d", "4", "int")
+ Check("dp.@1.@1.a", "1", "int") // B::a
+ Check("dp.@2.@1.a", "1", "int") // C::a
+ Check("dp.@2.@1.a", "1", "int") % NoLldbEngine // C::a
+ Check("dp.@1.b", "2", "int")
+ Check("dp.@2.c", "3", "int")
+ Check("dp.d", "4", "int")
+ Check("dr.@1.@1.a", "1", "int") // B::a
+ Check("dr.@2.@1.a", "1", "int") // C::a
+ Check("dr.@2.@1.a", "1", "int") % NoLldbEngine // C::a
+ Check("dr.@1.b", "2", "int")
+ Check("dr.@2.c", "3", "int")
+ Check("dr.d", "4", "int");

View File

@@ -214,7 +214,7 @@ void tst_MapReduce::map()
QCOMPARE(container, QList<int>({4, 10, 2}));
Utils::map(container.begin(), container.end(), [](int &x) { x *= 2; },
Utils::MapReduceOption::Unordered, 3).waitForFinished();
Utils::MapReduceOption::Unordered, QThread::InheritPriority, 3).waitForFinished();
QCOMPARE(container, QList<int>({8, 20, 4}));
}

View File

@@ -28,7 +28,7 @@
#include <string>
// use std::filesystem::path if it is supported by all compilers
#ifdef WIN32
#ifdef _WIN32
const char nativeSeperator = '\\';
#else
const char nativeSeperator = '/';
@@ -37,7 +37,7 @@ const char nativeSeperator = '/';
inline
std::string toNativePath(std::string &&path)
{
#ifdef WIN32
#ifdef _WIN32
std::replace(path.begin(), path.end(), '/', '\\');
#endif