Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia346d86ad5fabe9d91454ea642cbeac5ec862699
@@ -15,6 +15,7 @@ macOS 10.8 or later
|
|||||||
Prerequisites:
|
Prerequisites:
|
||||||
|
|
||||||
* Qt 5.6.0 or later
|
* Qt 5.6.0 or later
|
||||||
|
* Qt WebEngine module for QtWebEngine based help viewer
|
||||||
* On Windows:
|
* On Windows:
|
||||||
* ActiveState Active Perl
|
* ActiveState Active Perl
|
||||||
* MinGW with g++ 4.8 or Visual Studio 2015 or later
|
* MinGW with g++ 4.8 or Visual Studio 2015 or later
|
||||||
|
|||||||
52
dist/changes-4.2.0.md
vendored
@@ -65,12 +65,12 @@ C++ Support
|
|||||||
|
|
||||||
* Added preview of images to tool tip on Qt resource URLs
|
* Added preview of images to tool tip on Qt resource URLs
|
||||||
* Added option to skip big files when indexing (QTCREATORBUG-16712)
|
* Added option to skip big files when indexing (QTCREATORBUG-16712)
|
||||||
* Added notification for parsing errors in headers
|
|
||||||
* Fixed `Move Definition to Class` for functions in template class and
|
* Fixed `Move Definition to Class` for functions in template class and
|
||||||
template member functions (QTCREATORBUG-14354)
|
template member functions (QTCREATORBUG-14354)
|
||||||
* Fixed issues with `Add Declaration`, `Add Definition`, and
|
* Fixed issues with `Add Declaration`, `Add Definition`, and
|
||||||
`Move Definition Outside Class` for template functions
|
`Move Definition Outside Class` for template functions
|
||||||
* Clang Code Model
|
* Clang Code Model
|
||||||
|
* Added notification for parsing errors in headers
|
||||||
* Improved responsiveness of completion and highlighting
|
* Improved responsiveness of completion and highlighting
|
||||||
|
|
||||||
Debugging
|
Debugging
|
||||||
@@ -91,7 +91,7 @@ QML Profiler
|
|||||||
|
|
||||||
Qt Quick Designer
|
Qt Quick Designer
|
||||||
|
|
||||||
* Added completion expression editor
|
* Added completion to expression editor
|
||||||
* Added menu for editing `when` condition of states
|
* Added menu for editing `when` condition of states
|
||||||
* Added editor for managing C++ backend objects
|
* Added editor for managing C++ backend objects
|
||||||
* Added reformatting of `.ui.qml` files on save
|
* Added reformatting of `.ui.qml` files on save
|
||||||
@@ -106,9 +106,11 @@ Qt Quick Designer
|
|||||||
|
|
||||||
Diff Viewer
|
Diff Viewer
|
||||||
|
|
||||||
* Added local diff for modified files in Qt Creator (`Diff` >
|
* Added local diff for modified files in Qt Creator (`Tools` > `Diff` >
|
||||||
`Diff Current File`, `Diff` > `Diff All Modified Files`)
|
`Diff Current File`, `Tools` > `Diff` > `Diff Open Files`)
|
||||||
(QTCREATORBUG-9732)
|
(QTCREATORBUG-9732)
|
||||||
|
* Added option to diff files when they changed on disk
|
||||||
|
(QTCREATORBUG-1531)
|
||||||
* Fixed that reload prompt was shown when reverting change
|
* Fixed that reload prompt was shown when reverting change
|
||||||
|
|
||||||
Version Control Systems
|
Version Control Systems
|
||||||
@@ -140,3 +142,45 @@ Android
|
|||||||
* Fixed handling of minimum required API level (QTCREATORBUG-16740)
|
* Fixed handling of minimum required API level (QTCREATORBUG-16740)
|
||||||
|
|
||||||
Credits for these changes go to:
|
Credits for these changes go to:
|
||||||
|
Aaron Barany
|
||||||
|
Alessandro Portale
|
||||||
|
Alexander Drozdov
|
||||||
|
Andre Hartmann
|
||||||
|
André Pönitz
|
||||||
|
Arnold Dumas
|
||||||
|
Christian Kandeler
|
||||||
|
Christian Stenger
|
||||||
|
Daniel Langner
|
||||||
|
Daniel Trevitz
|
||||||
|
David Schulz
|
||||||
|
Eike Ziller
|
||||||
|
Florian Apolloner
|
||||||
|
Francois Ferrand
|
||||||
|
Friedemann Kleint
|
||||||
|
Giuseppe D'Angelo
|
||||||
|
Jake Petroules
|
||||||
|
Jaroslaw Kobus
|
||||||
|
Jochen Becher
|
||||||
|
Konstantin Shtepa
|
||||||
|
Kudryavtsev Alexander
|
||||||
|
Leena Miettinen
|
||||||
|
Louai Al-Khanji
|
||||||
|
Marc Reilly
|
||||||
|
Marco Benelli
|
||||||
|
Marco Bubke
|
||||||
|
Mitch Curtis
|
||||||
|
Nazar Gerasymchuk
|
||||||
|
Nikita Baryshnikov
|
||||||
|
Nikolai Kosjar
|
||||||
|
Orgad Shaneh
|
||||||
|
Oswald Buddenhagen
|
||||||
|
Øystein Walle
|
||||||
|
Robert Löhning
|
||||||
|
Serhii Moroz
|
||||||
|
Takumi ASAKI
|
||||||
|
Tasuku Suzuki
|
||||||
|
Thomas Hartmann
|
||||||
|
Tim Jenssen
|
||||||
|
Tobias Hunger
|
||||||
|
Ulf Hermann
|
||||||
|
Vikas Pachdha
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -417,6 +417,9 @@
|
|||||||
\uicontrol Window > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
\uicontrol Window > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
||||||
to reset the views to their original sizes and positions.
|
to reset the views to their original sizes and positions.
|
||||||
|
|
||||||
|
To save space on the screen, select \uicontrol Window > \uicontrol Views >
|
||||||
|
\uicontrol {Automatically Hide View Titlebars}.
|
||||||
|
|
||||||
Once the program starts running under the control of the debugger, it
|
Once the program starts running under the control of the debugger, it
|
||||||
behaves and performs as usual. You can interrupt a running C++ program by
|
behaves and performs as usual. You can interrupt a running C++ program by
|
||||||
selecting \uicontrol Debug > \uicontrol Interrupt. The program is
|
selecting \uicontrol Debug > \uicontrol Interrupt. The program is
|
||||||
|
|||||||
@@ -554,6 +554,12 @@
|
|||||||
\row
|
\row
|
||||||
\li M208
|
\li M208
|
||||||
\li Error
|
\li Error
|
||||||
|
\li This id might be ambiguous and is not supported in the \QMLD.
|
||||||
|
\li
|
||||||
|
|
||||||
|
\row
|
||||||
|
\li M209
|
||||||
|
\li Error
|
||||||
\li This type (type name) is not supported as a root element by \QMLD.
|
\li This type (type name) is not supported as a root element by \QMLD.
|
||||||
\li
|
\li
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,13 @@
|
|||||||
\title Keyboard Shortcuts
|
\title Keyboard Shortcuts
|
||||||
|
|
||||||
\QC provides various keyboard shortcuts to speed up your development
|
\QC provides various keyboard shortcuts to speed up your development
|
||||||
process.
|
process. In addition, you can specify your own keyboard shortcuts for some
|
||||||
|
functions that can be easily performed with a mouse, and therefore do not
|
||||||
|
appear in menus or have default keyboard shortcuts. For example, selecting
|
||||||
|
and deleting words or lines in an editor.
|
||||||
|
|
||||||
To view all keyboard shortcuts defined in \QC, and to change them, select
|
To view all functions available in \QC and the keyboard shortcuts defined
|
||||||
|
for them, select
|
||||||
\uicontrol {Tools > Options > Environment > Keyboard}. The shortcuts are listed by
|
\uicontrol {Tools > Options > Environment > Keyboard}. The shortcuts are listed by
|
||||||
category. To find a keyboard
|
category. To find a keyboard
|
||||||
shortcut in the list, enter a function name or shortcut in the \uicontrol Filter
|
shortcut in the list, enter a function name or shortcut in the \uicontrol Filter
|
||||||
|
|||||||
@@ -80,10 +80,16 @@
|
|||||||
\uicontrol {Switch to}.
|
\uicontrol {Switch to}.
|
||||||
|
|
||||||
When you launch \QC, a list of existing sessions is displayed in the
|
When you launch \QC, a list of existing sessions is displayed in the
|
||||||
\uicontrol Welcome mode.
|
\uicontrol Welcome mode. To open a session, select it or press
|
||||||
|
\key Ctrl+Alt+<number>, where \e <number> is the number of the session to
|
||||||
|
open (available for the first nine sessions).
|
||||||
|
|
||||||
\image qtcreator-welcome-session.png
|
\image qtcreator-welcome-session.png
|
||||||
|
|
||||||
|
To view more information about a session, select the down arrow icon that
|
||||||
|
appears when you move the mouse cursor over the session name. Select actions
|
||||||
|
to clone, rename, and delete sessions.
|
||||||
|
|
||||||
When you start \QC from the command line, you can give the name of
|
When you start \QC from the command line, you can give the name of
|
||||||
a session as argument and \QC will start with this session.
|
a session as argument and \QC will start with this session.
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,9 @@
|
|||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol Tools > \uicontrol Options >
|
\li Select \uicontrol Tools > \uicontrol Options >
|
||||||
\uicontrol {Build & Run} > \uicontrol Compilers > \uicontrol Add
|
\uicontrol {Build & Run} > \uicontrol Compilers > \uicontrol Add,
|
||||||
and select a compiler in the list.
|
then select a compiler in the list, and then select \uicontrol C or
|
||||||
|
\uicontrol C++ to add a C or C++ compiler.
|
||||||
|
|
||||||
\image qtcreator-toolchains.png
|
\image qtcreator-toolchains.png
|
||||||
|
|
||||||
@@ -124,7 +125,8 @@
|
|||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
|
||||||
\uicontrol Compilers > \uicontrol Add > \uicontrol Custom.
|
\uicontrol Compilers > \uicontrol Add > \uicontrol Custom >
|
||||||
|
\uicontrol C or \uicontrol C++.
|
||||||
|
|
||||||
\li In the \uicontrol Name field, enter a name for the compiler.
|
\li In the \uicontrol Name field, enter a name for the compiler.
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,36 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol File > \uicontrol{Open File or Project} and select the project
|
\li Select \uicontrol File > \uicontrol {Open File or Project}
|
||||||
to open.
|
(\key Ctrl+O or \key Cmd+O on \macos) and select the project to
|
||||||
|
open.
|
||||||
|
|
||||||
\li In the \uicontrol {Configure Project} tab, select kits for building and running your
|
\li In the \uicontrol {Configure Project} tab, select kits for building and running your
|
||||||
project, and click \uicontrol {Configure Project}.
|
project, and click \uicontrol {Configure Project}.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
You can use the following keyboard shortcuts to open projects, depending on
|
||||||
|
the mode you are currently in:
|
||||||
|
|
||||||
|
\list
|
||||||
|
|
||||||
|
\li In all modes, select \key Ctrl+O (\key Cmd+O on \macos) to open the
|
||||||
|
\uicontrol {Open File} dialog, where you can select a project file
|
||||||
|
to open a project.
|
||||||
|
|
||||||
|
\li In all modes, except the \uicontrol Help mode, select
|
||||||
|
\key Ctrl+Shift+O (\key Cmd+Shift+O on \macos) to open the
|
||||||
|
\uicontrol {Load Project} dialog, where you can select a project
|
||||||
|
file to open a project.
|
||||||
|
|
||||||
|
\li In the \uicontrol Welcome mode, \uicontrol Projects tab, select
|
||||||
|
\key Ctrl+Shift+number (\key Cmd+Shift+number on \macos), where
|
||||||
|
the number is the number of a project in the list of recently opened
|
||||||
|
projects.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
\QC parses all the source files in the project and performs a semantic
|
\QC parses all the source files in the project and performs a semantic
|
||||||
analysis to build up the information that it needs for functions such as
|
analysis to build up the information that it needs for functions such as
|
||||||
navigation and finding usages. A progress bar is displayed during parsing.
|
navigation and finding usages. A progress bar is displayed during parsing.
|
||||||
|
|||||||
@@ -111,6 +111,33 @@
|
|||||||
(\uicontrol {Variables}) button in a field to select from a list of variables that
|
(\uicontrol {Variables}) button in a field to select from a list of variables that
|
||||||
are available in a particular context.
|
are available in a particular context.
|
||||||
|
|
||||||
|
The following syntax enables you to use environment variables as \QC
|
||||||
|
variables: %{Env:VARNAME}.
|
||||||
|
|
||||||
|
\QC uses pattern substitution when expanding variable names. To replace the
|
||||||
|
first match of \e pattern within \e variable with \e replacement, use:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
%{variable/pattern/replacement}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
To replace all matches of \e pattern within \e variable with \e replacement,
|
||||||
|
use:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
%{variable//pattern/replacement}
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
The pattern can be a regular expression and the replacement can contain
|
||||||
|
backreferences. For example, if \c %{variable} is \c my123var, then
|
||||||
|
\c %{variable/(..)(\d+)/\2\1} is expanded to \c {123myvar}.
|
||||||
|
|
||||||
|
To use the default value if the variable is not set, use:
|
||||||
|
|
||||||
|
\badcode
|
||||||
|
%{variable:-default}
|
||||||
|
\endcode
|
||||||
|
|
||||||
\section1 Build Steps
|
\section1 Build Steps
|
||||||
|
|
||||||
The build system of \QC is built on qmake and make. In \uicontrol{Build Steps} you
|
The build system of \QC is built on qmake and make. In \uicontrol{Build Steps} you
|
||||||
|
|||||||
@@ -99,6 +99,8 @@
|
|||||||
|
|
||||||
\li \l{Specifying Dependencies}{Dependencies}
|
\li \l{Specifying Dependencies}{Dependencies}
|
||||||
|
|
||||||
|
\li \l{Parsing C++ Files}{Clang Code Model} (experimental)
|
||||||
|
|
||||||
\li \l{Using Clang Static Analyzer}{Clang Static Analyzer}
|
\li \l{Using Clang Static Analyzer}{Clang Static Analyzer}
|
||||||
|
|
||||||
\li \l{To-Do Entries}{To-Do} (experimental)
|
\li \l{To-Do Entries}{To-Do} (experimental)
|
||||||
|
|||||||
@@ -91,8 +91,8 @@
|
|||||||
image is located. If you are not cross-compiling, leave this field
|
image is located. If you are not cross-compiling, leave this field
|
||||||
empty.
|
empty.
|
||||||
|
|
||||||
\li In the \uicontrol {Compiler} field, select the compiler required
|
\li In the \uicontrol {Compiler} field, select the C or C++ compiler
|
||||||
to build the project. You can add compilers to the list
|
used to build the project. You can add compilers to the list
|
||||||
if they are installed on the development PC, but were not detected
|
if they are installed on the development PC, but were not detected
|
||||||
automatically. For more information, see \l{Adding Compilers}.
|
automatically. For more information, see \l{Adding Compilers}.
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,11 @@
|
|||||||
Classes registered with \c qmlRegisterType() can be used as backend objects
|
Classes registered with \c qmlRegisterType() can be used as backend objects
|
||||||
in the \QMLD. For more information, see \l {Adding Connections}.
|
in the \QMLD. For more information, see \l {Adding Connections}.
|
||||||
|
|
||||||
|
By default, \QC will look in the QML import path of Qt for QML modules.
|
||||||
|
If your applications adds additional import paths that \QC should use,
|
||||||
|
then you can specify those using \c{QML_IMPORT_PATH} in the \c{.pro} file of your
|
||||||
|
application.
|
||||||
|
|
||||||
Ideally, QML modules have a \c{plugins.qmltypes} file in the same directory
|
Ideally, QML modules have a \c{plugins.qmltypes} file in the same directory
|
||||||
as the \c qmldir file. The \c qmltypes file contains a description of the
|
as the \c qmldir file. The \c qmltypes file contains a description of the
|
||||||
types exported by the module's plugins and is loaded by \QC when the
|
types exported by the module's plugins and is loaded by \QC when the
|
||||||
@@ -117,4 +122,9 @@
|
|||||||
environment variable to check whether the plugin is currently being run
|
environment variable to check whether the plugin is currently being run
|
||||||
by an application or edited in the \uicontrol Design mode.
|
by an application or edited in the \uicontrol Design mode.
|
||||||
|
|
||||||
|
If you want to use a different module in \QMLD than in your actual
|
||||||
|
application for example to mockup C++ items, then you can use \c{QML_DESIGNER_IMPORT_PATH}
|
||||||
|
in the \c{.pro} file.
|
||||||
|
Modules in the import paths defined in \c{QML_DESIGNER_IMPORT_PATH} will be used only in \QMLD.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1275,6 +1275,12 @@ def qdump__QStaticStringData(d, value):
|
|||||||
d.putValue(d.hexencode(data), 'utf16')
|
d.putValue(d.hexencode(data), 'utf16')
|
||||||
d.putPlainChildren(value)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
|
def qdump__QTypedArrayData(d, value):
|
||||||
|
if value.type[0].name == 'unsigned short':
|
||||||
|
qdump__QStringData(d, value)
|
||||||
|
else:
|
||||||
|
qdump__QArrayData(d, value)
|
||||||
|
|
||||||
def qdump__QStringData(d, value):
|
def qdump__QStringData(d, value):
|
||||||
(ref, size, alloc, pad, offset) = value.split('III@p')
|
(ref, size, alloc, pad, offset) = value.split('III@p')
|
||||||
elided, shown = d.computeLimit(size, d.displayStringLimit)
|
elided, shown = d.computeLimit(size, d.displayStringLimit)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def qdump__std____1__complex(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__std__deque(d, value):
|
def qdump__std__deque(d, value):
|
||||||
if d.isQnxTarget():
|
if d.isQnxTarget() or d.isMsvcTarget():
|
||||||
qdump__std__deque__QNX(d, value)
|
qdump__std__deque__QNX(d, value)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -117,15 +117,20 @@ def qdump__std__deque__QNX(d, value):
|
|||||||
else:
|
else:
|
||||||
bufsize = 1
|
bufsize = 1
|
||||||
|
|
||||||
myoff = value['_Myoff']
|
try:
|
||||||
mysize = value['_Mysize']
|
val = value['_Mypair']['_Myval2']
|
||||||
mapsize = value['_Mapsize']
|
except:
|
||||||
|
val = value
|
||||||
|
|
||||||
|
myoff = val['_Myoff'].integer()
|
||||||
|
mysize = val['_Mysize'].integer()
|
||||||
|
mapsize = val['_Mapsize'].integer()
|
||||||
|
|
||||||
d.check(0 <= mapsize and mapsize <= 1000 * 1000 * 1000)
|
d.check(0 <= mapsize and mapsize <= 1000 * 1000 * 1000)
|
||||||
d.putItemCount(mysize)
|
d.putItemCount(mysize)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
with Children(d, mysize, maxNumChild=2000, childType=innerType):
|
with Children(d, mysize, maxNumChild=2000, childType=innerType):
|
||||||
map = value['_Map']
|
map = val['_Map']
|
||||||
for i in d.childRange():
|
for i in d.childRange():
|
||||||
block = myoff / bufsize
|
block = myoff / bufsize
|
||||||
offset = myoff - (block * bufsize)
|
offset = myoff - (block * bufsize)
|
||||||
@@ -139,7 +144,7 @@ def qdump__std____debug__deque(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__std__list(d, value):
|
def qdump__std__list(d, value):
|
||||||
if d.isQnxTarget():
|
if d.isQnxTarget() or d.isMsvcTarget():
|
||||||
qdump__std__list__QNX(d, value)
|
qdump__std__list__QNX(d, value)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -167,7 +172,7 @@ def qdump__std__list(d, value):
|
|||||||
|
|
||||||
def qdump__std__list__QNX(d, value):
|
def qdump__std__list__QNX(d, value):
|
||||||
node = value["_Myhead"]
|
node = value["_Myhead"]
|
||||||
size = value["_Mysize"]
|
size = value["_Mysize"].integer()
|
||||||
|
|
||||||
d.putItemCount(size, 1000)
|
d.putItemCount(size, 1000)
|
||||||
|
|
||||||
@@ -607,16 +612,25 @@ def qdump__std____1__wstring(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__std__shared_ptr(d, value):
|
def qdump__std__shared_ptr(d, value):
|
||||||
i = value["_M_ptr"]
|
if d.isMsvcTarget:
|
||||||
|
i = value["_Ptr"]
|
||||||
|
else:
|
||||||
|
i = value["_M_ptr"]
|
||||||
|
|
||||||
if i.integer() == 0:
|
if i.integer() == 0:
|
||||||
d.putValue("(null)")
|
d.putValue("(null)")
|
||||||
d.putNumChild(0)
|
d.putNumChild(0)
|
||||||
return
|
return
|
||||||
with Children(d):
|
with Children(d):
|
||||||
short = d.putSubItem("data", i)
|
short = d.putSubItem("data", i)
|
||||||
refcount = value["_M_refcount"]["_M_pi"]
|
if d.isMsvcTarget:
|
||||||
d.putIntItem("usecount", refcount["_M_use_count"])
|
refcount = value["_Rep"]
|
||||||
d.putIntItem("weakcount", refcount["_M_weak_count"])
|
d.putIntItem("usecount", refcount["_Uses"])
|
||||||
|
d.putIntItem("weakcount", refcount["_Weaks"])
|
||||||
|
else:
|
||||||
|
refcount = value["_M_refcount"]["_M_pi"]
|
||||||
|
d.putIntItem("usecount", refcount["_M_use_count"])
|
||||||
|
d.putIntItem("weakcount", refcount["_M_weak_count"])
|
||||||
d.putValue(short.value, short.encoding)
|
d.putValue(short.value, short.encoding)
|
||||||
|
|
||||||
def qdump__std____1__shared_ptr(d, value):
|
def qdump__std____1__shared_ptr(d, value):
|
||||||
@@ -767,7 +781,10 @@ def qform__std__valarray():
|
|||||||
return arrayForms()
|
return arrayForms()
|
||||||
|
|
||||||
def qdump__std__valarray(d, value):
|
def qdump__std__valarray(d, value):
|
||||||
(size, data) = value.split('pp')
|
if d.isMsvcTarget():
|
||||||
|
(data, size) = value.split('pp')
|
||||||
|
else:
|
||||||
|
(size, data) = value.split('pp')
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
d.putPlotData(data, size, value.type[0])
|
d.putPlotData(data, size, value.type[0])
|
||||||
|
|
||||||
|
|||||||
@@ -685,16 +685,36 @@ void NodeInstanceServer::setupDummysForContext(QQmlContext *context)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isTypeAvailable(const MockupTypeContainer &mockupType, QQmlEngine *engine)
|
||||||
|
{
|
||||||
|
QString qmlSource;
|
||||||
|
qmlSource.append("import " +
|
||||||
|
mockupType.importUri()
|
||||||
|
+ " "
|
||||||
|
+ QString::number(mockupType.majorVersion())
|
||||||
|
+ "." + QString::number(mockupType.minorVersion())
|
||||||
|
+ "\n");
|
||||||
|
|
||||||
|
qmlSource.append(QString::fromUtf8(mockupType.typeName()) + "{\n}\n");
|
||||||
|
|
||||||
|
QQmlComponent component(engine);
|
||||||
|
component.setData(qmlSource.toUtf8(), QUrl());
|
||||||
|
|
||||||
|
return !component.isError();
|
||||||
|
}
|
||||||
|
|
||||||
void NodeInstanceServer::setupMockupTypes(const QVector<MockupTypeContainer> &container)
|
void NodeInstanceServer::setupMockupTypes(const QVector<MockupTypeContainer> &container)
|
||||||
{
|
{
|
||||||
for (const MockupTypeContainer &mockupType : container) {
|
for (const MockupTypeContainer &mockupType : container) {
|
||||||
|
if (!isTypeAvailable(mockupType, engine()))
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||||
QQuickDesignerSupportMetaInfo::registerMockupObject(mockupType.importUri().toUtf8(),
|
|
||||||
|
QQuickDesignerSupportMetaInfo::registerMockupObject(mockupType.importUri().toUtf8(),
|
||||||
mockupType.majorVersion(),
|
mockupType.majorVersion(),
|
||||||
mockupType.minorVersion(),
|
mockupType.minorVersion(),
|
||||||
mockupType.typeName());
|
mockupType.typeName());
|
||||||
#else
|
#else
|
||||||
qmlRegisterType(QUrl("qrc:/qtquickplugin/mockfiles/GenericBackend.qml"),
|
qmlRegisterType(QUrl("qrc:/qtquickplugin/mockfiles/GenericBackend.qml"),
|
||||||
mockupType.importUri().toUtf8(),
|
mockupType.importUri().toUtf8(),
|
||||||
mockupType.majorVersion(),
|
mockupType.majorVersion(),
|
||||||
mockupType.minorVersion(),
|
mockupType.minorVersion(),
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" },
|
{ "key": "CN", "value": "%{JS: Cpp.className('%{Class}')}" },
|
||||||
{ "key": "Base", "value": "%{JS: ( '%{BaseCB}' === '' ) ? '%{BaseEdit}' : '%{BaseCB}'}" },
|
{ "key": "Base", "value": "%{JS: ( '%{BaseCB}' === '' ) ? '%{BaseEdit}' : '%{BaseCB}'}" },
|
||||||
{ "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf('%{Base}') >= 0 }" },
|
{ "key": "isQObject", "value": "%{JS: [ 'QObject', 'QWidget', 'QMainWindow', 'QDeclarativeItem', 'QQuickItem'].indexOf('%{Base}') >= 0 }" },
|
||||||
{ "key": "GUARD", "value": "%{JS: Cpp.classToHeaderGuard('%{Class}', '%{JS: Util.preferredSuffix('text/x-c++hdr')}')}" },
|
{ "key": "GUARD", "value": "%{JS: Cpp.headerGuard('%{HdrFileName}')}" },
|
||||||
{ "key": "SharedDataInit", "value": "%{JS: ('%{IncludeQSharedData}') ? 'data(new %{CN}Data)' : '' }" }
|
{ "key": "SharedDataInit", "value": "%{JS: ('%{IncludeQSharedData}') ? 'data(new %{CN}Data)' : '' }" }
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -10,3 +10,14 @@ CONFIG -= app_bundle
|
|||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
|
||||||
SOURCES += %{MainCppName}
|
SOURCES += %{MainCppName}
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
|
# depend on your compiler). Please consult the documentation of the
|
||||||
|
# deprecated API in order to know how to port your code away from it.
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|||||||
@@ -11,6 +11,17 @@ RESOURCES += qml.qrc
|
|||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH =
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
|
# depend on your compiler). Please consult the documentation of the
|
||||||
|
# deprecated API in order to know how to port your code away from it.
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
|||||||
@@ -10,6 +10,20 @@ RESOURCES += qml.qrc
|
|||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH =
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
|
# depend on your compiler). Please consult the documentation of the
|
||||||
|
# deprecated API in order to know how to port your code away from it.
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
|||||||
@@ -9,6 +9,20 @@ RESOURCES += qml.qrc
|
|||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH =
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
|
# depend on your compiler). Please consult the documentation of the
|
||||||
|
# deprecated API in order to know how to port your code away from it.
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
|||||||
@@ -15,6 +15,20 @@ RESOURCES += qml.qrc
|
|||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
QML_IMPORT_PATH =
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
|
# The following define makes your compiler emit warnings if you use
|
||||||
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
|
# depend on your compiler). Please consult the documentation of the
|
||||||
|
# deprecated API in order to know how to port your code away from it.
|
||||||
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
|
||||||
|
# You can also make your code fail to compile if you use deprecated APIs.
|
||||||
|
# In order to do so, uncomment the following line.
|
||||||
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
|||||||
@@ -244,7 +244,3 @@ IconOverlayPri=:/qtsupport/images/dark_qt_project.png
|
|||||||
IconOverlayPro=:/qtsupport/images/dark_qt_project.png
|
IconOverlayPro=:/qtsupport/images/dark_qt_project.png
|
||||||
StandardPixmapFileIcon=:/core/images/dark_fileicon.png
|
StandardPixmapFileIcon=:/core/images/dark_fileicon.png
|
||||||
StandardPixmapDirIcon=:/core/images/dark_foldericon.png
|
StandardPixmapDirIcon=:/core/images/dark_foldericon.png
|
||||||
BuildStepDisable=:/projectexplorer/images/lightdisabledbuildstep.png
|
|
||||||
BuildStepRemove=:/core/images/lightclose.png
|
|
||||||
BuildStepMoveDown=:/core/images/lightarrowdown.png
|
|
||||||
BuildStepMoveUp=:/core/images/lightarrowup.png
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ QIcon Icons::iconForType(IconType type)
|
|||||||
}
|
}
|
||||||
case NamespaceIconType: {
|
case NamespaceIconType: {
|
||||||
const static QIcon icon(Icon({
|
const static QIcon icon(Icon({
|
||||||
{QLatin1String(":/codemodel/images/namespace.png"), Theme::IconsCodeModelKeywordColor}
|
{QLatin1String(":/utils/images/namespace.png"), Theme::IconsCodeModelKeywordColor}
|
||||||
}, Icon::Tint).icon());
|
}, Icon::Tint).icon());
|
||||||
return icon;
|
return icon;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@
|
|||||||
<file>images/keyword@2x.png</file>
|
<file>images/keyword@2x.png</file>
|
||||||
<file>images/macro.png</file>
|
<file>images/macro.png</file>
|
||||||
<file>images/macro@2x.png</file>
|
<file>images/macro@2x.png</file>
|
||||||
<file>images/namespace.png</file>
|
|
||||||
<file>images/namespace@2x.png</file>
|
|
||||||
<file>images/signal.png</file>
|
<file>images/signal.png</file>
|
||||||
<file>images/signal@2x.png</file>
|
<file>images/signal@2x.png</file>
|
||||||
<file>images/slot.png</file>
|
<file>images/slot.png</file>
|
||||||
|
|||||||
@@ -489,6 +489,42 @@ private:
|
|||||||
bool _seenNonDeclarationStatement;
|
bool _seenNonDeclarationStatement;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class IdsThatShouldNotBeUsedInDesigner : public QStringList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
IdsThatShouldNotBeUsedInDesigner() : QStringList({ "top",
|
||||||
|
"bottom",
|
||||||
|
"left",
|
||||||
|
"right",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"opacity",
|
||||||
|
"parent",
|
||||||
|
"item",
|
||||||
|
"flow",
|
||||||
|
"color",
|
||||||
|
"margin",
|
||||||
|
"padding",
|
||||||
|
"border",
|
||||||
|
"font",
|
||||||
|
"text",
|
||||||
|
"source",
|
||||||
|
"state",
|
||||||
|
"visible",
|
||||||
|
"focus",
|
||||||
|
"data",
|
||||||
|
"clip",
|
||||||
|
"layer",
|
||||||
|
"scale",
|
||||||
|
"enabled",
|
||||||
|
"anchors"})
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
class VisualAspectsPropertyBlackList : public QStringList
|
class VisualAspectsPropertyBlackList : public QStringList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -563,6 +599,7 @@ public:
|
|||||||
|
|
||||||
} // end of anonymous namespace
|
} // end of anonymous namespace
|
||||||
|
|
||||||
|
Q_GLOBAL_STATIC(IdsThatShouldNotBeUsedInDesigner, idsThatShouldNotBeUsedInDesigner)
|
||||||
Q_GLOBAL_STATIC(VisualAspectsPropertyBlackList, visualAspectsPropertyBlackList)
|
Q_GLOBAL_STATIC(VisualAspectsPropertyBlackList, visualAspectsPropertyBlackList)
|
||||||
Q_GLOBAL_STATIC(UnsupportedTypesByVisualDesigner, unsupportedTypesByVisualDesigner)
|
Q_GLOBAL_STATIC(UnsupportedTypesByVisualDesigner, unsupportedTypesByVisualDesigner)
|
||||||
Q_GLOBAL_STATIC(UnsupportedRootObjectTypesByVisualDesigner, unsupportedRootObjectTypesByVisualDesigner)
|
Q_GLOBAL_STATIC(UnsupportedRootObjectTypesByVisualDesigner, unsupportedRootObjectTypesByVisualDesigner)
|
||||||
@@ -634,6 +671,7 @@ void Check::enableQmlDesignerChecks()
|
|||||||
enableMessage(WarnReferenceToParentItemNotSupportedByVisualDesigner);
|
enableMessage(WarnReferenceToParentItemNotSupportedByVisualDesigner);
|
||||||
enableMessage(WarnAboutQtQuick1InsteadQtQuick2);
|
enableMessage(WarnAboutQtQuick1InsteadQtQuick2);
|
||||||
enableMessage(ErrUnsupportedRootTypeInVisualDesigner);
|
enableMessage(ErrUnsupportedRootTypeInVisualDesigner);
|
||||||
|
enableMessage(ErrInvalidIdeInVisualDesigner);
|
||||||
//## triggers too often ## check.enableMessage(StaticAnalysis::WarnUndefinedValueForVisualDesigner);
|
//## triggers too often ## check.enableMessage(StaticAnalysis::WarnUndefinedValueForVisualDesigner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -645,6 +683,7 @@ void Check::disableQmlDesignerChecks()
|
|||||||
disableMessage(WarnUndefinedValueForVisualDesigner);
|
disableMessage(WarnUndefinedValueForVisualDesigner);
|
||||||
disableMessage(WarnStatesOnlyInRootItemForVisualDesigner);
|
disableMessage(WarnStatesOnlyInRootItemForVisualDesigner);
|
||||||
disableMessage(ErrUnsupportedRootTypeInVisualDesigner);
|
disableMessage(ErrUnsupportedRootTypeInVisualDesigner);
|
||||||
|
disableMessage(ErrInvalidIdeInVisualDesigner);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Check::enableQmlDesignerUiFileChecks()
|
void Check::enableQmlDesignerUiFileChecks()
|
||||||
@@ -927,6 +966,10 @@ bool Check::visit(UiScriptBinding *ast)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idsThatShouldNotBeUsedInDesigner->contains(id)) {
|
||||||
|
addMessage(ErrInvalidIdeInVisualDesigner, loc);
|
||||||
|
}
|
||||||
|
|
||||||
if (m_idStack.top().contains(id)) {
|
if (m_idStack.top().contains(id)) {
|
||||||
addMessage(ErrDuplicateId, loc);
|
addMessage(ErrDuplicateId, loc);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -271,6 +271,7 @@ QrcParserPrivate::QrcParserPrivate(QrcParser *)
|
|||||||
|
|
||||||
bool QrcParserPrivate::parseFile(const QString &path)
|
bool QrcParserPrivate::parseFile(const QString &path)
|
||||||
{
|
{
|
||||||
|
QDir baseDir(QFileInfo(path).path());
|
||||||
QFile file(path);
|
QFile file(path);
|
||||||
if (!file.open(QIODevice::ReadOnly)) {
|
if (!file.open(QIODevice::ReadOnly)) {
|
||||||
m_errorMessages.append(file.errorString());
|
m_errorMessages.append(file.errorString());
|
||||||
@@ -304,9 +305,8 @@ bool QrcParserPrivate::parseFile(const QString &path)
|
|||||||
QDomElement felt = relt.firstChildElement(QLatin1String("file"));
|
QDomElement felt = relt.firstChildElement(QLatin1String("file"));
|
||||||
for (; !felt.isNull(); felt = felt.nextSiblingElement(QLatin1String("file"))) {
|
for (; !felt.isNull(); felt = felt.nextSiblingElement(QLatin1String("file"))) {
|
||||||
const QString fileName = felt.text();
|
const QString fileName = felt.text();
|
||||||
QTC_CHECK(!QDir::isAbsolutePath(fileName));
|
|
||||||
const QString alias = felt.attribute(QLatin1String("alias"));
|
const QString alias = felt.attribute(QLatin1String("alias"));
|
||||||
QString filePath = QFileInfo(path).path() + QLatin1Char('/') + fileName;
|
QString filePath = baseDir.absoluteFilePath(fileName);
|
||||||
QString accessPath;
|
QString accessPath;
|
||||||
if (!alias.isEmpty())
|
if (!alias.isEmpty())
|
||||||
accessPath = language + prefix + alias;
|
accessPath = language + prefix + alias;
|
||||||
|
|||||||
@@ -220,6 +220,8 @@ StaticAnalysisMessages::StaticAnalysisMessages()
|
|||||||
"and might not show up in Qt Quick Designer as expected."));
|
"and might not show up in Qt Quick Designer as expected."));
|
||||||
newMsg(WarnStatesOnlyInRootItemForVisualDesigner, Warning,
|
newMsg(WarnStatesOnlyInRootItemForVisualDesigner, Warning,
|
||||||
tr("Qt Quick Designer only supports states in the root item."));
|
tr("Qt Quick Designer only supports states in the root item."));
|
||||||
|
newMsg(ErrInvalidIdeInVisualDesigner, Error,
|
||||||
|
tr("This id might be ambiguous and is not supported in the Qt Quick Designer."));
|
||||||
newMsg(WarnAboutQtQuick1InsteadQtQuick2, Warning,
|
newMsg(WarnAboutQtQuick1InsteadQtQuick2, Warning,
|
||||||
tr("Using Qt Quick 1 code model instead of Qt Quick 2."));
|
tr("Using Qt Quick 1 code model instead of Qt Quick 2."));
|
||||||
newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error,
|
newMsg(ErrUnsupportedRootTypeInVisualDesigner, Error,
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ enum Type
|
|||||||
WarnUndefinedValueForVisualDesigner = 206,
|
WarnUndefinedValueForVisualDesigner = 206,
|
||||||
WarnStatesOnlyInRootItemForVisualDesigner = 207,
|
WarnStatesOnlyInRootItemForVisualDesigner = 207,
|
||||||
ErrUnsupportedRootTypeInVisualDesigner = 208,
|
ErrUnsupportedRootTypeInVisualDesigner = 208,
|
||||||
|
ErrInvalidIdeInVisualDesigner = 209,
|
||||||
ErrUnsupportedRootTypeInQmlUi = 220,
|
ErrUnsupportedRootTypeInQmlUi = 220,
|
||||||
ErrUnsupportedTypeInQmlUi = 221,
|
ErrUnsupportedTypeInQmlUi = 221,
|
||||||
ErrFunctionsNotSupportedInQmlUi = 222,
|
ErrFunctionsNotSupportedInQmlUi = 222,
|
||||||
|
|||||||
@@ -202,14 +202,22 @@ static std::string findModule(CIDebugSymbols *syms,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Try to find a JS execution context passed as parameter in a complete stack dump (kp)
|
// Try to find a JS execution context passed as parameter in a complete stack dump (kp)
|
||||||
static ULONG64 jsExecutionContextFromStackTrace(const std::wstring &stack)
|
static ULONG64 jsExecutionEngineFromStackTrace(const std::wstring &stack)
|
||||||
{
|
{
|
||||||
// Search for "QV4::ExecutionContext * - varying variable names - 0x...[,)]"
|
// Search for "QV4::ExecutionEngine * - varying variable names - 0x...[,)]"
|
||||||
const wchar_t needle[] = L"struct QV4::ExecutionContext * "; // .. varying variable names .. 0x...
|
const wchar_t needle[] = L"struct QV4::ExecutionEngine * "; // Qt 5.7 onwards
|
||||||
const std::string::size_type varPos = stack.find(needle);
|
std::string::size_type varEnd = std::string::npos;
|
||||||
if (varPos == std::string::npos)
|
std::string::size_type varPos = stack.find(needle);
|
||||||
|
if (varPos != std::string::npos) {
|
||||||
|
varEnd = varPos + sizeof(needle) / sizeof(wchar_t) - 1;
|
||||||
|
} else {
|
||||||
|
const wchar_t needle56[] = L"struct QV4::ExecutionContext * "; // up to Qt 5.6
|
||||||
|
varPos = stack.find(needle56);
|
||||||
|
if (varPos != std::string::npos)
|
||||||
|
varEnd = varPos + sizeof(needle56) / sizeof(wchar_t) - 1;
|
||||||
|
}
|
||||||
|
if (varEnd == std::string::npos)
|
||||||
return 0;
|
return 0;
|
||||||
const std::string::size_type varEnd = varPos + sizeof(needle) / sizeof(wchar_t) - 1;
|
|
||||||
std::string::size_type numPos = stack.find(L"0x", varEnd);
|
std::string::size_type numPos = stack.find(L"0x", varEnd);
|
||||||
if (numPos == std::string::npos || numPos > (varEnd + 20))
|
if (numPos == std::string::npos || numPos > (varEnd + 20))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -227,10 +235,10 @@ static ULONG64 jsExecutionContextFromStackTrace(const std::wstring &stack)
|
|||||||
return str.fail() ? 0 : result;
|
return str.fail() ? 0 : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to find address of jsExecutionContext by looking at the
|
// Try to find address of jsExecutionEngine by looking at the
|
||||||
// stack trace in case QML is loaded.
|
// stack trace in case QML is loaded.
|
||||||
ULONG64 ExtensionContext::jsExecutionContext(ExtensionCommandContext &exc,
|
ULONG64 ExtensionContext::jsExecutionEngine(ExtensionCommandContext &exc,
|
||||||
std::string *errorMessage)
|
std::string *errorMessage)
|
||||||
{
|
{
|
||||||
|
|
||||||
const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()));
|
const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()));
|
||||||
@@ -241,10 +249,10 @@ ULONG64 ExtensionContext::jsExecutionContext(ExtensionCommandContext &exc,
|
|||||||
*errorMessage = "QML not loaded";
|
*errorMessage = "QML not loaded";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// Retrieve full stack (costly) and try to find a JS execution context passed as parameter
|
// Retrieve top frames of stack and try to find a JS execution engine passed as parameter
|
||||||
startRecordingOutput();
|
startRecordingOutput();
|
||||||
StateNotificationBlocker blocker(this);
|
StateNotificationBlocker blocker(this);
|
||||||
const HRESULT hr = m_control->Execute(DEBUG_OUTCTL_ALL_CLIENTS, "kp", DEBUG_EXECUTE_ECHO);
|
const HRESULT hr = m_control->Execute(DEBUG_OUTCTL_ALL_CLIENTS, "kp 15", DEBUG_EXECUTE_ECHO);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
stopRecordingOutput();
|
stopRecordingOutput();
|
||||||
*errorMessage = msgDebugEngineComFailed("Execute", hr);
|
*errorMessage = msgDebugEngineComFailed("Execute", hr);
|
||||||
@@ -255,9 +263,9 @@ ULONG64 ExtensionContext::jsExecutionContext(ExtensionCommandContext &exc,
|
|||||||
*errorMessage = "Unable to obtain stack (output redirection in place?)";
|
*errorMessage = "Unable to obtain stack (output redirection in place?)";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
const ULONG64 result = jsExecutionContextFromStackTrace(fullStackTrace);
|
const ULONG64 result = jsExecutionEngineFromStackTrace(fullStackTrace);
|
||||||
if (!result)
|
if (!result)
|
||||||
*errorMessage = "JS ExecutionContext address not found in stack";
|
*errorMessage = "JS ExecutionEngine address not found in stack";
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public:
|
|||||||
const Parameters ¶meters() const { return m_parameters; }
|
const Parameters ¶meters() const { return m_parameters; }
|
||||||
Parameters ¶meters() { return m_parameters; }
|
Parameters ¶meters() { return m_parameters; }
|
||||||
|
|
||||||
ULONG64 jsExecutionContext(ExtensionCommandContext &exc, std::string *errorMessage);
|
ULONG64 jsExecutionEngine(ExtensionCommandContext &exc, std::string *errorMessage);
|
||||||
|
|
||||||
bool stateNotification() const { return m_stateNotification; }
|
bool stateNotification() const { return m_stateNotification; }
|
||||||
void setStateNotification(bool s) { m_stateNotification = s; }
|
void setStateNotification(bool s) { m_stateNotification = s; }
|
||||||
|
|||||||
@@ -1091,7 +1091,7 @@ extern "C" HRESULT CALLBACK qmlstack(CIDebugClient *client, PCSTR argsIn)
|
|||||||
|
|
||||||
int token = 0;
|
int token = 0;
|
||||||
bool humanReadable = false;
|
bool humanReadable = false;
|
||||||
ULONG64 jsExecutionContext = 0;
|
ULONG64 jsExecutionEngine = 0;
|
||||||
std::string stackDump;
|
std::string stackDump;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -1101,16 +1101,16 @@ extern "C" HRESULT CALLBACK qmlstack(CIDebugClient *client, PCSTR argsIn)
|
|||||||
tokens.pop_front();
|
tokens.pop_front();
|
||||||
}
|
}
|
||||||
if (!tokens.empty()) {
|
if (!tokens.empty()) {
|
||||||
if (!integerFromString(tokens.front(), &jsExecutionContext)) {
|
if (!integerFromString(tokens.front(), &jsExecutionEngine)) {
|
||||||
errorMessage = "Invalid address " + tokens.front();
|
errorMessage = "Invalid address " + tokens.front();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tokens.pop_front();
|
tokens.pop_front();
|
||||||
}
|
}
|
||||||
ExtensionCommandContext exc(client);
|
ExtensionCommandContext exc(client);
|
||||||
if (!jsExecutionContext) { // Try to find execution context unless it was given.
|
if (!jsExecutionEngine) { // Try to find execution engine unless it was given.
|
||||||
jsExecutionContext = ExtensionContext::instance().jsExecutionContext(exc, &errorMessage);
|
jsExecutionEngine = ExtensionContext::instance().jsExecutionEngine(exc, &errorMessage);
|
||||||
if (!jsExecutionContext)
|
if (!jsExecutionEngine)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// call function to get stack trace. Call with exceptions handled right from
|
// call function to get stack trace. Call with exceptions handled right from
|
||||||
@@ -1118,7 +1118,7 @@ extern "C" HRESULT CALLBACK qmlstack(CIDebugClient *client, PCSTR argsIn)
|
|||||||
std::ostringstream callStr;
|
std::ostringstream callStr;
|
||||||
const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()));
|
const QtInfo &qtInfo = QtInfo::get(SymbolGroupValueContext(exc.dataSpaces(), exc.symbols()));
|
||||||
callStr << qtInfo.prependQtModule("qt_v4StackTrace(", QtInfo::Qml) << std::showbase << std::hex
|
callStr << qtInfo.prependQtModule("qt_v4StackTrace(", QtInfo::Qml) << std::showbase << std::hex
|
||||||
<< jsExecutionContext << std::dec << std::noshowbase << ')';
|
<< jsExecutionEngine << std::dec << std::noshowbase << ')';
|
||||||
std::wstring wOutput;
|
std::wstring wOutput;
|
||||||
if (!ExtensionContext::instance().call(callStr.str(), ExtensionContext::CallWithExceptionsHandled, &wOutput, &errorMessage))
|
if (!ExtensionContext::instance().call(callStr.str(), ExtensionContext::CallWithExceptionsHandled, &wOutput, &errorMessage))
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -54,8 +54,8 @@
|
|||||||
|
|
||||||
void MyClass::updateOtherObject()
|
void MyClass::updateOtherObject()
|
||||||
{
|
{
|
||||||
GuardLocker updatelocker(updateGuard);
|
GuardLocker updatelocker(updateGuard);
|
||||||
otherObject->update(); // this may trigger a signal
|
otherObject->update(); // this may trigger a signal
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
@@ -66,16 +66,16 @@
|
|||||||
\code
|
\code
|
||||||
void MyClass::otherObjectUpdated()
|
void MyClass::otherObjectUpdated()
|
||||||
{
|
{
|
||||||
if (updateGuard.isLocked)
|
if (updateGuard.isLocked())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// we didn't trigger the update
|
// we didn't trigger the update
|
||||||
// so do update now
|
// so do update now
|
||||||
\dots
|
\dots
|
||||||
}
|
}
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
The GuardLock unlocks the Guard in it's destructor.
|
The GuardLocker unlocks the Guard in its destructor.
|
||||||
|
|
||||||
The Guard object is recursive, you may declare many GuardLocker
|
The Guard object is recursive, you may declare many GuardLocker
|
||||||
objects for the same Guard instance and the Guard will be locked
|
objects for the same Guard instance and the Guard will be locked
|
||||||
|
|||||||
BIN
src/libs/utils/images/fittoview.png
Normal file
|
After Width: | Height: | Size: 114 B |
BIN
src/libs/utils/images/fittoview@2x.png
Normal file
|
After Width: | Height: | Size: 126 B |
|
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 130 B |
|
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
BIN
src/libs/utils/images/zoomin_overlay.png
Normal file
|
After Width: | Height: | Size: 98 B |
BIN
src/libs/utils/images/zoomin_overlay@2x.png
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
src/libs/utils/images/zoomout_overlay.png
Normal file
|
After Width: | Height: | Size: 94 B |
BIN
src/libs/utils/images/zoomout_overlay@2x.png
Normal file
|
After Width: | Height: | Size: 97 B |
@@ -318,11 +318,7 @@ public:
|
|||||||
IconOverlayPrf,
|
IconOverlayPrf,
|
||||||
IconOverlayPro,
|
IconOverlayPro,
|
||||||
StandardPixmapFileIcon,
|
StandardPixmapFileIcon,
|
||||||
StandardPixmapDirIcon,
|
StandardPixmapDirIcon
|
||||||
BuildStepDisable,
|
|
||||||
BuildStepRemove,
|
|
||||||
BuildStepMoveDown,
|
|
||||||
BuildStepMoveUp
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Flag {
|
enum Flag {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
<file>images/notloaded@2x.png</file>
|
<file>images/notloaded@2x.png</file>
|
||||||
<file>images/ok.png</file>
|
<file>images/ok.png</file>
|
||||||
<file>images/ok@2x.png</file>
|
<file>images/ok@2x.png</file>
|
||||||
|
|
||||||
<file>images/clean_pane_small.png</file>
|
<file>images/clean_pane_small.png</file>
|
||||||
<file>images/clean_pane_small@2x.png</file>
|
<file>images/clean_pane_small@2x.png</file>
|
||||||
<file>images/compile_error_taskbar.png</file>
|
<file>images/compile_error_taskbar.png</file>
|
||||||
@@ -161,5 +160,13 @@
|
|||||||
<file>images/bookmark@2x.png</file>
|
<file>images/bookmark@2x.png</file>
|
||||||
<file>images/snapshot.png</file>
|
<file>images/snapshot.png</file>
|
||||||
<file>images/snapshot@2x.png</file>
|
<file>images/snapshot@2x.png</file>
|
||||||
|
<file>images/zoomin_overlay.png</file>
|
||||||
|
<file>images/zoomin_overlay@2x.png</file>
|
||||||
|
<file>images/zoomout_overlay.png</file>
|
||||||
|
<file>images/zoomout_overlay@2x.png</file>
|
||||||
|
<file>images/fittoview.png</file>
|
||||||
|
<file>images/fittoview@2x.png</file>
|
||||||
|
<file>images/namespace.png</file>
|
||||||
|
<file>images/namespace@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -48,6 +48,14 @@ const Icon ZOOM({
|
|||||||
{QLatin1String(":/utils/images/zoom.png"), Theme::PanelTextColorMid}}, Icon::Tint);
|
{QLatin1String(":/utils/images/zoom.png"), Theme::PanelTextColorMid}}, Icon::Tint);
|
||||||
const Icon ZOOM_TOOLBAR({
|
const Icon ZOOM_TOOLBAR({
|
||||||
{QLatin1String(":/utils/images/zoom.png"), Theme::IconsBaseColor}});
|
{QLatin1String(":/utils/images/zoom.png"), Theme::IconsBaseColor}});
|
||||||
|
const Icon ZOOMIN_TOOLBAR({
|
||||||
|
{QLatin1String(":/utils/images/zoom.png"), Theme::IconsBaseColor},
|
||||||
|
{QLatin1String(":/utils/images/zoomin_overlay.png"), Theme::IconsBaseColor}});
|
||||||
|
const Icon ZOOMOUT_TOOLBAR({
|
||||||
|
{QLatin1String(":/utils/images/zoom.png"), Theme::IconsBaseColor},
|
||||||
|
{QLatin1String(":/utils/images/zoomout_overlay.png"), Theme::IconsBaseColor}});
|
||||||
|
const Icon FITTOVIEW_TOOLBAR({
|
||||||
|
{QLatin1String(":/utils/images/fittoview.png"), Theme::IconsBaseColor}});
|
||||||
const Icon OK({
|
const Icon OK({
|
||||||
{QLatin1String(":/utils/images/ok.png"), Theme::IconsRunToolBarColor}}, Icon::Tint);
|
{QLatin1String(":/utils/images/ok.png"), Theme::IconsRunToolBarColor}}, Icon::Tint);
|
||||||
const Icon NOTLOADED({
|
const Icon NOTLOADED({
|
||||||
|
|||||||
@@ -41,6 +41,9 @@ QTCREATOR_UTILS_EXPORT extern const Icon PREV;
|
|||||||
QTCREATOR_UTILS_EXPORT extern const Icon PREV_TOOLBAR;
|
QTCREATOR_UTILS_EXPORT extern const Icon PREV_TOOLBAR;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon ZOOM;
|
QTCREATOR_UTILS_EXPORT extern const Icon ZOOM;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon ZOOM_TOOLBAR;
|
QTCREATOR_UTILS_EXPORT extern const Icon ZOOM_TOOLBAR;
|
||||||
|
QTCREATOR_UTILS_EXPORT extern const Icon ZOOMIN_TOOLBAR;
|
||||||
|
QTCREATOR_UTILS_EXPORT extern const Icon ZOOMOUT_TOOLBAR;
|
||||||
|
QTCREATOR_UTILS_EXPORT extern const Icon FITTOVIEW_TOOLBAR;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon OK;
|
QTCREATOR_UTILS_EXPORT extern const Icon OK;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon NOTLOADED;
|
QTCREATOR_UTILS_EXPORT extern const Icon NOTLOADED;
|
||||||
QTCREATOR_UTILS_EXPORT extern const Icon BROKEN;
|
QTCREATOR_UTILS_EXPORT extern const Icon BROKEN;
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ HEADERS += \
|
|||||||
quick/quicktestvisitors.h \
|
quick/quicktestvisitors.h \
|
||||||
quick/quicktestframework.h \
|
quick/quicktestframework.h \
|
||||||
testframeworkmanager.h \
|
testframeworkmanager.h \
|
||||||
testrunconfiguration.h
|
testrunconfiguration.h \
|
||||||
|
itestsettingspage.h
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
autotest.qrc
|
autotest.qrc
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ QtcPlugin {
|
|||||||
"itestparser.h",
|
"itestparser.h",
|
||||||
"itestframework.h",
|
"itestframework.h",
|
||||||
"iframeworksettings.h",
|
"iframeworksettings.h",
|
||||||
|
"itestsettingspage.h",
|
||||||
"testframeworkmanager.cpp",
|
"testframeworkmanager.cpp",
|
||||||
"testframeworkmanager.h",
|
"testframeworkmanager.h",
|
||||||
"testrunconfiguration.h"
|
"testrunconfiguration.h"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const char AUTOTEST_SETTINGS_CATEGORY[] = "ZY.Tests";
|
|||||||
const char AUTOTEST_SETTINGS_TR[] = QT_TRANSLATE_NOOP("AutoTest", "Test Settings");
|
const char AUTOTEST_SETTINGS_TR[] = QT_TRANSLATE_NOOP("AutoTest", "Test Settings");
|
||||||
const char FRAMEWORK_PREFIX[] = "AutoTest.Framework.";
|
const char FRAMEWORK_PREFIX[] = "AutoTest.Framework.";
|
||||||
|
|
||||||
|
const char SETTINGSPAGE_PREFIX[] = "A.AutoTest.";
|
||||||
const char SETTINGSGROUP[] = "Autotest";
|
const char SETTINGSGROUP[] = "Autotest";
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
} // namespace Autotest
|
} // namespace Autotest
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ void AutotestPlugin::initializeMenuEntries()
|
|||||||
{
|
{
|
||||||
ActionContainer *menu = ActionManager::createMenu(Constants::MENU_ID);
|
ActionContainer *menu = ActionManager::createMenu(Constants::MENU_ID);
|
||||||
menu->menu()->setTitle(tr("&Tests"));
|
menu->menu()->setTitle(tr("&Tests"));
|
||||||
|
menu->setOnAllDisabledBehavior(ActionContainer::Show);
|
||||||
|
|
||||||
QAction *action = new QAction(tr("Run &All Tests"), this);
|
QAction *action = new QAction(tr("Run &All Tests"), this);
|
||||||
Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID);
|
Command *command = ActionManager::registerAction(action, Constants::ACTION_RUN_ALL_ID);
|
||||||
|
|||||||
@@ -61,9 +61,9 @@ IFrameworkSettings *GTestFramework::createFrameworkSettings() const
|
|||||||
return new GTestSettings;
|
return new GTestSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IOptionsPage *GTestFramework::createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
ITestSettingsPage *GTestFramework::createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
||||||
{
|
{
|
||||||
return new GTestSettingsPage(settings);
|
return new GTestSettingsPage(settings, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GTestFramework::hasFrameworkSettings() const
|
bool GTestFramework::hasFrameworkSettings() const
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
IFrameworkSettings *createFrameworkSettings() const override;
|
IFrameworkSettings *createFrameworkSettings() const override;
|
||||||
Core::IOptionsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const override;
|
ITestSettingsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const override;
|
||||||
bool hasFrameworkSettings() const override;
|
bool hasFrameworkSettings() const override;
|
||||||
protected:
|
protected:
|
||||||
ITestParser *createTestParser() const override;
|
ITestParser *createTestParser() const override;
|
||||||
|
|||||||
@@ -65,18 +65,14 @@ GTestSettings GTestSettingsWidget::settings() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
GTestSettingsPage::GTestSettingsPage(QSharedPointer<IFrameworkSettings> settings)
|
GTestSettingsPage::GTestSettingsPage(QSharedPointer<IFrameworkSettings> settings,
|
||||||
: m_settings(qSharedPointerCast<GTestSettings>(settings)), m_widget(0)
|
const ITestFramework *framework)
|
||||||
|
: ITestSettingsPage(framework),
|
||||||
|
m_settings(qSharedPointerCast<GTestSettings>(settings)),
|
||||||
|
m_widget(0)
|
||||||
{
|
{
|
||||||
setId("A.AutoTest.10.GTest"); // FIXME
|
|
||||||
setDisplayName(QCoreApplication::translate("GTestFramework",
|
setDisplayName(QCoreApplication::translate("GTestFramework",
|
||||||
GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
GTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayCategory(QCoreApplication::translate("AutoTest", Constants::AUTOTEST_SETTINGS_TR));
|
|
||||||
}
|
|
||||||
|
|
||||||
GTestSettingsPage::~GTestSettingsPage()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *GTestSettingsPage::widget()
|
QWidget *GTestSettingsPage::widget()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "ui_gtestsettingspage.h"
|
#include "ui_gtestsettingspage.h"
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include "../itestsettingspage.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
@@ -50,12 +50,11 @@ private:
|
|||||||
Ui::GTestSettingsPage m_ui;
|
Ui::GTestSettingsPage m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GTestSettingsPage : public Core::IOptionsPage
|
class GTestSettingsPage : public ITestSettingsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit GTestSettingsPage(QSharedPointer<IFrameworkSettings> settings);
|
GTestSettingsPage(QSharedPointer<IFrameworkSettings> settings, const ITestFramework *framework);
|
||||||
~GTestSettingsPage();
|
|
||||||
|
|
||||||
QWidget *widget() override;
|
QWidget *widget() override;
|
||||||
void apply() override;
|
void apply() override;
|
||||||
|
|||||||
@@ -28,12 +28,11 @@
|
|||||||
#include "testtreeitem.h"
|
#include "testtreeitem.h"
|
||||||
#include "itestparser.h"
|
#include "itestparser.h"
|
||||||
|
|
||||||
namespace Core { class IOptionsPage; }
|
|
||||||
|
|
||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class IFrameworkSettings;
|
class IFrameworkSettings;
|
||||||
|
class ITestSettingsPage;
|
||||||
|
|
||||||
class ITestFramework
|
class ITestFramework
|
||||||
{
|
{
|
||||||
@@ -49,7 +48,7 @@ public:
|
|||||||
virtual unsigned priority() const = 0; // should this be modifyable?
|
virtual unsigned priority() const = 0; // should this be modifyable?
|
||||||
virtual bool hasFrameworkSettings() const { return false; }
|
virtual bool hasFrameworkSettings() const { return false; }
|
||||||
virtual IFrameworkSettings *createFrameworkSettings() const { return 0; }
|
virtual IFrameworkSettings *createFrameworkSettings() const { return 0; }
|
||||||
virtual Core::IOptionsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
virtual ITestSettingsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(settings);
|
Q_UNUSED(settings);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -25,30 +25,46 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
namespace QbsProjectManager {
|
#include "autotestconstants.h"
|
||||||
namespace Constants {
|
#include "itestframework.h"
|
||||||
|
|
||||||
// Toolchain related settings:
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
const char QBS_TARGETOS[] = "qbs.targetOS";
|
|
||||||
const char QBS_SYSROOT[] = "qbs.sysroot";
|
|
||||||
const char QBS_ARCHITECTURE[] = "qbs.architecture";
|
|
||||||
const char QBS_TOOLCHAIN[] = "qbs.toolchain";
|
|
||||||
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
|
|
||||||
const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
|
|
||||||
const char CPP_COMPILERNAME[] = "cpp.compilerName";
|
|
||||||
const char CPP_CXXCOMPILERNAME[] = "cpp.cxxCompilerName";
|
|
||||||
const char CPP_PLATFORMCOMMONCOMPILERFLAGS[] = "cpp.platformCommonCompilerFlags";
|
|
||||||
const char CPP_PLATFORMLINKERFLAGS[] = "cpp.platformLinkerFlags";
|
|
||||||
const char CPP_PLATFORMPATH[] = "cpp.platformPath";
|
|
||||||
const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName";
|
|
||||||
const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion";
|
|
||||||
|
|
||||||
// Settings page
|
namespace Autotest {
|
||||||
const char QBS_SETTINGS_CATEGORY[] = "YM.qbs";
|
namespace Internal {
|
||||||
const char QBS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("QbsProjectManager", "Qbs");
|
|
||||||
const char QBS_SETTINGS_CATEGORY_ICON[] = ":/projectexplorer/images/build.png";
|
|
||||||
|
|
||||||
const char QBS_PROPERTIES_KEY_FOR_KITS[] = "QbsProjectManager.qbs-properties";
|
class IFrameworkSettings;
|
||||||
|
|
||||||
} // namespace Constants
|
class ITestSettingsPage : public Core::IOptionsPage
|
||||||
} // namespace QbsProjectManager
|
{
|
||||||
|
public:
|
||||||
|
explicit ITestSettingsPage(const ITestFramework *framework)
|
||||||
|
{
|
||||||
|
setId(Core::Id(Constants::SETTINGSPAGE_PREFIX).withSuffix(
|
||||||
|
QString("%1.%2").arg(framework->priority()).arg(QLatin1String(framework->name()))));
|
||||||
|
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
||||||
|
setDisplayCategory(QCoreApplication::translate("AutoTest",
|
||||||
|
Constants::AUTOTEST_SETTINGS_TR));
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~ITestSettingsPage() {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setId(Core::Id id)
|
||||||
|
{
|
||||||
|
Core::IOptionsPage::setId(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCategory(Core::Id category)
|
||||||
|
{
|
||||||
|
Core::IOptionsPage::setCategory(category);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setDisplayCategory(const QString &displayCategory)
|
||||||
|
{
|
||||||
|
Core::IOptionsPage::setDisplayCategory(displayCategory);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
} // namespace Autotest
|
||||||
@@ -51,9 +51,9 @@ IFrameworkSettings *QtTestFramework::createFrameworkSettings() const
|
|||||||
return new QtTestSettings;
|
return new QtTestSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::IOptionsPage *QtTestFramework::createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
ITestSettingsPage *QtTestFramework::createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const
|
||||||
{
|
{
|
||||||
return new QtTestSettingsPage(settings);
|
return new QtTestSettingsPage(settings, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtTestFramework::hasFrameworkSettings() const
|
bool QtTestFramework::hasFrameworkSettings() const
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
const char *name() const override;
|
const char *name() const override;
|
||||||
unsigned priority() const override;
|
unsigned priority() const override;
|
||||||
IFrameworkSettings *createFrameworkSettings() const override;
|
IFrameworkSettings *createFrameworkSettings() const override;
|
||||||
Core::IOptionsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const override;
|
ITestSettingsPage *createSettingsPage(QSharedPointer<IFrameworkSettings> settings) const override;
|
||||||
bool hasFrameworkSettings() const override;
|
bool hasFrameworkSettings() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -86,18 +86,14 @@ QtTestSettings QtTestSettingsWidget::settings() const
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
QtTestSettingsPage::QtTestSettingsPage(QSharedPointer<IFrameworkSettings> settings)
|
QtTestSettingsPage::QtTestSettingsPage(QSharedPointer<IFrameworkSettings> settings,
|
||||||
: m_settings(qSharedPointerCast<QtTestSettings>(settings)), m_widget(0)
|
const ITestFramework *framework)
|
||||||
|
: ITestSettingsPage(framework),
|
||||||
|
m_settings(qSharedPointerCast<QtTestSettings>(settings)),
|
||||||
|
m_widget(0)
|
||||||
{
|
{
|
||||||
setId("A.AutoTest.1.QtTest"); // FIXME
|
|
||||||
setDisplayName(QCoreApplication::translate("QtTestFramework",
|
setDisplayName(QCoreApplication::translate("QtTestFramework",
|
||||||
QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
QtTest::Constants::FRAMEWORK_SETTINGS_CATEGORY));
|
||||||
setCategory(Constants::AUTOTEST_SETTINGS_CATEGORY);
|
|
||||||
setDisplayCategory(QCoreApplication::translate("AutoTest", Constants::AUTOTEST_SETTINGS_TR));
|
|
||||||
}
|
|
||||||
|
|
||||||
QtTestSettingsPage::~QtTestSettingsPage()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *QtTestSettingsPage::widget()
|
QWidget *QtTestSettingsPage::widget()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "ui_qttestsettingspage.h"
|
#include "ui_qttestsettingspage.h"
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
#include "../itestsettingspage.h"
|
||||||
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
@@ -50,12 +50,11 @@ private:
|
|||||||
Ui::QtTestSettingsPage m_ui;
|
Ui::QtTestSettingsPage m_ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QtTestSettingsPage : public Core::IOptionsPage
|
class QtTestSettingsPage : public ITestSettingsPage
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QtTestSettingsPage(QSharedPointer<IFrameworkSettings> settings);
|
QtTestSettingsPage(QSharedPointer<IFrameworkSettings> settings, const ITestFramework *framework);
|
||||||
~QtTestSettingsPage();
|
|
||||||
|
|
||||||
QWidget *widget() override;
|
QWidget *widget() override;
|
||||||
void apply() override;
|
void apply() override;
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
#include <QFuture>
|
#include <QFuture>
|
||||||
#include <QFutureInterface>
|
#include <QFutureInterface>
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QTimer>
|
|
||||||
|
|
||||||
static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.testcodeparser")
|
static Q_LOGGING_CATEGORY(LOG, "qtc.autotest.testcodeparser")
|
||||||
|
|
||||||
@@ -54,13 +53,7 @@ namespace Internal {
|
|||||||
|
|
||||||
TestCodeParser::TestCodeParser(TestTreeModel *parent)
|
TestCodeParser::TestCodeParser(TestTreeModel *parent)
|
||||||
: QObject(parent),
|
: QObject(parent),
|
||||||
m_model(parent),
|
m_model(parent)
|
||||||
m_codeModelParsing(false),
|
|
||||||
m_fullUpdatePostponed(false),
|
|
||||||
m_partialUpdatePostponed(false),
|
|
||||||
m_dirty(false),
|
|
||||||
m_singleShotScheduled(false),
|
|
||||||
m_parserState(Disabled)
|
|
||||||
{
|
{
|
||||||
// connect to ProgressManager to postpone test parsing when CppModelManager is parsing
|
// connect to ProgressManager to postpone test parsing when CppModelManager is parsing
|
||||||
auto progressManager = qobject_cast<Core::ProgressManager *>(Core::ProgressManager::instance());
|
auto progressManager = qobject_cast<Core::ProgressManager *>(Core::ProgressManager::instance());
|
||||||
@@ -77,6 +70,8 @@ TestCodeParser::TestCodeParser(TestTreeModel *parent)
|
|||||||
emit testParseResultReady(m_futureWatcher.resultAt(index));
|
emit testParseResultReady(m_futureWatcher.resultAt(index));
|
||||||
});
|
});
|
||||||
connect(this, &TestCodeParser::parsingFinished, this, &TestCodeParser::releaseParserInternals);
|
connect(this, &TestCodeParser::parsingFinished, this, &TestCodeParser::releaseParserInternals);
|
||||||
|
m_reparseTimer.setSingleShot(true);
|
||||||
|
connect(&m_reparseTimer, &QTimer::timeout, this, &TestCodeParser::parsePostponedFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
TestCodeParser::~TestCodeParser()
|
TestCodeParser::~TestCodeParser()
|
||||||
@@ -111,7 +106,8 @@ void TestCodeParser::setState(State state)
|
|||||||
} else if (m_partialUpdatePostponed) {
|
} else if (m_partialUpdatePostponed) {
|
||||||
m_partialUpdatePostponed = false;
|
m_partialUpdatePostponed = false;
|
||||||
qCDebug(LOG) << "calling scanForTests with postponed files (setState)";
|
qCDebug(LOG) << "calling scanForTests with postponed files (setState)";
|
||||||
scanForTests(m_postponedFiles.toList());
|
if (!m_reparseTimer.isActive())
|
||||||
|
scanForTests(m_postponedFiles.toList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -267,6 +263,30 @@ bool TestCodeParser::postponed(const QStringList &fileList)
|
|||||||
{
|
{
|
||||||
switch (m_parserState) {
|
switch (m_parserState) {
|
||||||
case Idle:
|
case Idle:
|
||||||
|
if (fileList.size() == 1) {
|
||||||
|
if (m_reparseTimerTimedOut)
|
||||||
|
return false;
|
||||||
|
switch (m_postponedFiles.size()) {
|
||||||
|
case 0:
|
||||||
|
m_postponedFiles.insert(fileList.first());
|
||||||
|
m_reparseTimer.setInterval(1000);
|
||||||
|
m_reparseTimer.start();
|
||||||
|
return true;
|
||||||
|
case 1:
|
||||||
|
if (m_postponedFiles.contains(fileList.first())) {
|
||||||
|
m_reparseTimer.start();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// intentional fall-through
|
||||||
|
default:
|
||||||
|
m_postponedFiles.insert(fileList.first());
|
||||||
|
m_reparseTimer.stop();
|
||||||
|
m_reparseTimer.setInterval(0);
|
||||||
|
m_reparseTimerTimedOut = false;
|
||||||
|
m_reparseTimer.start();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
case PartialParse:
|
case PartialParse:
|
||||||
case FullParse:
|
case FullParse:
|
||||||
@@ -313,6 +333,8 @@ void TestCodeParser::scanForTests(const QStringList &fileList)
|
|||||||
if (postponed(fileList))
|
if (postponed(fileList))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
m_reparseTimer.stop();
|
||||||
|
m_reparseTimerTimedOut = false;
|
||||||
m_postponedFiles.clear();
|
m_postponedFiles.clear();
|
||||||
bool isFullParse = fileList.isEmpty();
|
bool isFullParse = fileList.isEmpty();
|
||||||
QStringList list;
|
QStringList list;
|
||||||
@@ -436,7 +458,8 @@ void TestCodeParser::onPartialParsingFinished()
|
|||||||
} else if (m_partialUpdatePostponed) {
|
} else if (m_partialUpdatePostponed) {
|
||||||
m_partialUpdatePostponed = false;
|
m_partialUpdatePostponed = false;
|
||||||
qCDebug(LOG) << "calling scanForTests with postponed files (onPartialParsingFinished)";
|
qCDebug(LOG) << "calling scanForTests with postponed files (onPartialParsingFinished)";
|
||||||
scanForTests(m_postponedFiles.toList());
|
if (!m_reparseTimer.isActive())
|
||||||
|
scanForTests(m_postponedFiles.toList());
|
||||||
} else {
|
} else {
|
||||||
m_dirty |= m_codeModelParsing;
|
m_dirty |= m_codeModelParsing;
|
||||||
if (m_dirty) {
|
if (m_dirty) {
|
||||||
@@ -454,6 +477,12 @@ void TestCodeParser::onPartialParsingFinished()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestCodeParser::parsePostponedFiles()
|
||||||
|
{
|
||||||
|
m_reparseTimerTimedOut = true;
|
||||||
|
scanForTests(m_postponedFiles.toList());
|
||||||
|
}
|
||||||
|
|
||||||
void TestCodeParser::releaseParserInternals()
|
void TestCodeParser::releaseParserInternals()
|
||||||
{
|
{
|
||||||
for (ITestParser *parser : m_testCodeParsers)
|
for (ITestParser *parser : m_testCodeParsers)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
class Id;
|
class Id;
|
||||||
@@ -89,19 +90,22 @@ private:
|
|||||||
void onAllTasksFinished(Core::Id type);
|
void onAllTasksFinished(Core::Id type);
|
||||||
void onFinished();
|
void onFinished();
|
||||||
void onPartialParsingFinished();
|
void onPartialParsingFinished();
|
||||||
|
void parsePostponedFiles();
|
||||||
void releaseParserInternals();
|
void releaseParserInternals();
|
||||||
|
|
||||||
TestTreeModel *m_model;
|
TestTreeModel *m_model;
|
||||||
|
|
||||||
bool m_codeModelParsing;
|
bool m_codeModelParsing = false;
|
||||||
bool m_fullUpdatePostponed;
|
bool m_fullUpdatePostponed = false;
|
||||||
bool m_partialUpdatePostponed;
|
bool m_partialUpdatePostponed = false;
|
||||||
bool m_dirty;
|
bool m_dirty = false;
|
||||||
bool m_singleShotScheduled;
|
bool m_singleShotScheduled = false;
|
||||||
|
bool m_reparseTimerTimedOut = false;
|
||||||
QSet<QString> m_postponedFiles;
|
QSet<QString> m_postponedFiles;
|
||||||
State m_parserState;
|
State m_parserState = Disabled;
|
||||||
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
|
QFutureWatcher<TestParseResultPtr> m_futureWatcher;
|
||||||
QVector<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
|
QVector<ITestParser *> m_testCodeParsers; // ptrs are still owned by TestFrameworkManager
|
||||||
|
QTimer m_reparseTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -29,12 +29,12 @@
|
|||||||
#include "iframeworksettings.h"
|
#include "iframeworksettings.h"
|
||||||
#include "itestframework.h"
|
#include "itestframework.h"
|
||||||
#include "itestparser.h"
|
#include "itestparser.h"
|
||||||
|
#include "itestsettingspage.h"
|
||||||
#include "testrunner.h"
|
#include "testrunner.h"
|
||||||
#include "testsettings.h"
|
#include "testsettings.h"
|
||||||
#include "testtreeitem.h"
|
#include "testtreeitem.h"
|
||||||
#include "testtreemodel.h"
|
#include "testtreemodel.h"
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ void TestResultDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op
|
|||||||
}
|
}
|
||||||
|
|
||||||
painter->setClipRect(opt.rect);
|
painter->setClipRect(opt.rect);
|
||||||
painter->setPen(opt.palette.midlight().color());
|
painter->setPen(opt.palette.mid().color());
|
||||||
painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom());
|
painter->drawLine(0, opt.rect.bottom(), opt.rect.right(), opt.rect.bottom());
|
||||||
painter->restore();
|
painter->restore();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,8 +208,6 @@ void TestResultsPane::addTestResult(const TestResultPtr &result)
|
|||||||
m_atEnd = scrollBar ? scrollBar->value() == scrollBar->maximum() : true;
|
m_atEnd = scrollBar ? scrollBar->value() == scrollBar->maximum() : true;
|
||||||
|
|
||||||
m_model->addTestResult(result, m_expandCollapse->isChecked());
|
m_model->addTestResult(result, m_expandCollapse->isChecked());
|
||||||
if (!m_treeView->isVisible())
|
|
||||||
popup(Core::IOutputPane::NoModeSwitch);
|
|
||||||
setIconBadgeNumber(m_model->resultTypeCount(Result::Fail)
|
setIconBadgeNumber(m_model->resultTypeCount(Result::Fail)
|
||||||
+ m_model->resultTypeCount(Result::UnexpectedPass));
|
+ m_model->resultTypeCount(Result::UnexpectedPass));
|
||||||
flash();
|
flash();
|
||||||
@@ -498,6 +496,8 @@ void TestResultsPane::onTestRunFinished()
|
|||||||
m_model->removeCurrentTestMessage();
|
m_model->removeCurrentTestMessage();
|
||||||
disconnect(m_treeView->verticalScrollBar(), &QScrollBar::rangeChanged,
|
disconnect(m_treeView->verticalScrollBar(), &QScrollBar::rangeChanged,
|
||||||
this, &TestResultsPane::onScrollBarRangeChanged);
|
this, &TestResultsPane::onScrollBarRangeChanged);
|
||||||
|
if (!m_treeView->isVisible())
|
||||||
|
popup(Core::IOutputPane::NoModeSwitch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestResultsPane::onScrollBarRangeChanged(int, int max)
|
void TestResultsPane::onScrollBarRangeChanged(int, int max)
|
||||||
|
|||||||
@@ -47,3 +47,6 @@ HEADERS += baremetalplugin.h \
|
|||||||
openocdgdbserverprovider.h \
|
openocdgdbserverprovider.h \
|
||||||
defaultgdbserverprovider.h \
|
defaultgdbserverprovider.h \
|
||||||
stlinkutilgdbserverprovider.h
|
stlinkutilgdbserverprovider.h
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
baremetal.qrc
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ QtcPlugin {
|
|||||||
Depends { name: "QtSupport" }
|
Depends { name: "QtSupport" }
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
|
"baremetal.qrc",
|
||||||
"baremetalconstants.h",
|
"baremetalconstants.h",
|
||||||
"baremetalcustomrunconfiguration.cpp", "baremetalcustomrunconfiguration.h",
|
"baremetalcustomrunconfiguration.cpp", "baremetalcustomrunconfiguration.h",
|
||||||
"baremetaldevice.cpp", "baremetaldevice.h",
|
"baremetaldevice.cpp", "baremetaldevice.h",
|
||||||
|
|||||||
8
src/plugins/baremetal/baremetal.qrc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/baremetal">
|
||||||
|
<file>images/baremetaldevice.png</file>
|
||||||
|
<file>images/baremetaldevice@2x.png</file>
|
||||||
|
<file>images/baremetaldevicesmall.png</file>
|
||||||
|
<file>images/baremetaldevicesmall@2x.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <coreplugin/id.h>
|
#include <coreplugin/id.h>
|
||||||
|
|
||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
|
#include <utils/icon.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@@ -152,16 +153,28 @@ DeviceProcess *BareMetalDevice::createProcess(QObject *parent) const
|
|||||||
return new GdbServerProviderProcess(sharedFromThis(), parent);
|
return new GdbServerProviderProcess(sharedFromThis(), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const QList<Utils::Icon> &bareMetalDeviceIcon()
|
||||||
|
{
|
||||||
|
static const QList<Utils::Icon> icon = {
|
||||||
|
Utils::Icon({{":/baremetal/images/baremetaldevicesmall.png",
|
||||||
|
Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint),
|
||||||
|
Utils::Icon({{":/baremetal/images/baremetaldevice.png",
|
||||||
|
Utils::Theme::IconsBaseColor}})};
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
BareMetalDevice::BareMetalDevice(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
|
BareMetalDevice::BareMetalDevice(const QString &name, Core::Id type, MachineType machineType, Origin origin, Core::Id id)
|
||||||
: IDevice(type, origin, machineType, id)
|
: IDevice(type, origin, machineType, id)
|
||||||
{
|
{
|
||||||
setDisplayName(name);
|
setDisplayName(name);
|
||||||
|
setDeviceIcon(bareMetalDeviceIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
BareMetalDevice::BareMetalDevice(const BareMetalDevice &other)
|
BareMetalDevice::BareMetalDevice(const BareMetalDevice &other)
|
||||||
: IDevice(other)
|
: IDevice(other)
|
||||||
{
|
{
|
||||||
setGdbServerProviderId(other.gdbServerProviderId());
|
setGdbServerProviderId(other.gdbServerProviderId());
|
||||||
|
setDeviceIcon(bareMetalDeviceIcon());
|
||||||
}
|
}
|
||||||
|
|
||||||
} //namespace Internal
|
} //namespace Internal
|
||||||
|
|||||||
BIN
src/plugins/baremetal/images/baremetaldevice.png
Normal file
|
After Width: | Height: | Size: 184 B |
BIN
src/plugins/baremetal/images/baremetaldevice@2x.png
Normal file
|
After Width: | Height: | Size: 277 B |
BIN
src/plugins/baremetal/images/baremetaldevicesmall.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
src/plugins/baremetal/images/baremetaldevicesmall@2x.png
Normal file
|
After Width: | Height: | Size: 194 B |
@@ -190,7 +190,7 @@ private:
|
|||||||
const QString text = QString::fromLatin1(
|
const QString text = QString::fromLatin1(
|
||||||
"<table cellspacing='0' cellpadding='0'>"
|
"<table cellspacing='0' cellpadding='0'>"
|
||||||
" <tr>"
|
" <tr>"
|
||||||
" <td>%1: </td>"
|
" <td>%1: </td>"
|
||||||
" <td width='100%'>%2</td>"
|
" <td width='100%'>%2</td>"
|
||||||
" </tr>"
|
" </tr>"
|
||||||
"</table>")
|
"</table>")
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
#include <QSortFilterProxyModel>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
@@ -257,7 +258,10 @@ VariableChooserPrivate::VariableChooserPrivate(VariableChooser *parent)
|
|||||||
m_variableTree = new VariableTreeView(q, this);
|
m_variableTree = new VariableTreeView(q, this);
|
||||||
m_variableDescription = new QLabel(q);
|
m_variableDescription = new QLabel(q);
|
||||||
|
|
||||||
m_variableTree->setModel(&m_model);
|
auto sorter = new QSortFilterProxyModel(this);
|
||||||
|
sorter->setSourceModel(&m_model);
|
||||||
|
sorter->sort(0);
|
||||||
|
m_variableTree->setModel(sorter);
|
||||||
m_variableDescription->setText(m_defaultDescription);
|
m_variableDescription->setText(m_defaultDescription);
|
||||||
m_variableDescription->setMinimumSize(QSize(0, 60));
|
m_variableDescription->setMinimumSize(QSize(0, 60));
|
||||||
m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop);
|
m_variableDescription->setAlignment(Qt::AlignLeft|Qt::AlignTop);
|
||||||
|
|||||||
@@ -107,9 +107,9 @@ void ImageViewer::ctor()
|
|||||||
{QLatin1String(":/utils/images/desktopdevicesmall.png"), Utils::Theme::IconsBaseColor}});
|
{QLatin1String(":/utils/images/desktopdevicesmall.png"), Utils::Theme::IconsBaseColor}});
|
||||||
d->ui_toolbar.toolButtonBackground->setIcon(backgroundIcon.icon());
|
d->ui_toolbar.toolButtonBackground->setIcon(backgroundIcon.icon());
|
||||||
d->ui_toolbar.toolButtonOutline->setIcon(Utils::Icons::BOUNDING_RECT.icon());
|
d->ui_toolbar.toolButtonOutline->setIcon(Utils::Icons::BOUNDING_RECT.icon());
|
||||||
d->ui_toolbar.toolButtonZoomIn->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
d->ui_toolbar.toolButtonZoomIn->setIcon(Utils::Icons::ZOOMIN_TOOLBAR.icon());
|
||||||
d->ui_toolbar.toolButtonZoomOut->setIcon(Utils::Icons::MINUS.icon());
|
d->ui_toolbar.toolButtonZoomOut->setIcon(Utils::Icons::ZOOMOUT_TOOLBAR.icon());
|
||||||
d->ui_toolbar.toolButtonFitToScreen->setIcon(Utils::Icons::ZOOM_TOOLBAR.icon());
|
d->ui_toolbar.toolButtonFitToScreen->setIcon(Utils::Icons::FITTOVIEW_TOOLBAR.icon());
|
||||||
d->ui_toolbar.toolButtonOriginalSize->setIcon(Utils::Icons::EYE_OPEN_TOOLBAR.icon());
|
d->ui_toolbar.toolButtonOriginalSize->setIcon(Utils::Icons::EYE_OPEN_TOOLBAR.icon());
|
||||||
// icons update - try to use system theme
|
// icons update - try to use system theme
|
||||||
updateButtonIconByTheme(d->ui_toolbar.toolButtonZoomIn, QLatin1String("zoom-in"));
|
updateButtonIconByTheme(d->ui_toolbar.toolButtonZoomIn, QLatin1String("zoom-in"));
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ class TargetItem : public TypedTreeItem<TreeItem, TargetGroupItem>
|
|||||||
Q_DECLARE_TR_FUNCTIONS(TargetSettingsPanelWidget)
|
Q_DECLARE_TR_FUNCTIONS(TargetSettingsPanelWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum { DefaultPage = 1 }; // Run page.
|
enum { DefaultPage = 0 }; // Build page.
|
||||||
|
|
||||||
TargetItem(Project *project, Id kitId)
|
TargetItem(Project *project, Id kitId)
|
||||||
: m_project(project), m_kitId(kitId)
|
: m_project(project), m_kitId(kitId)
|
||||||
@@ -802,7 +802,7 @@ void TargetGroupItemPrivate::handleAddedKit(Kit *kit)
|
|||||||
void TargetItem::updateSubItems()
|
void TargetItem::updateSubItems()
|
||||||
{
|
{
|
||||||
if (children().isEmpty() && isEnabled())
|
if (children().isEmpty() && isEnabled())
|
||||||
m_currentChild = 1; // We will add children below. Use 'Run' item by default.
|
m_currentChild = DefaultPage; // We will add children below.
|
||||||
removeChildren();
|
removeChildren();
|
||||||
if (isEnabled()) {
|
if (isEnabled()) {
|
||||||
appendChild(new BuildOrRunItem(m_project, m_kitId, BuildOrRunItem::BuildPage));
|
appendChild(new BuildOrRunItem(m_project, m_kitId, BuildOrRunItem::BuildPage));
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "defaultpropertyprovider.h"
|
#include "defaultpropertyprovider.h"
|
||||||
#include "qbsconstants.h"
|
#include "qbsprojectmanagerconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <projectexplorer/abi.h>
|
#include <projectexplorer/abi.h>
|
||||||
|
|||||||
@@ -62,6 +62,42 @@ static const char QBS_CLEAN_INSTALL_ROOT[] = "Qbs.CleanInstallRoot";
|
|||||||
namespace QbsProjectManager {
|
namespace QbsProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class QbsBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
QbsBuildStepConfigWidget(QbsBuildStep *step);
|
||||||
|
~QbsBuildStepConfigWidget();
|
||||||
|
QString summaryText() const;
|
||||||
|
QString displayName() const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateState();
|
||||||
|
void updateQmlDebuggingOption();
|
||||||
|
void updatePropertyEdit(const QVariantMap &data);
|
||||||
|
|
||||||
|
void changeBuildVariant(int);
|
||||||
|
void changeShowCommandLines(bool show);
|
||||||
|
void changeKeepGoing(bool kg);
|
||||||
|
void changeJobCount(int count);
|
||||||
|
void changeInstall(bool install);
|
||||||
|
void changeCleanInstallRoot(bool clean);
|
||||||
|
void changeForceProbes(bool forceProbes);
|
||||||
|
void applyCachedProperties();
|
||||||
|
|
||||||
|
// QML debugging:
|
||||||
|
void linkQmlDebuggingLibraryChecked(bool checked);
|
||||||
|
|
||||||
|
bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage);
|
||||||
|
|
||||||
|
Ui::QbsBuildStepConfigWidget *m_ui;
|
||||||
|
|
||||||
|
QList<QPair<QString, QString> > m_propertyCache;
|
||||||
|
QbsBuildStep *m_step;
|
||||||
|
QString m_summary;
|
||||||
|
bool m_ignoreChange;
|
||||||
|
};
|
||||||
|
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
// QbsBuildStep:
|
// QbsBuildStep:
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
@@ -752,3 +788,5 @@ ProjectExplorer::BuildStep *QbsBuildStepFactory::clone(ProjectExplorer::BuildSte
|
|||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace QbsProjectManager
|
} // namespace QbsProjectManager
|
||||||
|
|
||||||
|
#include "qbsbuildstep.moc"
|
||||||
|
|||||||
@@ -125,44 +125,6 @@ private:
|
|||||||
friend class QbsBuildStepConfigWidget;
|
friend class QbsBuildStepConfigWidget;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Ui { class QbsBuildStepConfigWidget; }
|
|
||||||
|
|
||||||
class QbsBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
QbsBuildStepConfigWidget(QbsBuildStep *step);
|
|
||||||
~QbsBuildStepConfigWidget();
|
|
||||||
QString summaryText() const;
|
|
||||||
QString displayName() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateState();
|
|
||||||
void updateQmlDebuggingOption();
|
|
||||||
void updatePropertyEdit(const QVariantMap &data);
|
|
||||||
|
|
||||||
void changeBuildVariant(int);
|
|
||||||
void changeShowCommandLines(bool show);
|
|
||||||
void changeKeepGoing(bool kg);
|
|
||||||
void changeJobCount(int count);
|
|
||||||
void changeInstall(bool install);
|
|
||||||
void changeCleanInstallRoot(bool clean);
|
|
||||||
void changeForceProbes(bool forceProbes);
|
|
||||||
void applyCachedProperties();
|
|
||||||
|
|
||||||
// QML debugging:
|
|
||||||
void linkQmlDebuggingLibraryChecked(bool checked);
|
|
||||||
|
|
||||||
bool validateProperties(Utils::FancyLineEdit *edit, QString *errorMessage);
|
|
||||||
|
|
||||||
Ui::QbsBuildStepConfigWidget *m_ui;
|
|
||||||
|
|
||||||
QList<QPair<QString, QString> > m_propertyCache;
|
|
||||||
QbsBuildStep *m_step;
|
|
||||||
QString m_summary;
|
|
||||||
bool m_ignoreChange;
|
|
||||||
};
|
|
||||||
|
|
||||||
class QbsBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
class QbsBuildStepFactory : public ProjectExplorer::IBuildStepFactory
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "qbsinfopage.h"
|
#include "qbsinfopage.h"
|
||||||
#include "ui_qbsinfowidget.h"
|
#include "ui_qbsinfowidget.h"
|
||||||
|
|
||||||
#include "qbsconstants.h"
|
#include "qbsprojectmanagerconstants.h"
|
||||||
|
|
||||||
#include <qbs.h>
|
#include <qbs.h>
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
#include "ui_qbsprofilessettingswidget.h"
|
#include "ui_qbsprofilessettingswidget.h"
|
||||||
|
|
||||||
#include "customqbspropertiesdialog.h"
|
#include "customqbspropertiesdialog.h"
|
||||||
#include "qbsconstants.h"
|
|
||||||
#include "qbsprojectmanager.h"
|
#include "qbsprojectmanager.h"
|
||||||
|
#include "qbsprojectmanagerconstants.h"
|
||||||
#include "qbsprojectmanagersettings.h"
|
#include "qbsprojectmanagersettings.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ HEADERS = \
|
|||||||
qbsprojectmanagerplugin.h \
|
qbsprojectmanagerplugin.h \
|
||||||
qbsprojectmanagersettings.h \
|
qbsprojectmanagersettings.h \
|
||||||
qbsprojectparser.h \
|
qbsprojectparser.h \
|
||||||
qbsrunconfiguration.h \
|
qbsrunconfiguration.h
|
||||||
qbsconstants.h
|
|
||||||
|
|
||||||
SOURCES = \
|
SOURCES = \
|
||||||
customqbspropertiesdialog.cpp \
|
customqbspropertiesdialog.cpp \
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ QtcPlugin {
|
|||||||
"qbscleanstep.cpp",
|
"qbscleanstep.cpp",
|
||||||
"qbscleanstep.h",
|
"qbscleanstep.h",
|
||||||
"qbscleanstepconfigwidget.ui",
|
"qbscleanstepconfigwidget.ui",
|
||||||
"qbsconstants.h",
|
|
||||||
"qbsdeployconfigurationfactory.cpp",
|
"qbsdeployconfigurationfactory.cpp",
|
||||||
"qbsdeployconfigurationfactory.h",
|
"qbsdeployconfigurationfactory.h",
|
||||||
"qbsinfopage.cpp",
|
"qbsinfopage.cpp",
|
||||||
|
|||||||
@@ -65,6 +65,28 @@ const char QBS_FORCE_PROBES_KEY[] = "qbspm.forceProbes";
|
|||||||
static const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
|
static const char QBS_GROUP_ICON[] = ":/qbsprojectmanager/images/groups.png";
|
||||||
static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
|
static const char QBS_PRODUCT_OVERLAY_ICON[] = ":/qbsprojectmanager/images/productgear.png";
|
||||||
|
|
||||||
|
// Toolchain related settings:
|
||||||
|
const char QBS_TARGETOS[] = "qbs.targetOS";
|
||||||
|
const char QBS_SYSROOT[] = "qbs.sysroot";
|
||||||
|
const char QBS_ARCHITECTURE[] = "qbs.architecture";
|
||||||
|
const char QBS_TOOLCHAIN[] = "qbs.toolchain";
|
||||||
|
const char CPP_TOOLCHAINPATH[] = "cpp.toolchainInstallPath";
|
||||||
|
const char CPP_TOOLCHAINPREFIX[] = "cpp.toolchainPrefix";
|
||||||
|
const char CPP_COMPILERNAME[] = "cpp.compilerName";
|
||||||
|
const char CPP_CXXCOMPILERNAME[] = "cpp.cxxCompilerName";
|
||||||
|
const char CPP_PLATFORMCOMMONCOMPILERFLAGS[] = "cpp.platformCommonCompilerFlags";
|
||||||
|
const char CPP_PLATFORMLINKERFLAGS[] = "cpp.platformLinkerFlags";
|
||||||
|
const char CPP_PLATFORMPATH[] = "cpp.platformPath";
|
||||||
|
const char CPP_XCODESDKNAME[] = "cpp.xcodeSdkName";
|
||||||
|
const char CPP_XCODESDKVERSION[] = "cpp.xcodeSdkVersion";
|
||||||
|
|
||||||
|
// Settings page
|
||||||
|
const char QBS_SETTINGS_CATEGORY[] = "YM.qbs";
|
||||||
|
const char QBS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("QbsProjectManager", "Qbs");
|
||||||
|
const char QBS_SETTINGS_CATEGORY_ICON[] = ":/projectexplorer/images/build.png";
|
||||||
|
|
||||||
|
const char QBS_PROPERTIES_KEY_FOR_KITS[] = "QbsProjectManager.qbs-properties";
|
||||||
|
|
||||||
const char QBS_PROFILING_ENV[] = "QTC_QBS_PROFILING";
|
const char QBS_PROFILING_ENV[] = "QTC_QBS_PROFILING";
|
||||||
|
|
||||||
} // namespace Constants
|
} // namespace Constants
|
||||||
|
|||||||
@@ -622,19 +622,13 @@ QStringList QmakePriFileNode::fullVPaths(const QStringList &baseVPaths, QtSuppor
|
|||||||
QSet<FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder)
|
QSet<FileName> QmakePriFileNode::recursiveEnumerate(const QString &folder)
|
||||||
{
|
{
|
||||||
QSet<FileName> result;
|
QSet<FileName> result;
|
||||||
QFileInfo fi(folder);
|
QDir dir(folder);
|
||||||
if (fi.isDir()) {
|
dir.setFilter(dir.filter() | QDir::NoDotAndDotDot);
|
||||||
QDir dir(folder);
|
foreach (const QFileInfo &file, dir.entryInfoList()) {
|
||||||
dir.setFilter(dir.filter() | QDir::NoDotAndDotDot);
|
if (file.isDir() && !file.isSymLink())
|
||||||
|
result += recursiveEnumerate(file.absoluteFilePath());
|
||||||
foreach (const QFileInfo &file, dir.entryInfoList()) {
|
else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
|
||||||
if (file.isDir() && !file.isSymLink())
|
result += FileName(file);
|
||||||
result += recursiveEnumerate(file.absoluteFilePath());
|
|
||||||
else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
|
|
||||||
result += FileName(file);
|
|
||||||
}
|
|
||||||
} else if (fi.exists()) {
|
|
||||||
result << FileName(fi);
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -646,17 +640,15 @@ PriFileEvalResult QmakePriFileNode::extractValues(const EvalInput &input,
|
|||||||
{
|
{
|
||||||
PriFileEvalResult result;
|
PriFileEvalResult result;
|
||||||
|
|
||||||
// Figure out DEPLOYMENT and INSTALL folders
|
// Figure out DEPLOYMENT and INSTALL folders.
|
||||||
QStringList dynamicVariables = dynamicVarNames(input.readerExact, input.readerCumulative, input.isQt5);
|
// Ignore stuff from cumulative parse, as we are recursively enumerating
|
||||||
|
// all the files from those folders and add watchers for them. That's too
|
||||||
|
// dangerous if we get the folders wrong and enumerate the whole project
|
||||||
|
// tree multiple times.
|
||||||
|
QStringList dynamicVariables = dynamicVarNames(input.readerExact, input.isQt5);
|
||||||
foreach (ProFile *includeFileExact, includeFilesExact)
|
foreach (ProFile *includeFileExact, includeFilesExact)
|
||||||
foreach (const QString &dynamicVar, dynamicVariables) {
|
foreach (const QString &dynamicVar, dynamicVariables)
|
||||||
result.folders += input.readerExact->values(dynamicVar, includeFileExact);
|
result.folders += input.readerExact->values(dynamicVar, includeFileExact);
|
||||||
// Ignore stuff from cumulative parse
|
|
||||||
// we are recursively enumerating all the files from those folders
|
|
||||||
// and add watchers for them, that's too dangerous if we get the folders
|
|
||||||
// wrong and enumerate the whole project tree multiple times
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (int i=0; i < result.folders.size(); ++i) {
|
for (int i=0; i < result.folders.size(); ++i) {
|
||||||
const QFileInfo fi(result.folders.at(i));
|
const QFileInfo fi(result.folders.at(i));
|
||||||
@@ -1376,10 +1368,11 @@ QStringList QmakePriFileNode::varNames(FileType type, QtSupport::ProFileReader *
|
|||||||
foreach (const QString &var, listOfExtraCompilers) {
|
foreach (const QString &var, listOfExtraCompilers) {
|
||||||
QStringList inputs = readerExact->values(var + QLatin1String(".input"));
|
QStringList inputs = readerExact->values(var + QLatin1String(".input"));
|
||||||
foreach (const QString &input, inputs)
|
foreach (const QString &input, inputs)
|
||||||
// FORMS, RESOURCES, and STATECHARTS are handled below, HEADERS above
|
// FORMS, RESOURCES, and STATECHARTS are handled below, HEADERS and SOURCES above
|
||||||
if (input != QLatin1String("FORMS")
|
if (input != QLatin1String("FORMS")
|
||||||
&& input != QLatin1String("STATECHARTS")
|
&& input != QLatin1String("STATECHARTS")
|
||||||
&& input != QLatin1String("RESOURCES")
|
&& input != QLatin1String("RESOURCES")
|
||||||
|
&& input != QLatin1String("SOURCES")
|
||||||
&& input != QLatin1String("HEADERS"))
|
&& input != QLatin1String("HEADERS"))
|
||||||
vars << input;
|
vars << input;
|
||||||
}
|
}
|
||||||
@@ -1474,7 +1467,7 @@ QStringList QmakePriFileNode::varNamesForRemoving()
|
|||||||
return vars;
|
return vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
|
QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExact,
|
||||||
bool isQt5)
|
bool isQt5)
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
@@ -1486,12 +1479,6 @@ QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerEx
|
|||||||
foreach (const QString &var, listOfVars) {
|
foreach (const QString &var, listOfVars) {
|
||||||
result << (var + sources);
|
result << (var + sources);
|
||||||
}
|
}
|
||||||
if (readerCumulative) {
|
|
||||||
QStringList listOfVars = readerCumulative->values(deployment);
|
|
||||||
foreach (const QString &var, listOfVars) {
|
|
||||||
result << (var + sources);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString installs = QLatin1String("INSTALLS");
|
const QString installs = QLatin1String("INSTALLS");
|
||||||
const QString files = QLatin1String(".files");
|
const QString files = QLatin1String(".files");
|
||||||
@@ -1499,12 +1486,6 @@ QStringList QmakePriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerEx
|
|||||||
foreach (const QString &var, listOfVars) {
|
foreach (const QString &var, listOfVars) {
|
||||||
result << (var + files);
|
result << (var + files);
|
||||||
}
|
}
|
||||||
if (readerCumulative) {
|
|
||||||
QStringList listOfVars = readerCumulative->values(installs);
|
|
||||||
foreach (const QString &var, listOfVars) {
|
|
||||||
result << (var + files);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.removeDuplicates();
|
result.removeDuplicates();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1858,8 +1839,8 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input)
|
|||||||
if (result->state == EvalResult::EvalOk) {
|
if (result->state == EvalResult::EvalOk) {
|
||||||
if (result->projectType == SubDirsTemplate) {
|
if (result->projectType == SubDirsTemplate) {
|
||||||
QStringList errors;
|
QStringList errors;
|
||||||
result->errors.append(errors);
|
|
||||||
FileNameList subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
FileNameList subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors);
|
||||||
|
result->errors.append(errors);
|
||||||
|
|
||||||
foreach (const Utils::FileName &subDirName, subDirs) {
|
foreach (const Utils::FileName &subDirName, subDirs) {
|
||||||
IncludedPriFile *subDir = new IncludedPriFile;
|
IncludedPriFile *subDir = new IncludedPriFile;
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ protected:
|
|||||||
static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact);
|
static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact);
|
||||||
static QStringList varNamesForRemoving();
|
static QStringList varNamesForRemoving();
|
||||||
static QString varNameForAdding(const QString &mimeType);
|
static QString varNameForAdding(const QString &mimeType);
|
||||||
static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative, bool isQt5);
|
static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, bool isQt5);
|
||||||
static QSet<Utils::FileName> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
static QSet<Utils::FileName> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
||||||
static QSet<Utils::FileName> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
static QSet<Utils::FileName> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files);
|
||||||
|
|
||||||
|
|||||||
@@ -423,7 +423,6 @@ void QmakeProject::updateCppCodeModel()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QList<ProjectExplorer::ExtraCompiler *> generators;
|
QList<ProjectExplorer::ExtraCompiler *> generators;
|
||||||
QStringList allFiles;
|
|
||||||
foreach (QmakeProFileNode *pro, proFiles) {
|
foreach (QmakeProFileNode *pro, proFiles) {
|
||||||
warnOnToolChainMismatch(pro);
|
warnOnToolChainMismatch(pro);
|
||||||
|
|
||||||
@@ -465,11 +464,9 @@ void QmakeProject::updateCppCodeModel()
|
|||||||
{ // C++ files:
|
{ // C++ files:
|
||||||
// part->files
|
// part->files
|
||||||
foreach (const QString &file, pro->variableValue(CppSourceVar)) {
|
foreach (const QString &file, pro->variableValue(CppSourceVar)) {
|
||||||
allFiles << file;
|
|
||||||
cppPart->files << ProjectFile(file, ProjectFile::CXXSource);
|
cppPart->files << ProjectFile(file, ProjectFile::CXXSource);
|
||||||
}
|
}
|
||||||
foreach (const QString &file, pro->variableValue(CppHeaderVar)) {
|
foreach (const QString &file, pro->variableValue(CppHeaderVar)) {
|
||||||
allFiles << file;
|
|
||||||
cppPart->files << ProjectFile(file, ProjectFile::CXXHeader);
|
cppPart->files << ProjectFile(file, ProjectFile::CXXHeader);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -477,13 +474,11 @@ void QmakeProject::updateCppCodeModel()
|
|||||||
ProjectPart::Ptr objcppPart = templatePart->copy();
|
ProjectPart::Ptr objcppPart = templatePart->copy();
|
||||||
{ // ObjC++ files:
|
{ // ObjC++ files:
|
||||||
foreach (const QString &file, pro->variableValue(ObjCSourceVar)) {
|
foreach (const QString &file, pro->variableValue(ObjCSourceVar)) {
|
||||||
allFiles << file;
|
|
||||||
// Although the enum constant is called ObjCSourceVar, it actually is ObjC++ source
|
// Although the enum constant is called ObjCSourceVar, it actually is ObjC++ source
|
||||||
// code, as qmake does not handle C (and ObjC).
|
// code, as qmake does not handle C (and ObjC).
|
||||||
objcppPart->files << ProjectFile(file, ProjectFile::ObjCXXSource);
|
objcppPart->files << ProjectFile(file, ProjectFile::ObjCXXSource);
|
||||||
}
|
}
|
||||||
foreach (const QString &file, pro->variableValue(ObjCHeaderVar)) {
|
foreach (const QString &file, pro->variableValue(ObjCHeaderVar)) {
|
||||||
allFiles << file;
|
|
||||||
objcppPart->files << ProjectFile(file, ProjectFile::ObjCXXHeader);
|
objcppPart->files << ProjectFile(file, ProjectFile::ObjCXXHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -505,7 +500,6 @@ void QmakeProject::updateCppCodeModel()
|
|||||||
foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) {
|
foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) {
|
||||||
ec->forEachTarget([&](const Utils::FileName &generatedFile) {
|
ec->forEachTarget([&](const Utils::FileName &generatedFile) {
|
||||||
QString name = generatedFile.toString();
|
QString name = generatedFile.toString();
|
||||||
allFiles << name;
|
|
||||||
ProjectFile::Kind kind = ProjectFile::classify(name);
|
ProjectFile::Kind kind = ProjectFile::classify(name);
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case ProjectFile::CHeader:
|
case ProjectFile::CHeader:
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include "ui_qmakeprojectconfigwidget.h"
|
#include "ui_qmakeprojectconfigwidget.h"
|
||||||
|
|
||||||
#include <coreplugin/coreicons.h>
|
#include <coreplugin/coreicons.h>
|
||||||
|
#include <coreplugin/variablechooser.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
@@ -82,6 +83,9 @@ QmakeProjectConfigWidget::QmakeProjectConfigWidget(QmakeBuildConfiguration *bc)
|
|||||||
m_ui->inSourceBuildDirEdit->setReadOnly(true);
|
m_ui->inSourceBuildDirEdit->setReadOnly(true);
|
||||||
m_ui->inSourceBuildDirEdit->setEnabled(false);
|
m_ui->inSourceBuildDirEdit->setEnabled(false);
|
||||||
|
|
||||||
|
auto chooser = new Core::VariableChooser(this);
|
||||||
|
chooser->addSupportedWidget(m_ui->shadowBuildDirEdit->lineEdit());
|
||||||
|
|
||||||
m_ui->shadowBuildCheckBox->setChecked(isShadowBuild);
|
m_ui->shadowBuildCheckBox->setChecked(isShadowBuild);
|
||||||
|
|
||||||
connect(m_ui->shadowBuildCheckBox, &QAbstractButton::clicked,
|
connect(m_ui->shadowBuildCheckBox, &QAbstractButton::clicked,
|
||||||
|
|||||||
@@ -112,6 +112,19 @@ void QtProjectParameters::writeProFile(QTextStream &str) const
|
|||||||
|
|
||||||
if (!targetDirectory.isEmpty())
|
if (!targetDirectory.isEmpty())
|
||||||
str << "\nDESTDIR = " << targetDirectory << '\n';
|
str << "\nDESTDIR = " << targetDirectory << '\n';
|
||||||
|
|
||||||
|
if (qtVersionSupport != SupportQt4Only) {
|
||||||
|
str << "\n"
|
||||||
|
"# The following define makes your compiler emit warnings if you use\n"
|
||||||
|
"# any feature of Qt which as been marked as deprecated (the exact warnings\n"
|
||||||
|
"# depend on your compiler). Please consult the documentation of the\n"
|
||||||
|
"# deprecated API in order to know how to port your code away from it.\n"
|
||||||
|
"DEFINES += QT_DEPRECATED_WARNINGS\n\n"
|
||||||
|
"# You can also make your code fail to compile if you use deprecated APIs.\n"
|
||||||
|
"# In order to do so, uncomment the following line.\n"
|
||||||
|
"# You can also select to disable deprecated APIs only up to a certain version of Qt.\n"
|
||||||
|
"#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtProjectParameters::writeProFileHeader(QTextStream &str)
|
void QtProjectParameters::writeProFileHeader(QTextStream &str)
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ bool AbstractFormEditorTool::topSelectedItemIsMovable(const QList<QGraphicsItem*
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool AbstractFormEditorTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
|
bool AbstractFormEditorTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*itemList*/)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -149,6 +148,7 @@ QGraphicsItem *AbstractFormEditorTool::topMovableGraphicsItem(const QList<QGraph
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FormEditorItem *AbstractFormEditorTool::topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList, bool selectOnlyContentItems)
|
FormEditorItem *AbstractFormEditorTool::topMovableFormEditorItem(const QList<QGraphicsItem*> &itemList, bool selectOnlyContentItems)
|
||||||
{
|
{
|
||||||
foreach (QGraphicsItem *item, itemList) {
|
foreach (QGraphicsItem *item, itemList) {
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
QWidget#backgroundWidget {
|
||||||
|
background-color: creatorTheme.QmlDesignerTabDark
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget#centralTabWidget::pane {
|
||||||
|
border: 0px;
|
||||||
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget#centralTabWidget::tab-bar { alignment: right; }
|
||||||
|
|
||||||
|
QTabBar::tab:selected {
|
||||||
|
border: none;
|
||||||
|
background-color: creatorTheme.QmlDesignerTabLight;
|
||||||
|
color: creatorTheme.QmlDesignerTabDark;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabBar#centralTabBar::tab {
|
||||||
|
width: 16px;
|
||||||
|
height: 80px;
|
||||||
|
|
||||||
|
border-image: none;
|
||||||
|
background-color: creatorTheme.QmlDesignerTabDark;
|
||||||
|
color: creatorTheme.QmlDesignerTabLight;
|
||||||
|
|
||||||
|
margin-top: 0x;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
margin-left: 0px;
|
||||||
|
margin-right: 0px;
|
||||||
|
font: bold;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -4,5 +4,6 @@
|
|||||||
<file>stylesheet.css</file>
|
<file>stylesheet.css</file>
|
||||||
<file>scrollbar.css</file>
|
<file>scrollbar.css</file>
|
||||||
<file>formeditorstylesheet.css</file>
|
<file>formeditorstylesheet.css</file>
|
||||||
|
<file>centerwidget.css</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -21,22 +21,11 @@ QStackedWidget {
|
|||||||
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QGraphicsView {
|
QGraphicsView {
|
||||||
border: 0px;
|
border: 0px;
|
||||||
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabWidget {
|
|
||||||
border: 0px;
|
|
||||||
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
QTabWidget::pane { /* The tab widget frame */
|
|
||||||
border: 0px;
|
|
||||||
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
|
||||||
}
|
|
||||||
|
|
||||||
QLineEdit#itemLibrarySearchInput
|
QLineEdit#itemLibrarySearchInput
|
||||||
{
|
{
|
||||||
color: creatorTheme.PanelTextColorLight;
|
color: creatorTheme.PanelTextColorLight;
|
||||||
@@ -70,21 +59,30 @@ QLineEdit#itemLibrarySearchInput
|
|||||||
selection-color: #404040;
|
selection-color: #404040;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTabWidget {
|
||||||
|
border: 0px;
|
||||||
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTabWidget::pane { /* The tab widget frame */
|
||||||
|
border: 0px;
|
||||||
|
background-color: creatorTheme.QmlDesignerBackgroundColorDarkAlternate;
|
||||||
|
}
|
||||||
|
|
||||||
QTabBar::tab {
|
QTabBar::tab {
|
||||||
border-image: none;
|
|
||||||
|
|
||||||
width: 80px;
|
width: 80px;
|
||||||
|
|
||||||
height: 22px;
|
height: 22px;
|
||||||
|
|
||||||
|
border-image: none;
|
||||||
|
background-color: creatorTheme.QmlDesignerTabDark;
|
||||||
|
color: creatorTheme.QmlDesignerTabLight;
|
||||||
|
|
||||||
margin-top: 0x;
|
margin-top: 0x;
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
margin-left: 0px;
|
margin-left: 0px;
|
||||||
margin-right: 0px;
|
margin-right: 0px;
|
||||||
font: bold;
|
font: bold;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
background-color: creatorTheme.QmlDesignerTabDark;
|
|
||||||
|
|
||||||
color: creatorTheme.QmlDesignerTabLight;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QTabBar::tab:selected {
|
QTabBar::tab:selected {
|
||||||
|
|||||||
@@ -141,16 +141,18 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
SLOT(processFinished(int,QProcess::ExitStatus)));
|
SLOT(processFinished(int,QProcess::ExitStatus)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_qmlPuppetEditorProcess->waitForStarted(10000)) {
|
const int second = 1000;
|
||||||
|
const int waitConstant = 8 * second;
|
||||||
|
if (m_qmlPuppetEditorProcess->waitForStarted(waitConstant)) {
|
||||||
connect(m_qmlPuppetEditorProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
connect(m_qmlPuppetEditorProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||||
m_qmlPuppetEditorProcess.data(), &QProcess::deleteLater);
|
m_qmlPuppetEditorProcess.data(), &QProcess::deleteLater);
|
||||||
|
|
||||||
if (runModus == NormalModus) {
|
if (runModus == NormalModus) {
|
||||||
m_qmlPuppetPreviewProcess->waitForStarted();
|
m_qmlPuppetPreviewProcess->waitForStarted(waitConstant / 2);
|
||||||
connect(m_qmlPuppetPreviewProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
connect(m_qmlPuppetPreviewProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||||
m_qmlPuppetPreviewProcess.data(), &QProcess::deleteLater);
|
m_qmlPuppetPreviewProcess.data(), &QProcess::deleteLater);
|
||||||
|
|
||||||
m_qmlPuppetRenderProcess->waitForStarted();
|
m_qmlPuppetRenderProcess->waitForStarted(waitConstant / 2);
|
||||||
connect(m_qmlPuppetRenderProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
connect(m_qmlPuppetRenderProcess.data(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished),
|
||||||
m_qmlPuppetRenderProcess.data(), &QProcess::deleteLater);
|
m_qmlPuppetRenderProcess.data(), &QProcess::deleteLater);
|
||||||
}
|
}
|
||||||
@@ -158,7 +160,7 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
bool connectedToPuppet = true;
|
bool connectedToPuppet = true;
|
||||||
|
|
||||||
if (!m_localServer->hasPendingConnections())
|
if (!m_localServer->hasPendingConnections())
|
||||||
connectedToPuppet = m_localServer->waitForNewConnection(3000);
|
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
|
||||||
|
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_firstSocket = m_localServer->nextPendingConnection();
|
m_firstSocket = m_localServer->nextPendingConnection();
|
||||||
@@ -166,14 +168,14 @@ NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceV
|
|||||||
|
|
||||||
if (runModus == NormalModus) {
|
if (runModus == NormalModus) {
|
||||||
if (!m_localServer->hasPendingConnections())
|
if (!m_localServer->hasPendingConnections())
|
||||||
connectedToPuppet = m_localServer->waitForNewConnection(3000);
|
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
|
||||||
|
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_secondSocket = m_localServer->nextPendingConnection();
|
m_secondSocket = m_localServer->nextPendingConnection();
|
||||||
connect(m_secondSocket.data(), SIGNAL(readyRead()), this, SLOT(readSecondDataStream()));
|
connect(m_secondSocket.data(), SIGNAL(readyRead()), this, SLOT(readSecondDataStream()));
|
||||||
|
|
||||||
if (!m_localServer->hasPendingConnections())
|
if (!m_localServer->hasPendingConnections())
|
||||||
connectedToPuppet = m_localServer->waitForNewConnection(3000);
|
connectedToPuppet = m_localServer->waitForNewConnection(waitConstant / 4);
|
||||||
|
|
||||||
if (connectedToPuppet) {
|
if (connectedToPuppet) {
|
||||||
m_thirdSocket = m_localServer->nextPendingConnection();
|
m_thirdSocket = m_localServer->nextPendingConnection();
|
||||||
|
|||||||
@@ -179,6 +179,42 @@ static bool idIsQmlKeyWord(const QString& id)
|
|||||||
return keywords.contains(id);
|
return keywords.contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool isIdToAvoid(const QString& id)
|
||||||
|
{
|
||||||
|
static const QSet<QString> ids = {
|
||||||
|
"top",
|
||||||
|
"bottom",
|
||||||
|
"left",
|
||||||
|
"right",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"x",
|
||||||
|
"y",
|
||||||
|
"opacity",
|
||||||
|
"parent",
|
||||||
|
"item",
|
||||||
|
"flow",
|
||||||
|
"color",
|
||||||
|
"margin",
|
||||||
|
"padding",
|
||||||
|
"border",
|
||||||
|
"font",
|
||||||
|
"text",
|
||||||
|
"source",
|
||||||
|
"state",
|
||||||
|
"visible",
|
||||||
|
"focus",
|
||||||
|
"data",
|
||||||
|
"clip",
|
||||||
|
"layer",
|
||||||
|
"scale",
|
||||||
|
"enabled",
|
||||||
|
"anchors"
|
||||||
|
};
|
||||||
|
|
||||||
|
return ids.contains(id);
|
||||||
|
}
|
||||||
|
|
||||||
static bool idContainsWrongLetter(const QString& id)
|
static bool idContainsWrongLetter(const QString& id)
|
||||||
{
|
{
|
||||||
static QRegExp idExpr(QStringLiteral("[a-z_][a-zA-Z0-9_]*"));
|
static QRegExp idExpr(QStringLiteral("[a-z_][a-zA-Z0-9_]*"));
|
||||||
@@ -187,7 +223,7 @@ static bool idContainsWrongLetter(const QString& id)
|
|||||||
|
|
||||||
bool ModelNode::isValidId(const QString &id)
|
bool ModelNode::isValidId(const QString &id)
|
||||||
{
|
{
|
||||||
return id.isEmpty() || (!idContainsWrongLetter(id) && !idIsQmlKeyWord(id));
|
return id.isEmpty() || (!idContainsWrongLetter(id) && !idIsQmlKeyWord(id)) && !isIdToAvoid(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelNode::hasId() const
|
bool ModelNode::hasId() const
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ void ModelToTextMerger::propertiesChanged(const QList<AbstractProperty>& propert
|
|||||||
|
|
||||||
ModelNode containedModelNode;
|
ModelNode containedModelNode;
|
||||||
const int indentDepth = m_rewriterView->textModifier()->indentDepth();
|
const int indentDepth = m_rewriterView->textModifier()->indentDepth();
|
||||||
const QString propertyTextValue = QmlTextGenerator(getPropertyOrder(),
|
const QString propertyTextValue = QmlTextGenerator(propertyOrder(),
|
||||||
indentDepth)(property);
|
indentDepth)(property);
|
||||||
|
|
||||||
switch (propertyChange) {
|
switch (propertyChange) {
|
||||||
@@ -162,14 +162,14 @@ void ModelToTextMerger::nodeReparented(const ModelNode &node, const NodeAbstract
|
|||||||
switch (propertyChange) {
|
switch (propertyChange) {
|
||||||
case AbstractView::PropertiesAdded:
|
case AbstractView::PropertiesAdded:
|
||||||
schedule(new AddPropertyRewriteAction(newPropertyParent,
|
schedule(new AddPropertyRewriteAction(newPropertyParent,
|
||||||
QmlTextGenerator(getPropertyOrder())(node),
|
QmlTextGenerator(propertyOrder())(node),
|
||||||
propertyType(newPropertyParent),
|
propertyType(newPropertyParent),
|
||||||
node));
|
node));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AbstractView::NoAdditionalChanges:
|
case AbstractView::NoAdditionalChanges:
|
||||||
schedule(new ChangePropertyRewriteAction(newPropertyParent,
|
schedule(new ChangePropertyRewriteAction(newPropertyParent,
|
||||||
QmlTextGenerator(getPropertyOrder())(node),
|
QmlTextGenerator(propertyOrder())(node),
|
||||||
propertyType(newPropertyParent),
|
propertyType(newPropertyParent),
|
||||||
node));
|
node));
|
||||||
break;
|
break;
|
||||||
@@ -212,7 +212,7 @@ void ModelToTextMerger::applyChanges()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
dumpRewriteActions(QStringLiteral("Before compression"));
|
dumpRewriteActions(QStringLiteral("Before compression"));
|
||||||
RewriteActionCompressor compress(getPropertyOrder());
|
RewriteActionCompressor compress(propertyOrder());
|
||||||
compress(m_rewriteActions);
|
compress(m_rewriteActions);
|
||||||
dumpRewriteActions(QStringLiteral("After compression"));
|
dumpRewriteActions(QStringLiteral("After compression"));
|
||||||
|
|
||||||
@@ -241,7 +241,7 @@ void ModelToTextMerger::applyChanges()
|
|||||||
ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes());
|
ModelNodePositionRecalculator positionRecalculator(m_rewriterView->positionStorage(), m_rewriterView->positionStorage()->modelNodes());
|
||||||
positionRecalculator.connectTo(textModifier);
|
positionRecalculator.connectTo(textModifier);
|
||||||
|
|
||||||
QmlRefactoring refactoring(tmpDocument, *textModifier, getPropertyOrder());
|
QmlRefactoring refactoring(tmpDocument, *textModifier, propertyOrder());
|
||||||
|
|
||||||
textModifier->deactivateChangeSignals();
|
textModifier->deactivateChangeSignals();
|
||||||
textModifier->startGroup();
|
textModifier->startGroup();
|
||||||
@@ -348,31 +348,27 @@ QmlRefactoring::PropertyType ModelToTextMerger::propertyType(const AbstractPrope
|
|||||||
return (QmlRefactoring::PropertyType) -1;
|
return (QmlRefactoring::PropertyType) -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyNameList ModelToTextMerger::m_propertyOrder;
|
PropertyNameList ModelToTextMerger::propertyOrder()
|
||||||
|
|
||||||
PropertyNameList ModelToTextMerger::getPropertyOrder()
|
|
||||||
{
|
{
|
||||||
if (m_propertyOrder.isEmpty()) {
|
static const PropertyNameList properties = {
|
||||||
m_propertyOrder
|
PropertyName("id"),
|
||||||
<< PropertyName("id")
|
PropertyName("name"),
|
||||||
<< PropertyName("name")
|
PropertyName("target"),
|
||||||
<< PropertyName("target")
|
PropertyName("property"),
|
||||||
<< PropertyName("property")
|
PropertyName("x"),
|
||||||
<< PropertyName("x")
|
PropertyName("y"),
|
||||||
<< PropertyName("y")
|
PropertyName("width"),
|
||||||
<< PropertyName("width")
|
PropertyName("height"),
|
||||||
<< PropertyName("height")
|
PropertyName("position"),
|
||||||
<< PropertyName("position")
|
PropertyName("color"),
|
||||||
<< PropertyName("color")
|
PropertyName("radius"),
|
||||||
<< PropertyName("radius")
|
PropertyName("text"),
|
||||||
<< PropertyName("text")
|
PropertyName(),
|
||||||
<< PropertyName()
|
PropertyName("states"),
|
||||||
<< PropertyName("states")
|
PropertyName("transitions")
|
||||||
<< PropertyName("transitions")
|
};
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_propertyOrder;
|
return properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModelToTextMerger::isInHierarchy(const AbstractProperty &property) {
|
bool ModelToTextMerger::isInHierarchy(const AbstractProperty &property) {
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ namespace Internal {
|
|||||||
class ModelToTextMerger
|
class ModelToTextMerger
|
||||||
{
|
{
|
||||||
typedef AbstractView::PropertyChangeFlags PropertyChangeFlags;
|
typedef AbstractView::PropertyChangeFlags PropertyChangeFlags;
|
||||||
static PropertyNameList m_propertyOrder;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ModelToTextMerger(RewriterView *reWriterView);
|
ModelToTextMerger(RewriterView *reWriterView);
|
||||||
@@ -75,7 +74,7 @@ protected:
|
|||||||
{ return m_rewriteActions; }
|
{ return m_rewriteActions; }
|
||||||
|
|
||||||
static QmlDesigner::QmlRefactoring::PropertyType propertyType(const AbstractProperty &property, const QString &textValue = QString());
|
static QmlDesigner::QmlRefactoring::PropertyType propertyType(const AbstractProperty &property, const QString &textValue = QString());
|
||||||
static PropertyNameList getPropertyOrder();
|
static PropertyNameList propertyOrder();
|
||||||
|
|
||||||
static bool isInHierarchy(const AbstractProperty &property);
|
static bool isInHierarchy(const AbstractProperty &property);
|
||||||
|
|
||||||
|
|||||||
@@ -369,8 +369,8 @@ void RewriterView::applyChanges()
|
|||||||
|
|
||||||
if (inErrorState()) {
|
if (inErrorState()) {
|
||||||
const QString content = textModifierContent();
|
const QString content = textModifierContent();
|
||||||
qDebug() << "RewriterView::applyChanges() got called while in error state. Will do a quick-exit now.";
|
qDebug().noquote() << "RewriterView::applyChanges() got called while in error state. Will do a quick-exit now.";
|
||||||
qDebug() << "Content:" << content;
|
qDebug().noquote() << "Content: " << content;
|
||||||
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state", content);
|
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state", content);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,8 +382,8 @@ void RewriterView::applyChanges()
|
|||||||
enterErrorState(errors().first().description());
|
enterErrorState(errors().first().description());
|
||||||
} catch (const Exception &e) {
|
} catch (const Exception &e) {
|
||||||
const QString content = textModifierContent();
|
const QString content = textModifierContent();
|
||||||
qDebug() << "RewriterException:" << m_rewritingErrorMessage;
|
qDebug().noquote() << "RewriterException:" << m_rewritingErrorMessage;
|
||||||
qDebug() << "Content:" << content;
|
qDebug().noquote() << "Content: " << qPrintable(content);
|
||||||
enterErrorState(e.description());
|
enterErrorState(e.description());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,10 +391,10 @@ void RewriterView::applyChanges()
|
|||||||
|
|
||||||
if (inErrorState()) {
|
if (inErrorState()) {
|
||||||
const QString content = textModifierContent();
|
const QString content = textModifierContent();
|
||||||
qDebug() << "RewriterException:" << m_rewritingErrorMessage;
|
qDebug().noquote() << "RewriterException: " << m_rewritingErrorMessage;
|
||||||
qDebug() << "Content:" << content;
|
qDebug().noquote() << "Content: " << content;
|
||||||
if (!errors().isEmpty())
|
if (!errors().isEmpty())
|
||||||
qDebug() << "Error:" << errors().first().description();
|
qDebug().noquote() << "Error:" << errors().first().description();
|
||||||
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, qPrintable(m_rewritingErrorMessage), content);
|
throw RewritingException(__LINE__, __FUNCTION__, __FILE__, qPrintable(m_rewritingErrorMessage), content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||