diff --git a/README.md b/README.md index ef348fb758b..ad73f244a13 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/doc/src/editors/creator-clang-codemodel.qdoc b/doc/src/editors/creator-clang-codemodel.qdoc index dbf90235c55..52b506ecf3d 100644 --- a/doc/src/editors/creator-clang-codemodel.qdoc +++ b/doc/src/editors/creator-clang-codemodel.qdoc @@ -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 diff --git a/qbs/modules/libclang/functions.js b/qbs/modules/libclang/functions.js index 49f2512423d..5ad07af8fa6 100644 --- a/qbs/modules/libclang/functions.js +++ b/qbs/modules/libclang/functions.js @@ -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 diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index b637eef4100..259cad968a7 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -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 diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index 9877c54c290..3612dcdb4fb 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -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 '' diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 51b9ce1babd..5f257fb324d 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -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) diff --git a/share/qtcreator/debugger/misctypes.py b/share/qtcreator/debugger/misctypes.py index e15844dc379..0abab3713a8 100644 --- a/share/qtcreator/debugger/misctypes.py +++ b/share/qtcreator/debugger/misctypes.py @@ -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(): diff --git a/share/qtcreator/debugger/qttypes.py b/share/qtcreator/debugger/qttypes.py index 57a7ed57d07..65f4e1fbdd9 100644 --- a/share/qtcreator/debugger/qttypes.py +++ b/share/qtcreator/debugger/qttypes.py @@ -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. diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index 77fc8812bb7..5fa4522cfe5 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -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): diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index bf3b181a28f..5e8f7d3e11f 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -124,7 +124,7 @@ TextColorHighlight=ffff0000 TextColorLink=textColorLink TextColorLinkVisited=textColorLinkVisited TextColorNormal=text -TodoItemTextColor=text +TodoItemTextColor=ff000000 ToggleButtonBackgroundColor=shadowBackground ToolBarBackgroundColor=shadowBackground TreeViewArrowColorNormal=hoverBackground diff --git a/share/qtcreator/themes/flat-light.creatortheme b/share/qtcreator/themes/flat-light.creatortheme index ae978557363..18746658a13 100644 --- a/share/qtcreator/themes/flat-light.creatortheme +++ b/share/qtcreator/themes/flat-light.creatortheme @@ -122,7 +122,7 @@ TextColorHighlight=ffff0000 TextColorLink=ff007af4 TextColorLinkVisited=ffa57aff TextColorNormal=text -TodoItemTextColor=text +TodoItemTextColor=ff000000 ToggleButtonBackgroundColor=shadowBackground ToolBarBackgroundColor=shadowBackground TreeViewArrowColorNormal=hoverBackground diff --git a/share/qtcreator/themes/flat.creatortheme b/share/qtcreator/themes/flat.creatortheme index a4790bbbcc4..472353a6ac7 100644 --- a/share/qtcreator/themes/flat.creatortheme +++ b/share/qtcreator/themes/flat.creatortheme @@ -120,7 +120,7 @@ TextColorHighlight=ffff0000 TextColorLink=ff007af4 TextColorLinkVisited=ffa57aff TextColorNormal=text -TodoItemTextColor=text +TodoItemTextColor=ff000000 ToggleButtonBackgroundColor=shadowBackground ToolBarBackgroundColor=shadowBackground TreeViewArrowColorNormal=hoverBackground diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 9c618509070..7ada6cbbc78 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -1,177 +1,6 @@ - - - - Zoom In - Увеличить - - - Zoom In (Ctrl + + / Ctrl + Wheel) - Увеличить (Ctrl++ / Ctrl+Колёсико) - - - Zoom Out - Уменьшить - - - Zoom Out (Ctrl + - / Ctrl + Wheel) - Уменьшить (Ctrl+- / Ctrl+Колёсико) - - - Fit to View - Растянуть на окно - - - Fit to View (F11) - Растянуть на окно (F11) - - - Panning - Панорамирование - - - Panning (Shift) - Панорамирование (Shift) - - - Magnifier - Лупа - - - Magnifier Tool (Alt) - Лупа (Alt) - - - Navigator - Навигатор - - - Navigator (Ctrl+E) - Навигатор (Ctrl+E) - - - Copy - Копировать - - - Copy (Ctrl + C) - Копировать (Ctrl+C) - - - Cut - Вырезать - - - Cut (Ctrl + X) - Вырезать (Ctrl+X) - - - Paste - Вставить - - - Paste (Ctrl + V) - Вставить (Ctrl+V) - - - Screenshot - Снимок экрана - - - Screenshot (Ctrl + Shift + C) - Снимок экрана (Ctrl+Shift+C) - - - Export to Image - В изображение - - - Toggle Full Namespace - Переключить пространство имён - - - Align Left - По левому краю - - - Align Left (Ctrl+L,1) - По левому краю (Ctrl + L,1) - - - Align Right - По правому краю - - - Align Right (Ctrl+L,2) - По правому краю (Ctrl+L,2) - - - Align Top - По верху - - - Align Top (Ctrl+L,3) - По верху (Ctrl+L,3) - - - Align Bottom - По низу - - - Align Bottom (Ctrl+L,4) - По низу (Ctrl+L,4) - - - Align Horizontal - Выравнить гоизонтально - - - Align Horizontal (Ctrl+L,5) - Выравнить гоизонтально (Ctrl+L,5) - - - Align Vertical - Выравнить вертикально - - - Align Vertical (Ctrl+L,6) - Выравнить гоизонтально (Ctrl+L,6) - - - Adjust Width - Подогнать ширину - - - Adjust Width (Ctrl+L,7) - Подогнать ширину (Ctrl+L,7) - - - Adjust Height - Подогнать высоту - - - Adjust Height (Ctrl+L,8) - Подогнать высоту (Ctrl+L,8) - - - Adjust Size - Подогнать размер - - - Adjust Size (Ctrl+L,9) - Подогнать размер (Ctrl+L,9) - - - Show Statistics... - Показать статистику... - - - Show Statistics - Показать статистику - - AddSignalHandlerDialog @@ -4129,7 +3958,7 @@ For example, "Revision: 15" will leave the branch at revision 15.Генератор CMake не создаёт файл CodeBlocks. Qt Creator не сможет обрабатывать проект CMake. - Generator: %1<br>Extra Generator: %2 + Generator: %1<br>Extra generator: %2 Генератор: %1<br>Дополнительный генератор: %2 @@ -4259,8 +4088,8 @@ For example, "Revision: 15" will leave the branch at revision 15.Настройка «%1» - *** cmake process crashed! - *** процесс cmake аварийно завершился! + *** cmake process crashed. + *** процесс cmake аварийно завершился. *** cmake process exited with exit code %1. @@ -4454,7 +4283,7 @@ For example, "Revision: 15" will leave the branch at revision 15.Изменить... - CMake Generator: + CMake generator: Генератор CMake: @@ -4474,7 +4303,7 @@ For example, "Revision: 15" will leave the branch at revision 15.Генератор: - Extra Generator: + Extra generator: Дополнительный генератор: @@ -8626,6 +8455,10 @@ Do you want to kill it? Core::Internal::ThemeChooser + + Current theme: %1 + Текущая тема: %1 + Restart Required Требуется перезапуск @@ -11099,10 +10932,6 @@ Flags: %3 Pat&h: Пут&ь: - - <p>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). - <p>Указание модуля (имени библиотеки или программы) для точек останова на функциях или исходниках может значительно повысить скорость запуска отладчика (CDB, LLDB). - &Module: &Модуль: @@ -11159,14 +10988,6 @@ Flags: %3 Edit Selected Breakpoints... Изменить выбранные точки останова... - - Associate Breakpoint With All Threads - Сопоставить точку останова со всеми потоками - - - Associate Breakpoint With Thread %1 - Сопоставить точку останова с потоком %1 - Disable Selected Breakpoints Деактивировать выбранные точки останова @@ -11319,6 +11140,14 @@ Flags: %3 Function Name: Имя функции: + + Associate Breakpoint with All Threads + Сопоставить точку останова со всеми потоками + + + Associate Breakpoint with Thread %1 + Сопоставить точку останова с потоком %1 + Line Number: Номер строки: @@ -11359,6 +11188,10 @@ Flags: %3 Breakpoint on QML Signal Emit Точка остановка на инициировании сигнала QML + + <p>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). + <p>Указание модуля (имени библиотеки или программы) для точек останова на функциях или исходниках может значительно повысить скорость запуска отладчика (CDB, LLDB). + Function Функция @@ -11623,17 +11456,6 @@ Flags: %3 Debugger::Internal::CommonOptionsPage - - Stop when %1() is called - Остановиться на вызове %1() - - - Always adds a breakpoint on the <i>%1()</i> function. - Всегда устанавливать точку останова на функцию <i>%1()</i>. - - - - Debugger::Internal::CommonOptionsPageWidget Behavior Поведение @@ -11642,6 +11464,10 @@ Flags: %3 Use alternating row colors in debug views Чередование цвета строк в представлении отладчика + + Changes the font size in the debugger views when the font size in the main editor changes. + Менять размер шрифта в окне отладчика при изменении его в основном окне редактора. + Debugger font size follows main editor Размер шрифта отладчика соответствует редактору @@ -11650,34 +11476,6 @@ Flags: %3 Use tooltips in main editor while debugging Использовать подсказки в основном редакторе при отладке - - Changes the font size in the debugger views when the font size in the main editor changes. - Менять размер шрифта в окне отладчика при изменении его в основном окне редактора. - - - Switch to previous mode on debugger exit - Переключаться в предыдущий режим при завершении отладчика - - - Bring Qt Creator to foreground when application interrupts - Переходить в окно Qt Creator при прерывании приложения - - - Enables a full file path in breakpoints by default also for GDB. - Включение полного пути к исходным файлам для точек останова так же для GDB. - - - Registers Qt Creator for debugging crashed applications. - Зарегистрировать Qt Creator для отладки приложений, завершённых аварийно. - - - Shows a warning when starting the debugger on a binary with insufficient debug information. - Показывать предупреждение при запуске отладчика на программе без отладочной информации. - - - Show QML object tree - Показывать дерево объектов QML - Stopping and stepping in the debugger will automatically open views associated with the current location. Остановка и пошаговая отладка автоматически открывают обзор кода соответствующий текущему положению. @@ -11698,14 +11496,34 @@ Flags: %3 Select this option to close automatically opened memory views when the debugger exits. Включение закрытия автоматически открытых обзоров памяти при завершении отладки. + + Switch to previous mode on debugger exit + Переключаться в предыдущий режим при завершении отладчика + + + Bring Qt Creator to foreground when application interrupts + Переходить в окно Qt Creator при прерывании приложения + Shows QML object tree in Locals and Expressions when connected and not stepping. Показывать дерево объектов QML в окне «Переменные и выражения» при подключении, но не при пошаговой отладке. + + Show QML object tree + Показывать дерево объектов QML + + + Enables a full file path in breakpoints by default also for GDB. + Включение по умолчанию полного пути к исходным файлам для точек останова также и для GDB. + Set breakpoints using a full absolute path Задавать полный путь к точкам останова + + Registers Qt Creator for debugging crashed applications. + Зарегистрировать Qt Creator для отладки приложений, завершённых аварийно. + Use Qt Creator for post-mortem debugging Назначить Qt Creator системным отладчиком @@ -11714,6 +11532,10 @@ Flags: %3 Warn when debugging "Release" builds Предупреждать при отладке «выпускаемых» сборок + + Shows a warning when starting the debugger on a binary with insufficient debug information. + Показывать предупреждение при запуске отладчика на программе без отладочной информации. + Keep editor stationary when stepping Сохранять позицию редактора при пошаговой отладке @@ -11730,6 +11552,14 @@ Flags: %3 <unlimited> <бесконечна> + + Stop when %1() is called + Остановиться на вызове %1() + + + Always adds a breakpoint on the <i>%1()</i> function. + Всегда устанавливать точку останова на функцию <i>%1()</i>. + Debugger::Internal::Console @@ -13939,7 +13769,7 @@ Do you want to retry? Шестнадцатеричный - DecimalFormat + Decimal Десятичный @@ -14674,6 +14504,18 @@ Do you want to retry? Automatic Автоматический + + Note: Evaluators will be re-evaluated after each step. For details, see the <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">documentation</a>. + Замечание: выражения вычисляются после каждого шага. Подробнее читайте в <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">документации</a>. + + + Stop the program when the data at the address is modified. + Останавливать программу при изменении данных по указанному адресу. + + + Stop the program when the data at the address given by the expression is modified. + Останавливать программу при изменении данных по адресу, заданному выражением. + Raw Data Сырые данные @@ -14760,10 +14602,6 @@ Do you want to retry? Enter an expression to evaluate. Введите выражение для вычисления. - - Note: Evaluators will be re-evaluated after each step. For details check the <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">documentation</a>. - Замечание: выражения вычисляются после каждого шага. Подробнее читайте в <a href="qthelp://org.qt-project.qtcreator/doc/creator-debug-mode.html#locals-and-expressions">документации</a>. - New Evaluated Expression Новое вычисляемое выражение @@ -14808,10 +14646,6 @@ Do you want to retry? Add Data Breakpoint at Object's Address (0x%1) Добавить контрольную точку на адрес объекта (0x%1) - - Setting a data breakpoint on an address will cause the program to stop when the data at the address is modified. - Установка контрольной точки на адрес приведёт к остановке программы при изменении данных по этому адресу. - Add Data Breakpoint at Pointer's Address (0x%1) Добавить контрольную точку по адресу указателя (0x%1) @@ -14828,10 +14662,6 @@ Do you want to retry? Add Data Breakpoint at Expression Добавить контрольную точку на вычисляемый адрес - - 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. - Установка контрольной точки на адрес приведёт к остановке программы при изменении данных по этому адресу. - Open Memory Editor Открыть редактор памяти @@ -17541,6 +17371,10 @@ Would you like to terminate it? copied скопирован + + typechange + смена типа + by both обоими @@ -20352,38 +20186,6 @@ Ids must begin with a lowercase letter. Simulator application process error %1 Приложение из эмулятора вернуло ошибку %1 - - Application install on Simulator failed. %1 - Не удалось установить приложение на эмулятор. %1 - - - Application install on Simulator failed. Simulator not running. - Не удалось установить приложение на эмулятор. Он не запущен. - - - Application launch on Simulator failed. Invalid Bundle path %1 - Запуск приложения на эмуляторе не удался. Неверный путь пакета %1 - - - Spawning the Application process on Simulator failed. - Не удалось породить процесс приложения на эмуляторе. - - - Application launch on Simulator failed. Simulator not running. - Не удалось запустить приложение на эмуляторе. Он не запущен. - - - Application launch on Simulator failed. %1 - Запуск приложения на эмуляторе не удался. %1 - - - Spawning the Application process on Simulator failed. Spawning timed out. - Не удалось породить процесс приложения на эмуляторе. Время порождения истекло. - - - Simulator application process error %1 - Приложение из эмулятора вернуло ошибку %1 - IosDeployStepWidget @@ -21402,6 +21204,10 @@ Ids must begin with a lowercase letter. Nim source file Исходник Nim + + Nim script file + Файл сценария Nim + Qt Creator Python project file Проект Qt Creator для Python @@ -21422,6 +21228,14 @@ Ids must begin with a lowercase letter. QML file Файл QML + + Linguist compiled translations + Скомпилированные переводы Linguist + + + Linguist source translations + Исходные переводы Linguist + SCXML State Chart Диаграмма состояний SCXML @@ -21502,14 +21316,6 @@ Ids must begin with a lowercase letter. QML Project file Файл проекта QML - - Linguist translated messages (machine-readable) - Сообщения переведенные через Linguist (удобные для машины) - - - Linguist message catalog - Каталог сообщений Linguist - Qt Resource file Файл ресурсов Qt @@ -24524,11 +24330,11 @@ cannot be found in the path. Имя в файловой системе: - Select a file as icon - Выберите файл значка + Select Icon File + Выбор файла значка - Reset to the device default icon + Reset to Device Default Icon Назначить стандартный для устройства значок @@ -24959,6 +24765,14 @@ to project "%2". Projects Проекты + + Import Existing Build... + Импорт сборки... + + + Manage Kits... + Управление... + Import directory Импортируемый каталог @@ -25111,17 +24925,6 @@ to project "%2". Новое название конфигурации установки <b>%1</b>: - - ProjectExplorer::Internal::SelectorModel - - Import Existing Build... - Импорт сборки... - - - Manage Kits... - Управление... - - ProjectExplorer::Internal::SessionDialog @@ -26182,7 +25985,7 @@ Preselects a desktop Qt for building the application if available. Material - Материальный + Материальный Universal @@ -26316,6 +26119,14 @@ Preselects a desktop Qt for building the application if available. Nim File Файл Nim + + Creates an empty Nim script file using UTF-8 charset. + Создание пустого файла сценария Nim с использованием кодировки UTF-8. + + + Nim Script File + Файл сценария Nim + State Chart Name and Location Название и размещение диаграммы состояний @@ -28653,9 +28464,8 @@ These files are preserved. QbsProjectManager::Internal::QbsProject - Failed! - Очень плохое сообщение, скорее всего не дописали - Ошибка + Failed + Сбой Could not write project file %1. @@ -30203,12 +30013,12 @@ Neither the path to the library nor the path to its includes is added to the .pr Закрытие сетевого соединения - Socket state changed to BoundState. This should not happen! - Состояние сокета изменилось на BoundState. Это не должно было произойти! + Socket state changed to BoundState. This should not happen. + Состояние сокета изменилось на BoundState. Это не должно было произойти. - Socket state changed to ListeningState. This should not happen! - Состояние сокета изменилось на ListeningState. Это не должно было произойти! + Socket state changed to ListeningState. This should not happen. + Состояние сокета изменилось на ListeningState. Это не должно было произойти. Unknown state %1 @@ -31628,7 +31438,7 @@ This is independent of the visibility property in QML. Файл или каталог не найден. - QML module not found(%1). + QML module not found (%1). Import paths: %2 @@ -33474,8 +33284,8 @@ Do you want to retry? Повторить? - Failed to connect! - Не удалось подключиться! + Failed to connect. + Не удалось подключиться. Disable Profiling @@ -36406,6 +36216,177 @@ Description: %4 Описание: %4 + + ScxmlEditor::PluginInterface::ActionHandler + + Zoom In + Увеличить + + + Zoom In (Ctrl + + / Ctrl + Wheel) + Увеличить (Ctrl++ / Ctrl+Колёсико) + + + Zoom Out + Уменьшить + + + Zoom Out (Ctrl + - / Ctrl + Wheel) + Уменьшить (Ctrl+- / Ctrl+Колёсико) + + + Fit to View + Растянуть на окно + + + Fit to View (F11) + Растянуть на окно (F11) + + + Panning + Панорамирование + + + Panning (Shift) + Панорамирование (Shift) + + + Magnifier + Лупа + + + Magnifier Tool (Alt) + Лупа (Alt) + + + Navigator + Навигатор + + + Navigator (Ctrl+E) + Навигатор (Ctrl+E) + + + Copy + Копировать + + + Copy (Ctrl + C) + Копировать (Ctrl+C) + + + Cut + Вырезать + + + Cut (Ctrl + X) + Вырезать (Ctrl+X) + + + Paste + Вставить + + + Paste (Ctrl + V) + Вставить (Ctrl+V) + + + Screenshot + Снимок экрана + + + Screenshot (Ctrl + Shift + C) + Снимок экрана (Ctrl+Shift+C) + + + Export to Image + В изображение + + + Toggle Full Namespace + Переключить пространство имён + + + Align Left + По левому краю + + + Align Left (Ctrl+L,1) + По левому краю (Ctrl + L,1) + + + Align Right + По правому краю + + + Align Right (Ctrl+L,2) + По правому краю (Ctrl+L,2) + + + Align Top + По верху + + + Align Top (Ctrl+L,3) + По верху (Ctrl+L,3) + + + Align Bottom + По низу + + + Align Bottom (Ctrl+L,4) + По низу (Ctrl+L,4) + + + Align Horizontal + Выравнить гоизонтально + + + Align Horizontal (Ctrl+L,5) + Выравнить гоизонтально (Ctrl+L,5) + + + Align Vertical + Выравнить вертикально + + + Align Vertical (Ctrl+L,6) + Выравнить гоизонтально (Ctrl+L,6) + + + Adjust Width + Подогнать ширину + + + Adjust Width (Ctrl+L,7) + Подогнать ширину (Ctrl+L,7) + + + Adjust Height + Подогнать высоту + + + Adjust Height (Ctrl+L,8) + Подогнать высоту (Ctrl+L,8) + + + Adjust Size + Подогнать размер + + + Adjust Size (Ctrl+L,9) + Подогнать размер (Ctrl+L,9) + + + Show Statistics... + Показать статистику... + + + Show Statistics + Показать статистику + + ScxmlEditor::PluginInterface::BaseItem @@ -36981,11 +36962,11 @@ with a password, which you can enter below. StatesDelegate - Set when condition + Set when Condition Задать условие when - Reset when condition + Reset when Condition Сбросить условие when @@ -37589,9 +37570,13 @@ with a password, which you can enter below. Aborting replace. Прерывание замены. - - %1 found - найдено: %1 + + %n found + + %n найден + %n найдено + %n найдено + @@ -43536,6 +43521,10 @@ should a repository require SSH-authentication (see documentation on SSH and the Auto width Автоширина + + <font color=red>Invalid syntax.</font> + <font color=red>Неверный синтаксис.</font> + Box Коробкой @@ -43576,10 +43565,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Boundaries Границы - - <font color=red>Invalid syntax!</font> - <font color=red>Неверный синтаксис!</font> - Multi-Selection Множественное выделение diff --git a/share/qtcreator/welcomescreen/welcomescreen.qml b/share/qtcreator/welcomescreen/welcomescreen.qml index 62f3ccee547..36489f8e13b 100644 --- a/share/qtcreator/welcomescreen/welcomescreen.qml +++ b/share/qtcreator/welcomescreen/welcomescreen.qml @@ -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 diff --git a/src/libs/utils/mapreduce.h b/src/libs/utils/mapreduce.h index 828b16b31f9..607ff5951aa 100644 --- a/src/libs/utils/mapreduce.h +++ b/src/libs/utils/mapreduce.h @@ -369,9 +369,12 @@ template 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::type, typename std::decay::type, @@ -438,9 +441,11 @@ template 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::type, typename std::decay::type, typename std::decay::type, @@ -458,9 +463,11 @@ template mapReduce(std::reference_wrapper 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::type, typename std::decay::type, @@ -478,14 +485,15 @@ template ::type> QFuture 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(std::forward(initialState)), std::forward(map), Internal::ReduceWrapper(std::forward(reduce)), &Internal::cleanupReportingState, - option, size); + option, priority, size); } template ::type> QFuture 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), Internal::StateWrapper(std::forward(initialState)), std::forward(map), Internal::ReduceWrapper(std::forward(reduce)), &Internal::cleanupReportingState, - option); + option, priority); } template (map), std::forward(initialState), std::forward(reduce), - option, size).result(); + option, priority, size).result(); } template (container), std::forward(map), std::forward(initialState), std::forward(reduce), - option).result(); + option, priority).result(); } template ::type> QFuture 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, std::forward(map), Internal::DummyReduce(), &Internal::dummyCleanup, - option, size); + option, priority, size); } template ::type> QFuture -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), Internal::dummyInit, std::forward(map), Internal::DummyReduce(), Internal::dummyCleanup, - option); + option, priority); } template class ResultContainer, typename ForwardIterator, typename MapFunction, @@ -562,11 +575,12 @@ template class ResultContainer, typename ForwardIterator, ty Q_REQUIRED_RESULT ResultContainer 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(map(begin, end, std::forward(mapFun), - option, size).results(), + option, priority, size).results(), [](const MapResult &r) { return r; }); } @@ -574,11 +588,13 @@ template class ResultContainer, typename Container, typename typename MapResult = typename Internal::resultType::type> Q_REQUIRED_RESULT ResultContainer -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(map(container, std::forward(mapFun), - option).results(), + option, priority).results(), [](const MapResult &r) { return r; }); } diff --git a/src/libs/utils/smallstringmemory.h b/src/libs/utils/smallstringmemory.h index 966d12159d8..c9687a09fb6 100644 --- a/src/libs/utils/smallstringmemory.h +++ b/src/libs/utils/smallstringmemory.h @@ -25,6 +25,8 @@ #pragma once +#include + #include #include #include @@ -35,7 +37,7 @@ namespace Memory { inline char *allocate(std::size_t size) { -#ifdef WIN32 +#ifdef Q_OS_WIN32 return static_cast(_aligned_malloc(size, 64)); #else return static_cast(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(_aligned_realloc(oldMemory, newSize, 64)); #else return static_cast(std::realloc(oldMemory, newSize)); diff --git a/src/plugins/autotest/autotest.qrc b/src/plugins/autotest/autotest.qrc index f92f835e599..6bd7eac6d79 100644 --- a/src/plugins/autotest/autotest.qrc +++ b/src/plugins/autotest/autotest.qrc @@ -5,16 +5,6 @@ images/sort@2x.png images/leafsort.png images/leafsort@2x.png - images/debug.png - images/fail.png - images/fatal.png - images/pass.png - images/skip.png - images/warn.png - images/xfail.png - images/xpass.png - images/blacklisted_fail.png - images/blacklisted_pass.png images/benchmark.png images/runselected_boxes.png images/runselected_boxes@2x.png diff --git a/src/plugins/autotest/autotesticons.h b/src/plugins/autotest/autotesticons.h index f7845b071f8..ae4a1527cfd 100644 --- a/src/plugins/autotest/autotesticons.h +++ b/src/plugins/autotest/autotesticons.h @@ -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 diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index 976bee11c85..f6e12685fb4 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -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(); diff --git a/src/plugins/autotest/images/blacklisted_fail.png b/src/plugins/autotest/images/blacklisted_fail.png deleted file mode 100644 index 695e1f92468..00000000000 Binary files a/src/plugins/autotest/images/blacklisted_fail.png and /dev/null differ diff --git a/src/plugins/autotest/images/blacklisted_pass.png b/src/plugins/autotest/images/blacklisted_pass.png deleted file mode 100644 index bac3ffb1342..00000000000 Binary files a/src/plugins/autotest/images/blacklisted_pass.png and /dev/null differ diff --git a/src/plugins/autotest/images/debug.png b/src/plugins/autotest/images/debug.png deleted file mode 100644 index e18bd157e4a..00000000000 Binary files a/src/plugins/autotest/images/debug.png and /dev/null differ diff --git a/src/plugins/autotest/images/fail.png b/src/plugins/autotest/images/fail.png deleted file mode 100644 index 38c0d1463a9..00000000000 Binary files a/src/plugins/autotest/images/fail.png and /dev/null differ diff --git a/src/plugins/autotest/images/fatal.png b/src/plugins/autotest/images/fatal.png deleted file mode 100644 index 4e0bf77474a..00000000000 Binary files a/src/plugins/autotest/images/fatal.png and /dev/null differ diff --git a/src/plugins/autotest/images/pass.png b/src/plugins/autotest/images/pass.png deleted file mode 100644 index 33dbe44649e..00000000000 Binary files a/src/plugins/autotest/images/pass.png and /dev/null differ diff --git a/src/plugins/autotest/images/skip.png b/src/plugins/autotest/images/skip.png deleted file mode 100644 index 9dfea415f16..00000000000 Binary files a/src/plugins/autotest/images/skip.png and /dev/null differ diff --git a/src/plugins/autotest/images/warn.png b/src/plugins/autotest/images/warn.png deleted file mode 100644 index a813c1dc9a6..00000000000 Binary files a/src/plugins/autotest/images/warn.png and /dev/null differ diff --git a/src/plugins/autotest/images/xfail.png b/src/plugins/autotest/images/xfail.png deleted file mode 100644 index deeafe7d941..00000000000 Binary files a/src/plugins/autotest/images/xfail.png and /dev/null differ diff --git a/src/plugins/autotest/images/xpass.png b/src/plugins/autotest/images/xpass.png deleted file mode 100644 index 964bb4a181e..00000000000 Binary files a/src/plugins/autotest/images/xpass.png and /dev/null differ diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index bc0845411bc..fe4c1132f1e 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -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 &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 &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 &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 &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; diff --git a/src/plugins/autotest/testcodeparser.h b/src/plugins/autotest/testcodeparser.h index 9967c3d08b8..2c68d143f2f 100644 --- a/src/plugins/autotest/testcodeparser.h +++ b/src/plugins/autotest/testcodeparser.h @@ -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 &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 m_postponedFiles; - State m_parserState = Disabled; + State m_parserState = Idle; QFutureWatcher m_futureWatcher; QVector m_testCodeParsers; // ptrs are still owned by TestFrameworkManager QTimer m_reparseTimer; diff --git a/src/plugins/autotest/testnavigationwidget.cpp b/src/plugins/autotest/testnavigationwidget.cpp index 4618520019c..1972638714b 100644 --- a/src/plugins/autotest/testnavigationwidget.cpp +++ b/src/plugins/autotest/testnavigationwidget.cpp @@ -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; diff --git a/src/plugins/autotest/testresultmodel.cpp b/src/plugins/autotest/testresultmodel.cpp index 2d4ddfd19ad..51dcbca4268 100644 --- a/src/plugins/autotest/testresultmodel.cpp +++ b/src/plugins/autotest/testresultmodel.cpp @@ -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) { diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 62b801d5033..6aba8e413c4 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -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) diff --git a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp index 82f06b59949..769d2d0e377 100644 --- a/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp +++ b/src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp @@ -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 diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index 1d704c8a88b..5bdf36051d3 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -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)) diff --git a/src/plugins/clangcodemodel/clangutils.h b/src/plugins/clangcodemodel/clangutils.h index 4bdc6c00d43..dcec4491397 100644 --- a/src/plugins/clangcodemodel/clangutils.h +++ b/src/plugins/clangcodemodel/clangutils.h @@ -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); diff --git a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp index 5fa28940f5a..4500d011156 100644 --- a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp +++ b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.cpp @@ -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(); diff --git a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.h b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.h index 9a11573e8d0..74532dea162 100644 --- a/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.h +++ b/src/plugins/clangrefactoring/refactoringcompileroptionsbuilder.h @@ -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); diff --git a/src/plugins/clangrefactoring/refactoringengine.cpp b/src/plugins/clangrefactoring/refactoringengine.cpp index 7a7564bba82..442d1560e8e 100644 --- a/src/plugins/clangrefactoring/refactoringengine.cpp +++ b/src/plugins/clangrefactoring/refactoringengine.cpp @@ -32,6 +32,8 @@ #include #include +#include + #include #include @@ -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()); diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp index 10cb6115ba5..2a8a5f58c9d 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -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 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); } } diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h index fb86bc1f942..dbccc365506 100644 --- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h +++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerutils.h @@ -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 diff --git a/src/plugins/coreplugin/actionmanager/actionmanager.cpp b/src/plugins/coreplugin/actionmanager/actionmanager.cpp index e3771101b75..526542a6175 100644 --- a/src/plugins/coreplugin/actionmanager/actionmanager.cpp +++ b/src/plugins/coreplugin/actionmanager/actionmanager.cpp @@ -163,6 +163,8 @@ ActionManager::ActionManager(QObject *parent) { m_instance = this; d = new ActionManagerPrivate; + if (Utils::HostOsInfo::isMacHost()) + QCoreApplication::setAttribute(Qt::AA_DontShowIconsInMenus); } /*! diff --git a/src/plugins/coreplugin/actionmanager/command.cpp b/src/plugins/coreplugin/actionmanager/command.cpp index 3e737290ae3..cdbbe200e3a 100644 --- a/src/plugins/coreplugin/actionmanager/command.cpp +++ b/src/plugins/coreplugin/actionmanager/command.cpp @@ -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) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 466598129f8..de912d6f2c4 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -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); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 6fd02fd873a..a4382a3d849 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -4817,7 +4817,7 @@ void MoveFuncDefOutside::match(const CppQuickFixInterface &interface, QuickFixOp } } - if (!funcAST) + if (!funcAST || !funcAST->symbol) return; bool isHeaderFile = false; diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index 01378ec88e2..d99692536dd 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -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 diff --git a/src/plugins/cpptools/compileroptionsbuilder.h b/src/plugins/cpptools/compileroptionsbuilder.h index ced3c0af1ba..75b0c4f530d 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.h +++ b/src/plugins/cpptools/compileroptionsbuilder.h @@ -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; diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp index 8859aef78eb..7bc34c903c5 100644 --- a/src/plugins/cpptools/cppchecksymbols.cpp +++ b/src/plugins/cpptools/cppchecksymbols.cpp @@ -346,9 +346,9 @@ void CheckSymbols::run() _usages << QVector::fromList(_macroUses); flush(); } - } - emit codeWarningsUpdated(_doc, _diagMsgs); + emit codeWarningsUpdated(_doc, _diagMsgs); + } reportFinished(); } diff --git a/src/plugins/cpptools/cpptoolsreuse.cpp b/src/plugins/cpptools/cpptoolsreuse.cpp index 7a21b4c6da6..fcb3c8b878e 100644 --- a/src/plugins/cpptools/cpptoolsreuse.cpp +++ b/src/plugins/cpptools/cpptoolsreuse.cpp @@ -288,4 +288,12 @@ bool fileSizeExceedsLimit(const QFileInfo &fileInfo, int sizeLimitInMb) return false; } +CompilerOptionsBuilder::PchUsage getPchUsage() +{ + const QSharedPointer cms = codeModelSettings(); + if (cms->pchUsage() == CppCodeModelSettings::PchUse_None) + return CompilerOptionsBuilder::PchUsage::None; + return CompilerOptionsBuilder::PchUsage::Use; +} + } // CppTools diff --git a/src/plugins/cpptools/cpptoolsreuse.h b/src/plugins/cpptools/cpptoolsreuse.h index b60eceeb64c..46ef50d7b16 100644 --- a/src/plugins/cpptools/cpptoolsreuse.h +++ b/src/plugins/cpptools/cpptoolsreuse.h @@ -29,6 +29,8 @@ #include +#include + #include QT_BEGIN_NAMESPACE @@ -72,6 +74,8 @@ void CPPTOOLS_EXPORT switchHeaderSource(); class CppCodeModelSettings; QSharedPointer CPPTOOLS_EXPORT codeModelSettings(); +CompilerOptionsBuilder::PchUsage CPPTOOLS_EXPORT getPchUsage(); + int indexerFileSizeLimitInMb(); bool fileSizeExceedsLimit(const QFileInfo &fileInfo, int sizeLimitInMb); diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 416c27eaccd..d950a26b3f8 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -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(); diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 6aaaa4074cb..115e630dfb1 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -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 DebuggerKitInformation::validateDebugger(const Kit *k) { QList result; - const unsigned errors = debuggerConfigurationErrors(k); - if (!errors) + const ConfigurationErrors errors = configurationErrors(k); + if (errors == NoConfigurationError) return result; QString path; diff --git a/src/plugins/debugger/debuggerkitinformation.h b/src/plugins/debugger/debuggerkitinformation.h index cae68aaf5ae..cbe438e3f56 100644 --- a/src/plugins/debugger/debuggerkitinformation.h +++ b/src/plugins/debugger/debuggerkitinformation.h @@ -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 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; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index bdc94011a13..6437643f512 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -583,7 +583,7 @@ static std::function 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); }); })); } diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 1235adb7237..fad3fd09c01 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -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") diff --git a/src/plugins/debugger/debuggertooltipmanager.h b/src/plugins/debugger/debuggertooltipmanager.h index 78f48d97692..33324ccf45e 100644 --- a/src/plugins/debugger/debuggertooltipmanager.h +++ b/src/plugins/debugger/debuggertooltipmanager.h @@ -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; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 53f94c4f6b3..b9b40694789 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -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"}); } diff --git a/src/plugins/projectexplorer/projectimporter.h b/src/plugins/projectexplorer/projectimporter.h index 2c21a738317..c89e44555f0 100644 --- a/src/plugins/projectexplorer/projectimporter.h +++ b/src/plugins/projectexplorer/projectimporter.h @@ -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); diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 328f2591904..b1642c91b07 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -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) diff --git a/src/plugins/projectexplorer/projectwindow.h b/src/plugins/projectexplorer/projectwindow.h index aa61d412967..87694ad0852 100644 --- a/src/plugins/projectexplorer/projectwindow.h +++ b/src/plugins/projectexplorer/projectwindow.h @@ -56,7 +56,6 @@ public: ProjectWindow(); private: - void contextMenuEvent(QContextMenuEvent *event) override; void setPanel(QWidget *panel); }; diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h index d004143634b..8f589506294 100644 --- a/src/plugins/projectexplorer/targetsetuppage.h +++ b/src/plugins/projectexplorer/targetsetuppage.h @@ -32,6 +32,7 @@ #include +#include #include #include @@ -109,7 +110,7 @@ private: KitMatcher m_requiredMatcher; KitMatcher m_preferredMatcher; - ProjectImporter *m_importer = nullptr; + QPointer m_importer = nullptr; QLayout *m_baseLayout = nullptr; QString m_projectPath; QString m_defaultShadowBuildLocation; diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 4b891ce6eee..354612a3c24 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -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(); } } diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 884eeb30db5..bb445eb6361 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -135,6 +136,8 @@ public: QStringList recentProjectsShortcuts() const { return m_recentProjectsShortcuts; } QStringList sessionsShortcuts() const { return m_sessionsShortcuts; } + Q_INVOKABLE bool openDroppedFiles(const QList &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 &urls) +{ + const QList 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(obj); diff --git a/src/plugins/winrt/WinRt.json.in b/src/plugins/winrt/WinRt.json.in index 66b4e18402d..9cccdba66f1 100644 --- a/src/plugins/winrt/WinRt.json.in +++ b/src/plugins/winrt/WinRt.json.in @@ -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\", diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri index ae8f359859e..35474b8faa7 100644 --- a/src/shared/clang/clang_installation.pri +++ b/src/shared/clang/clang_installation.pri @@ -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 diff --git a/src/tools/clangrefactoringbackend/source/clangrefactoringbackend_global.h b/src/tools/clangrefactoringbackend/source/clangrefactoringbackend_global.h index fc286b8780e..30d4b2e1a08 100644 --- a/src/tools/clangrefactoringbackend/source/clangrefactoringbackend_global.h +++ b/src/tools/clangrefactoringbackend/source/clangrefactoringbackend_global.h @@ -35,7 +35,7 @@ namespace ClangBackEnd { using USRName = llvm::SmallVector; // use std::filesystem::path if it is supported by all compilers -#ifdef WIN32 +#ifdef _WIN32 const char nativeSeperator = '\\'; #else const char nativeSeperator = '/'; diff --git a/src/tools/clangrefactoringbackend/source/clangtool.cpp b/src/tools/clangrefactoringbackend/source/clangtool.cpp index 99f724e39ab..d447121379b 100644 --- a/src/tools/clangrefactoringbackend/source/clangtool.cpp +++ b/src/tools/clangrefactoringbackend/source/clangtool.cpp @@ -33,7 +33,7 @@ namespace { std::string toNativePath(std::string &&path) { -#ifdef WIN32 +#ifdef _WIN32 std::replace(path.begin(), path.end(), '/', '\\'); #endif diff --git a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h index 6e963190a63..8e3dba86b22 100644 --- a/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h +++ b/src/tools/clangrefactoringbackend/source/sourcelocationsutils.h @@ -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 diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 786201dfcba..0c78e88ff63 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -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 \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 d;\n" " };\n"; + QTest::newRow("QAtomicPointer") + << Data("#include \n" + "#include \n\n" + "template struct Pointer : QAtomicPointer {\n" + " Pointer(T *value = 0) : QAtomicPointer(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 e = {\"5\", \"6\" };\n" + "};\n\n" + "typedef Pointer SomeStructPointer;\n\n", + + "SomeStruct *s = new SomeStruct; unused(s);\n" + "SomeStructPointer p(s); unused(p);\n" + "Pointer pp(s); unused(pp);\n" + "QAtomicPointer 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 \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"); diff --git a/tests/auto/mapreduce/tst_mapreduce.cpp b/tests/auto/mapreduce/tst_mapreduce.cpp index aaa80de424d..413d8753602 100644 --- a/tests/auto/mapreduce/tst_mapreduce.cpp +++ b/tests/auto/mapreduce/tst_mapreduce.cpp @@ -214,7 +214,7 @@ void tst_MapReduce::map() QCOMPARE(container, QList({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({8, 20, 4})); } diff --git a/tests/unit/unittest/filesystem-utilities.h b/tests/unit/unittest/filesystem-utilities.h index b102a596dcc..36b3e5ed703 100644 --- a/tests/unit/unittest/filesystem-utilities.h +++ b/tests/unit/unittest/filesystem-utilities.h @@ -28,7 +28,7 @@ #include // 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