Merge remote branch 'origin/2.1'
Conflicts: doc/qtcreator.qdoc share/qtcreator/templates/mobileapp/app.pro
@@ -86,6 +86,7 @@ Platform Specific
|
||||
Mac
|
||||
|
||||
Linux (GNOME and KDE)
|
||||
* Respect http_proxy variable if set
|
||||
|
||||
Windows
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 42 KiB |
@@ -89,13 +89,6 @@
|
||||
|
||||
\endlist
|
||||
|
||||
The Qt Creator/MADDE integration is supported on the following platforms:
|
||||
\list
|
||||
\o Linux (32 bit and 64 bit)
|
||||
\o Windows (32 bit and 64 bit)
|
||||
\omit \o Mac OS 10.5 Leopard, or higher \endomit
|
||||
\endlist
|
||||
|
||||
\note The only supported build system for Maemo in Qt
|
||||
Creator is qmake.
|
||||
|
||||
|
||||
@@ -994,28 +994,23 @@
|
||||
editor. Then select the \gui {Design} mode to edit the file in the
|
||||
visual editor.
|
||||
|
||||
To enable or disable the \QMLD visual editor, select
|
||||
\gui {Help > About Plugins... > Qt Quick > QmlDesigner}. You must restart Qt Creator
|
||||
to enable or disable the visual editor.
|
||||
|
||||
\image qmldesigner-visual-editor.png "Visual editor"
|
||||
|
||||
Use the visual editor panes to manage your project:
|
||||
|
||||
\list
|
||||
|
||||
\o \gui {Navigator} pane displays the items in the editor. You can
|
||||
show and hide items to focus on specific parts of the application.
|
||||
\o \gui {Navigator} pane displays the QML elements in the current QML file.
|
||||
You can show and hide items to focus on specific parts of the application.
|
||||
To view lists of files or projects, instead, select \gui {File System},
|
||||
\gui {Open Documents}, or \gui Projects in the menu.
|
||||
|
||||
\o \gui {Library} pane displays lists of predefined \gui {Items} and
|
||||
imported \gui {Resources} that you can use to design applications. The
|
||||
images and other files that you copy to the project folder appear in the
|
||||
\gui {Resources} pane.
|
||||
\o \gui {Library} pane displays the building blocks that you can use to design
|
||||
applications: predefined QML elements, your own QML components, and other
|
||||
resources.
|
||||
|
||||
\o \gui {Properties} pane displays the properties of the selected component.
|
||||
You can also change the properties in the code editor.
|
||||
\o \gui {Properties} pane organizes the properties of the selected QML element
|
||||
or QML component. You can also change the properties in the code editor.
|
||||
|
||||
\o \gui {State} pane displays the different states of the component. To add
|
||||
states, click the empty slot. Then modify the new state in the editor.
|
||||
@@ -1024,6 +1019,59 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Element Library
|
||||
|
||||
The \gui {Library} pane contains two tabs: \gui {Items} and \gui {Resources}.
|
||||
The \gui Items pane displays the QML elements grouped by type: your own QML
|
||||
components, basic elements, interaction elements, views, and widgets.
|
||||
|
||||
\image qmldesigner-qml-components.png "QML Components pane"
|
||||
|
||||
The \gui {Resources} pane displays the images and other files that you copy to
|
||||
the project folder.
|
||||
|
||||
\section1 Specifying Element Properties
|
||||
|
||||
The \gui Properties pane displays all the properties of the selected QML element.
|
||||
The properties are grouped by type. The top part of the pane displays properties
|
||||
that are common to all elements, such as element type, position, size,
|
||||
and visibility.
|
||||
|
||||
The bottom part of the pane displays properties that are specific to each element
|
||||
type. For example, the following image displays the properties you can set for
|
||||
\gui Rectangle and \gui Text elements.
|
||||
|
||||
\image qmldesigner-element-properties.png
|
||||
|
||||
For more information on the properties available for an element, press \key {F1}.
|
||||
|
||||
\section2 Setting Expressions
|
||||
|
||||
You can set Java Script expressions as values of some properties. Click the circle
|
||||
icon next to a property to open a context menu, and select \gui {Set Expression}.
|
||||
|
||||
\image qmldesigner-set-expression.png "Element properties context menu"
|
||||
|
||||
For more information on the Java Script environment provided by QML, see
|
||||
\l{http://doc.qt.nokia.com/4.7-snapshot/qdeclarativejavascript.html}{Integrating JavaScript}.
|
||||
|
||||
\section2 Setting Anchors and Margins
|
||||
|
||||
The \gui Layout pane allows you to set anchors and margins for elements. To set
|
||||
the anchors of an item, click the anchor buttons. You can combine the top/bottom
|
||||
and left/right anchors to anchor objects in the corners of the parent element.
|
||||
|
||||
\inlineimage qmldesigner-anchor-buttons.png "Anchor buttons"
|
||||
|
||||
\section2 Building Transformations on Items
|
||||
|
||||
The \gui Advanced pane allows you configure advanced transformations, such as
|
||||
rotation, scale, and translation. You can assign any number of transformations
|
||||
to an item. Each transformation is applied in order, one at a time.
|
||||
|
||||
For more information on Transform elements, see
|
||||
\l {http://doc.qt.nokia.com/4.7/qml-transform.html}{QML Transform Element}.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -6170,14 +6218,6 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\note The \QMLD visual editor is provided as an experimental plugin that you must
|
||||
enable to be able to edit QML files in the \gui Design mode. Enabling the
|
||||
visual editor can negatively affect the overall stability of Qt Creator.
|
||||
|
||||
To enable or disable the \QMLD visual editor, select
|
||||
\gui {Help > About Plugins... > Qt Quick > QmlDesigner}. You must restart Qt Creator
|
||||
to enable or disable the visual editor.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -6266,6 +6306,9 @@
|
||||
\o Select \gui {File > New File or Project > Files and Classes > QML
|
||||
> Choose...} to create a new .qml file.
|
||||
|
||||
\note Components are listed in the \gui {QML Components} section of the
|
||||
\gui Library pane only if the filename begins with a capital letter.
|
||||
|
||||
\o Click \gui Design to open the .qml file in \QMLD.
|
||||
|
||||
\o Drag and drop an item from the \gui Library pane to the editor.
|
||||
@@ -6316,8 +6359,8 @@
|
||||
|
||||
\list a
|
||||
|
||||
\o In the \gui Size field, set the width (\gui W) of the button to 60
|
||||
and the height of the button (\gui H) to 20.
|
||||
\o In the \gui Size field, set the width (\gui W) and height (\gui H)
|
||||
of the button.
|
||||
|
||||
\o In the \gui Color field, select the button color.
|
||||
|
||||
@@ -6434,8 +6477,6 @@
|
||||
|
||||
\o Drag and drop a \gui MouseArea to the screen.
|
||||
|
||||
\o Click \gui Design to return to the visual editor.
|
||||
|
||||
\o In the \gui Navigator pane, select \gui border_image1 to specify
|
||||
settings for it in the \gui Properties pane:
|
||||
|
||||
@@ -6537,17 +6578,15 @@
|
||||
Typically, the main qml file in a Qt Quick project specifies the main window of an
|
||||
application.
|
||||
|
||||
The QML files in the project folder are displayed in \gui {QML Components} in the
|
||||
\gui Library pane.
|
||||
|
||||
\section1 Adding Components to Screens
|
||||
|
||||
\list 1
|
||||
|
||||
\o Select \gui {File > New File or Project > Qt Quick Project > Qt Quick UI}
|
||||
or \gui {Qt Quick Application} to create a Qt Quick project.
|
||||
|
||||
\o Drag and drop components from the \gui Library pane to the editor.
|
||||
|
||||
The QML files in the project folder are displayed in \gui {QML Elements}.
|
||||
|
||||
\o Select components in the \gui Navigator pane to edit their properties
|
||||
in the \gui Properties pane.
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<categories name="Qt Examples and Demos">
|
||||
<category dirname="declarative/toys" name="Toys">
|
||||
<example filename="dynamicscene" name="Dynamic Scene" executable="false" qml="true" />
|
||||
<example filename="tic-tac-toe" name="Tic Tac Toe" executable="false" qml="true" />
|
||||
<example filename="clocks" name="Clocks" executable="false" qml="true" />
|
||||
<example filename="corkboards" name="Corkboards" executable="false" qml="true" />
|
||||
<example filename="tvtennis" name="TV Tennis" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/ui-components" name="QML UI Components">
|
||||
<example filename="dialcontrol" name="Dial" executable="false" qml="true" />
|
||||
<example filename="flipable" name="Flipable" executable="false" qml="true" />
|
||||
<example filename="progressbar" name="Progress Bar" executable="false" qml="true" />
|
||||
<example filename="scrollbar" name="Scroll Bar" executable="false" qml="true" />
|
||||
<example filename="searchbox" name="Search Box" executable="false" qml="true" />
|
||||
<example filename="slideswitch" name="Slide Switch" executable="false" qml="true" />
|
||||
<example filename="spinner" name="Spinner" executable="false" qml="true" />
|
||||
<example filename="tabwidget" name="Tab Widget" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/text" name="Text">
|
||||
<example filename="fonts" name="Fonts" executable="false" qml="true" />
|
||||
<example filename="textselection" name="Text selection" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/modelviews" name="Models and Views">
|
||||
<example filename="package" name="Package" executable="false" qml="true" />
|
||||
<example filename="gridview" name="GridView" executable="false" qml="true" />
|
||||
<example filename="visualitemmodel" name="VisualItemModel" executable="false" qml="true" />
|
||||
<example filename="webview" name="WebView" executable="false" qml="true" />
|
||||
<example filename="pathview" name="PathView" executable="false" qml="true" />
|
||||
<example filename="parallax" name="Parallax Sliding" executable="false" qml="true" />
|
||||
<example filename="listview" name="ListView" executable="false" qml="true" />
|
||||
<example filename="objectlistmodel" name="Object List Model" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/threading" name="Threading">
|
||||
<example filename="threadedlistmodel" name="Threaded ListModel" executable="false" qml="true" />
|
||||
<example filename="workerscript" name="WorkerScript" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/animation" name="Animation">
|
||||
<example filename="basics" name="Basics" executable="false" qml="true" />
|
||||
<example filename="behaviors" name="Behaviors" executable="false" qml="true" />
|
||||
<example filename="easing" name="Easing Curves" executable="false" qml="true" />
|
||||
<example filename="states" name="States" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/imageelements" name="Image elements">
|
||||
<example filename="image" name="Image" executable="false" qml="true" />
|
||||
<example filename="borderimage" name="Border Image" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative/touchinteraction" name="Touch interaction">
|
||||
<example filename="gestures" name="Gestures" executable="false" qml="true" />
|
||||
<example filename="mousearea" name="MouseArea" executable="false" qml="true" />
|
||||
</category>
|
||||
<category dirname="declarative" name="Miscellaneous">
|
||||
<example filename="positioners" name="Positioners" executable="false" qml="true" />
|
||||
<example filename="screenorientation" name="Screen Orientation" executable="false" qml="true" />
|
||||
<example filename="xml/xmlhttprequest" name="XmlHttpRequest" executable="false" qml="true" />
|
||||
<example filename="sqllocalstorage" name="SQL Local Storage" executable="false" qml="true" />
|
||||
<example filename="keyinteraction/focus" name="Focus" executable="false" qml="true" />
|
||||
</category>
|
||||
</categories>
|
||||
@@ -1561,14 +1561,18 @@ class Dumper:
|
||||
## Generic pointer type with format None
|
||||
#warn("GENERIC AUTODEREF POINTER: %s" % value.address)
|
||||
innerType = realtype.target()
|
||||
self.putType(innerType)
|
||||
savedCurrentChildType = self.currentChildType
|
||||
self.currentChildType = stripClassTag(str(innerType))
|
||||
self.putItemHelper(
|
||||
Item(item.value.dereference(), item.iname, None, None))
|
||||
self.currentChildType = savedCurrentChildType
|
||||
self.putPointerValue(value.address)
|
||||
return
|
||||
innerTypeName = str(innerType.unqualified())
|
||||
# Never dereference char types.
|
||||
if innerTypeName != "char" and innerTypeName != "signed char" \
|
||||
and innerTypeName != "unsigned char" and innerTypeName != "wchar_t":
|
||||
self.putType(innerType)
|
||||
savedCurrentChildType = self.currentChildType
|
||||
self.currentChildType = stripClassTag(str(innerType))
|
||||
self.putItemHelper(
|
||||
Item(item.value.dereference(), item.iname, None, None))
|
||||
self.currentChildType = savedCurrentChildType
|
||||
self.putPointerValue(value.address)
|
||||
return
|
||||
|
||||
# Fall back to plain pointer printing.
|
||||
#warn("GENERIC PLAIN POINTER: %s" % value.type)
|
||||
@@ -1660,7 +1664,13 @@ class Dumper:
|
||||
|
||||
#warn("FIELD NAME: %s" % field.name)
|
||||
#warn("FIELD TYPE: %s" % field.type)
|
||||
if field.is_base_class:
|
||||
# The 'field.is_base_class' attribute exists in gdb 7.0.X and later only.
|
||||
# Symbian gdb is 6.8 as of 20.10.2010. TODO: Remove once Symbian gdb is up to date.
|
||||
if hasattr(field, 'is_base_class'):
|
||||
isBaseClass = field.is_base_class
|
||||
else:
|
||||
isBaseClass = field.name == stripClassTag(str(field.type))
|
||||
if isBaseClass:
|
||||
# Field is base type. We cannot use field.name as part
|
||||
# of the iname as it might contain spaces and other
|
||||
# strange characters.
|
||||
@@ -1739,15 +1749,18 @@ class ThreadNamesCommand(gdb.Command):
|
||||
if e == None or e.name() == None:
|
||||
break
|
||||
if e.name() == ns + "QThreadPrivate::start":
|
||||
thrptr = e.read_var("thr").dereference()
|
||||
obtype = lookupType(ns + "QObjectPrivate").pointer()
|
||||
d_ptr = thrptr["d_ptr"]["d"].cast(obtype).dereference()
|
||||
objectName = d_ptr["objectName"]
|
||||
out += '{valueencoded="';
|
||||
out += str(Hex4EncodedLittleEndianWithoutQuotes)+'",id="'
|
||||
out += str(thread.num) + '",value="'
|
||||
out += encodeString(objectName)
|
||||
out += '"},'
|
||||
try:
|
||||
thrptr = e.read_var("thr").dereference()
|
||||
obtype = lookupType(ns + "QObjectPrivate").pointer()
|
||||
d_ptr = thrptr["d_ptr"]["d"].cast(obtype).dereference()
|
||||
objectName = d_ptr["objectName"]
|
||||
out += '{valueencoded="';
|
||||
out += str(Hex4EncodedLittleEndianWithoutQuotes)+'",id="'
|
||||
out += str(thread.num) + '",value="'
|
||||
out += encodeString(objectName)
|
||||
out += '"},'
|
||||
except:
|
||||
pass
|
||||
print out[:-1] + ']'
|
||||
|
||||
ThreadNamesCommand()
|
||||
|
||||
@@ -24,6 +24,7 @@ isEmpty(vcproj) {
|
||||
}
|
||||
|
||||
DATA_DIRS = \
|
||||
examplebrowser \
|
||||
snippets \
|
||||
templates \
|
||||
designer \
|
||||
|
||||
@@ -22,6 +22,12 @@ symbian:TARGET.UID3 = 0xE1111234
|
||||
# and 0x2002CCCF value if protected UID is given to the application
|
||||
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
|
||||
|
||||
# If your application uses the Qt Mobility libraries, uncomment
|
||||
# the following lines and add the respective components to the
|
||||
# MOBILITY variable.
|
||||
# CONFIG += mobility
|
||||
# MOBILITY +=
|
||||
|
||||
SOURCES += main.cpp mainwindow.cpp
|
||||
HEADERS += mainwindow.h
|
||||
FORMS += mainwindow.ui
|
||||
|
||||
@@ -31,6 +31,12 @@ symbian:TARGET.UID3 = 0xE1111234
|
||||
# (This might significantly increase build time)
|
||||
# DEFINES += QMLJSDEBUGGER
|
||||
|
||||
# If your application uses the Qt Mobility libraries, uncomment
|
||||
# the following lines and add the respective components to the
|
||||
# MOBILITY variable.
|
||||
# CONFIG += mobility
|
||||
# MOBILITY +=
|
||||
|
||||
# The .cpp file which was generated for your project. Feel free to hack it.
|
||||
SOURCES += main.cpp
|
||||
|
||||
|
||||
@@ -2025,7 +2025,7 @@ Sollen sie überschrieben werden?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure...</source>
|
||||
<translation>Einstellungen...</translation>
|
||||
<translation type="obsolete">Einstellungen...</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -3528,7 +3528,7 @@ Sie haben die Wahl zwischen Abwarten oder Abbrechen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open Memory Editor at 0x%1</source>
|
||||
<translation>Speicher-Editor bei %1 öffnen</translation>
|
||||
<translation>Speicher-Editor bei 0x%1 öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open Disassembler at 0x%1</source>
|
||||
@@ -4091,7 +4091,7 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configure...</source>
|
||||
<translation>Einstellungen...</translation>
|
||||
<translation type="obsolete">Einstellungen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Choose a Class Name</source>
|
||||
@@ -5640,6 +5640,10 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
<source>Diff Project "%1"</source>
|
||||
<translation>Diff für Projekt "%1"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undo Uncommited Changes...</source>
|
||||
<translation>Ausstehende Änderungen rückgängig machen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Stashes...</source>
|
||||
<translation>Stashes...</translation>
|
||||
@@ -5674,11 +5678,11 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undo Uncommitted Changes</source>
|
||||
<translation>Nicht eingetragene Änderungen rückgängig machen</translation>
|
||||
<translation>Ausstehende Änderungen rückgängig machen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undo Uncommitted Changes for "%1"</source>
|
||||
<translation>Nicht eingetragene Änderungen in "%1" rückgängig machen</translation>
|
||||
<translation>Ausstehende Änderungen in "%1" rückgängig machen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clean Project...</source>
|
||||
@@ -5748,6 +5752,17 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
<source>Log</source>
|
||||
<translation>Log</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undo all pending changes to the repository
|
||||
%1?</source>
|
||||
<translation>Möchten Sie alle ausstehenden Änderungen des Repositories
|
||||
%1
|
||||
rückgängig machen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Undo Changes</source>
|
||||
<translation>Änderungen rückgängig machen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Closing Git Editor</source>
|
||||
<translation>Git-Editor schließen</translation>
|
||||
@@ -5782,7 +5797,7 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Reset...</source>
|
||||
<translation>Repository Zurücksetzen...</translation>
|
||||
<translation type="obsolete">Repository Zurücksetzen...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Clean...</source>
|
||||
@@ -5823,11 +5838,11 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
<message>
|
||||
<source>Revert all pending changes to the repository
|
||||
%1?</source>
|
||||
<translation>Möchten Sie alle ausstehenden Änderungen des Repositories %1 rückgängig machen?</translation>
|
||||
<translation type="obsolete">Möchten Sie alle ausstehenden Änderungen des Repositories %1 rückgängig machen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Revert</source>
|
||||
<translation>Rückgängig machen</translation>
|
||||
<translation type="obsolete">Rückgängig machen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Another submit is currently being executed.</source>
|
||||
@@ -5955,7 +5970,7 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Omit date from annotation output</source>
|
||||
<translation>Datum in Annotation weglassen</translation>
|
||||
<translation type="obsolete">Datum in Annotation weglassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Miscellaneous</source>
|
||||
@@ -6003,7 +6018,15 @@ on slow machines. In this case, the value should be increased.</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ignore whitespace changes in annotation and diff</source>
|
||||
<translation>Änderungen der Leerzeichen bei Annotation und Diff weglassen</translation>
|
||||
<translation type="obsolete">Änderungen der Leerzeichen bei Annotation und Diff weglassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Omit date from blame output</source>
|
||||
<translation>Datum bei Blame-Ausgabe weglassen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Ignore whitespace changes in blame and diff</source>
|
||||
<translation>Änderungen der Leerzeichen bei Blame- und Diff-Ausgabe weglassen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -7980,12 +8003,12 @@ Fehler: %2</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No Executable specified.</source>
|
||||
<translation>Es wurde keine ausführbaren Datei angegeben.
|
||||
<translation type="obsolete">Es wurde keine ausführbaren Datei angegeben.
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Running executable: <b>%1</b> %2</source>
|
||||
<translation>Führe aus: <b>%1</b> %2</translation>
|
||||
<translation type="obsolete">Führe aus: <b>%1</b> %2</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -8595,7 +8618,7 @@ konnte dem Projekt '%2' nicht hinzugefügt werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>F5</source>
|
||||
<translation>F5</translation>
|
||||
<translation type="obsolete">F5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add New...</source>
|
||||
@@ -13105,6 +13128,14 @@ p, li { white-space: pre-wrap; }
|
||||
<source>Invalid regular expression flag '%0'</source>
|
||||
<translation>Ungültiger Modifikator für regulären Ausdruck '%0'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unterminated regular expression backslash sequence</source>
|
||||
<translation>Der reguläre Ausdruck endet mit einer nicht abgeschlossenen Backslash-Sequenz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unterminated regular expression class</source>
|
||||
<translation>Nicht abgeschlossene Zeichenklassenangabe innerhalb des regulären Ausdrucks</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Syntax error</source>
|
||||
<translation>Syntaxfehler</translation>
|
||||
@@ -17888,6 +17919,14 @@ should a repository require SSH-authentication (see documentation on SSH and the
|
||||
<source>Could not move package files from %1 to %2.</source>
|
||||
<translation>Die Paketdateien konnten nicht von %1 zu %2 verschoben werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Packaging failed: Foreign debian directory detected.</source>
|
||||
<translation>Fehlschlag bei Paketerstellung: Es wurde ein fremder Debian-Ordner festgestellt.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>You are not using a shadow build and there is a debian directory in your project root ('%1'). Qt Creator will not overwrite that directory. Please remove it or use the shadow build feature.</source>
|
||||
<translation>Sie verwenden keinen Shadow-Build und es befindet sich ein Debian-Ordner im Hauptordner Ihres Projektes ('%1'). Qt Creator wird diesen Ordner nicht überschreiben. Bitte entfernen Sie den Ordner oder verwenden Sie einen Shadow-Build.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Could not remove directory '%1'.</source>
|
||||
<translation>Der Ordner %1 konnte nicht entfernt werden.</translation>
|
||||
@@ -17900,6 +17939,10 @@ should a repository require SSH-authentication (see documentation on SSH and the
|
||||
<source>Could not copy file '%1' to '%2'</source>
|
||||
<translation>Die Datei '%1' konnte nicht nach '%2' kopiert werden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error: Could not create create file '%1'.</source>
|
||||
<translation>Fehler: Die Datei '%1' konnte nicht erstellt werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Packaging error: Could not start command '%1'. Reason: %2</source>
|
||||
<translation>Fehler bei Paketerstellung: Das Kommando '%1' konnte nicht ausgeführt werden: %2</translation>
|
||||
@@ -18255,7 +18298,7 @@ Es wird versucht eine Paketdatei zu erstellen, es können aber Probleme auftrete
|
||||
</message>
|
||||
<message>
|
||||
<source>Warning: Cannot build qmldump; Qt version must be 4.7.1 or higher.</source>
|
||||
<translation>Warnung: Der QML-Beobachter kann nicht erstellt werden, da er Qt-Version 4.7.1 oder höher erfordert.</translation>
|
||||
<translation>Warnung: Das Werkzeug qmldump kann nicht erstellt werden, da es Qt-Version 4.7.1 oder höher erfordert.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -20838,6 +20881,10 @@ Fehlerausgabe: %1</translation>
|
||||
</context>
|
||||
<context>
|
||||
<name>Qt4ProjectManager::Internal::MaemoTemplatesManager</name>
|
||||
<message>
|
||||
<source>Error creating Maemo packaging directory '%1'.</source>
|
||||
<translation>Fehler beim Anlegen des Maemo-Paket-Ordners '%1'</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to create Debian templates: dh_make failed (%1)</source>
|
||||
<translation>Es konnten keine Debian-Vorlagedateien erstellt werden: dh_make schlug fehl (%1)</translation>
|
||||
@@ -20846,6 +20893,10 @@ Fehlerausgabe: %1</translation>
|
||||
<source>Unable to create debian templates: dh_make failed (%1)</source>
|
||||
<translation>Es konnten keine Debian-Vorlagedateien erstellt werden: dh_make schlug fehl (%1)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unable to move new debian directory to '%1'.</source>
|
||||
<translation>Der Debian-Ordner konnte nicht zu %1 verschoben werden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Packaging Error: Cannot open file '%1'.</source>
|
||||
<translation>Fehler bei Paketerstellung: Die Datei '%1' kann nicht geöffnet werden.</translation>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <extensionsystem/iplugin.h>
|
||||
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDebug>
|
||||
@@ -221,8 +222,16 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
// Make sure we honor the system's proxy settings
|
||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||
QUrl proxyUrl(QString::fromLatin1(qgetenv("http_proxy")));
|
||||
if (proxyUrl.isValid()) {
|
||||
QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyUrl.host(),
|
||||
proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
|
||||
QNetworkProxy::setApplicationProxy(proxy);
|
||||
}
|
||||
#else
|
||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||
|
||||
#endif
|
||||
// Load
|
||||
ExtensionSystem::PluginManager pluginManager;
|
||||
pluginManager.setFileExtension(QLatin1String("pluginspec"));
|
||||
|
||||
@@ -324,7 +324,7 @@ void QmlEditorWidgets::EasingContextPane::on_easingShapeComboBox_currentIndexCha
|
||||
m_easingGraph->setPeriod(ui->periodSpinBox->value());
|
||||
m_easingGraph->setOvershoot(ui->overshootSpinBox->value());
|
||||
m_simulation->updateCurve(m_easingGraph->easingCurve(),ui->durationSpinBox->value());
|
||||
emit propertyChanged(QLatin1String("easing.type"), QVariant("\""+m_easingGraph->easingName()+"\""));
|
||||
emit propertyChanged(QLatin1String("easing.type"), QVariant(QLatin1String("Easing.")+m_easingGraph->easingName()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ void QmlEditorWidgets::EasingContextPane::on_easingExtremesComboBox_currentIndex
|
||||
m_easingGraph->setPeriod(ui->periodSpinBox->value());
|
||||
m_easingGraph->setOvershoot(ui->overshootSpinBox->value());
|
||||
m_simulation->updateCurve(m_easingGraph->easingCurve(),ui->durationSpinBox->value());
|
||||
emit propertyChanged(QLatin1String("easing.type"), QVariant("\""+m_easingGraph->easingName()+"\""));
|
||||
emit propertyChanged(QLatin1String("easing.type"), QVariant(QLatin1String("Easing.")+m_easingGraph->easingName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
s/private\/qdeclarative/qml/g
|
||||
s/qdeclarative/qml/g
|
||||
s/QDECLARATIVE/QML/g
|
||||
s/QDeclarative/Qml/g
|
||||
|
||||
@@ -170,10 +170,9 @@ bool QmlDirParser::parse()
|
||||
const int dotIndex = version.indexOf(QLatin1Char('.'));
|
||||
|
||||
if (dotIndex == -1) {
|
||||
qWarning() << "expected '.'"; // ### use reportError
|
||||
reportError(lineNumber, -1, QLatin1String("expected '.'"));
|
||||
} else if (version.indexOf(QLatin1Char('.'), dotIndex + 1) != -1) {
|
||||
qWarning() << "unexpected '.'"; // ### use reportError
|
||||
|
||||
reportError(lineNumber, -1, QLatin1String("unexpected '.'"));
|
||||
} else {
|
||||
bool validVersionNumber = false;
|
||||
const int majorVersion = version.left(dotIndex).toInt(&validVersionNumber);
|
||||
@@ -189,8 +188,8 @@ bool QmlDirParser::parse()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// ### use reportError
|
||||
qWarning() << "a component declaration requires 3 arguments, but" << (sectionCount + 1) << "were provided";
|
||||
reportError(lineNumber, -1,
|
||||
QString::fromUtf8("a component declaration requires 3 arguments, but %1 were provided").arg(sectionCount + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,27 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
/*!
|
||||
\class QmlError
|
||||
\since 4.7
|
||||
\brief The QmlError class encapsulates a QML error
|
||||
\since 4.7
|
||||
\brief The QmlError class encapsulates a QML error.
|
||||
|
||||
QmlError includes a textual description of the error, as well
|
||||
as location information (the file, line, and column). The toString()
|
||||
method creates a single-line, human-readable string containing all of
|
||||
this information, for example:
|
||||
\code
|
||||
file:///home/user/test.qml:7:8: Invalid property assignment: double expected
|
||||
\endcode
|
||||
|
||||
You can use qDebug() or qWarning() to output errors to the console. This method
|
||||
will attempt to open the file indicated by the error
|
||||
and include additional contextual information.
|
||||
\code
|
||||
file:///home/user/test.qml:7:8: Invalid property assignment: double expected
|
||||
y: "hello"
|
||||
^
|
||||
\endcode
|
||||
|
||||
\sa QmlView::errors(), QmlComponent::errors()
|
||||
*/
|
||||
class QmlErrorPrivate
|
||||
{
|
||||
@@ -69,7 +88,7 @@ QmlErrorPrivate::QmlErrorPrivate()
|
||||
}
|
||||
|
||||
/*!
|
||||
Create an empty error object.
|
||||
Creates an empty error object.
|
||||
*/
|
||||
QmlError::QmlError()
|
||||
: d(0)
|
||||
@@ -77,7 +96,7 @@ QmlError::QmlError()
|
||||
}
|
||||
|
||||
/*!
|
||||
Create a copy of \a other.
|
||||
Creates a copy of \a other.
|
||||
*/
|
||||
QmlError::QmlError(const QmlError &other)
|
||||
: d(0)
|
||||
@@ -86,7 +105,7 @@ QmlError::QmlError(const QmlError &other)
|
||||
}
|
||||
|
||||
/*!
|
||||
Assign \a other to this error object.
|
||||
Assigns \a other to this error object.
|
||||
*/
|
||||
QmlError &QmlError::operator=(const QmlError &other)
|
||||
{
|
||||
@@ -112,7 +131,7 @@ QmlError::~QmlError()
|
||||
}
|
||||
|
||||
/*!
|
||||
Return true if this error is valid, otherwise false.
|
||||
Returns true if this error is valid, otherwise false.
|
||||
*/
|
||||
bool QmlError::isValid() const
|
||||
{
|
||||
@@ -120,7 +139,7 @@ bool QmlError::isValid() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the url for the file that caused this error.
|
||||
Returns the url for the file that caused this error.
|
||||
*/
|
||||
QUrl QmlError::url() const
|
||||
{
|
||||
@@ -129,7 +148,7 @@ QUrl QmlError::url() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the \a url for the file that caused this error.
|
||||
Sets the \a url for the file that caused this error.
|
||||
*/
|
||||
void QmlError::setUrl(const QUrl &url)
|
||||
{
|
||||
@@ -138,7 +157,7 @@ void QmlError::setUrl(const QUrl &url)
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the error description.
|
||||
Returns the error description.
|
||||
*/
|
||||
QString QmlError::description() const
|
||||
{
|
||||
@@ -147,7 +166,7 @@ QString QmlError::description() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the error \a description.
|
||||
Sets the error \a description.
|
||||
*/
|
||||
void QmlError::setDescription(const QString &description)
|
||||
{
|
||||
@@ -156,7 +175,7 @@ void QmlError::setDescription(const QString &description)
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the error line number.
|
||||
Returns the error line number.
|
||||
*/
|
||||
int QmlError::line() const
|
||||
{
|
||||
@@ -165,7 +184,7 @@ int QmlError::line() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the error \a line number.
|
||||
Sets the error \a line number.
|
||||
*/
|
||||
void QmlError::setLine(int line)
|
||||
{
|
||||
@@ -174,7 +193,7 @@ void QmlError::setLine(int line)
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the error column number.
|
||||
Returns the error column number.
|
||||
*/
|
||||
int QmlError::column() const
|
||||
{
|
||||
@@ -183,7 +202,7 @@ int QmlError::column() const
|
||||
}
|
||||
|
||||
/*!
|
||||
Set the error \a column number.
|
||||
Sets the error \a column number.
|
||||
*/
|
||||
void QmlError::setColumn(int column)
|
||||
{
|
||||
@@ -192,14 +211,20 @@ void QmlError::setColumn(int column)
|
||||
}
|
||||
|
||||
/*!
|
||||
Return the error as a human readable string.
|
||||
Returns the error as a human readable string.
|
||||
*/
|
||||
QString QmlError::toString() const
|
||||
{
|
||||
QString rv;
|
||||
rv = url().toString() + QLatin1Char(':') + QString::number(line());
|
||||
if(column() != -1)
|
||||
rv += QLatin1Char(':') + QString::number(column());
|
||||
if (url().isEmpty()) {
|
||||
rv = QLatin1String("<Unknown File>");
|
||||
} else if (line() != -1) {
|
||||
rv = url().toString() + QLatin1Char(':') + QString::number(line());
|
||||
if(column() != -1)
|
||||
rv += QLatin1Char(':') + QString::number(column());
|
||||
} else {
|
||||
rv = url().toString();
|
||||
}
|
||||
|
||||
rv += QLatin1String(": ") + description();
|
||||
|
||||
@@ -210,7 +235,7 @@ QString QmlError::toString() const
|
||||
\relates QmlError
|
||||
\fn QDebug operator<<(QDebug debug, const QmlError &error)
|
||||
|
||||
Output a human readable version of \a error to \a debug.
|
||||
Outputs a human readable version of \a error to \a debug.
|
||||
*/
|
||||
|
||||
QDebug operator<<(QDebug debug, const QmlError &error)
|
||||
@@ -225,7 +250,9 @@ QDebug operator<<(QDebug debug, const QmlError &error)
|
||||
if (f.open(QIODevice::ReadOnly)) {
|
||||
QByteArray data = f.readAll();
|
||||
QTextStream stream(data, QIODevice::ReadOnly);
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
stream.setCodec("UTF-8");
|
||||
#endif
|
||||
const QString code = stream.readAll();
|
||||
const QStringList lines = code.split(QLatin1Char('\n'));
|
||||
|
||||
|
||||
@@ -1376,7 +1376,7 @@ case $rule_number: {
|
||||
} break;
|
||||
./
|
||||
|
||||
PropertyName: T_IDENTIFIER %prec REDUCE_HERE ;
|
||||
PropertyName: T_IDENTIFIER %prec SHIFT_THERE ;
|
||||
/.
|
||||
case $rule_number: {
|
||||
AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval);
|
||||
|
||||
@@ -224,6 +224,9 @@ public:
|
||||
inline Node()
|
||||
: kind(Kind_Undefined) {}
|
||||
|
||||
// NOTE: node destructors are never called,
|
||||
// instead we block free the memory
|
||||
// (see the NodePool class)
|
||||
virtual ~Node() {}
|
||||
|
||||
virtual ExpressionNode *expressionCast();
|
||||
@@ -247,7 +250,6 @@ class QML_PARSER_EXPORT ExpressionNode: public Node
|
||||
{
|
||||
public:
|
||||
ExpressionNode() {}
|
||||
virtual ~ExpressionNode() {}
|
||||
|
||||
virtual ExpressionNode *expressionCast();
|
||||
|
||||
@@ -259,7 +261,6 @@ class QML_PARSER_EXPORT Statement: public Node
|
||||
{
|
||||
public:
|
||||
Statement() {}
|
||||
virtual ~Statement() {}
|
||||
|
||||
virtual Statement *statementCast();
|
||||
|
||||
@@ -272,7 +273,7 @@ class QML_PARSER_EXPORT UiFormal: public Node
|
||||
public:
|
||||
QMLJS_DECLARE_AST_NODE(UiFormal)
|
||||
|
||||
explicit UiFormal(NameId *name, NameId *alias = 0)
|
||||
UiFormal(NameId *name, NameId *alias = 0)
|
||||
: name(name), alias(alias)
|
||||
{ }
|
||||
|
||||
@@ -379,7 +380,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(ThisExpression)
|
||||
|
||||
ThisExpression() { kind = K; }
|
||||
virtual ~ThisExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -401,8 +401,6 @@ public:
|
||||
IdentifierExpression(NameId *n):
|
||||
name (n) { kind = K; }
|
||||
|
||||
virtual ~IdentifierExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -422,7 +420,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(NullExpression)
|
||||
|
||||
NullExpression() { kind = K; }
|
||||
virtual ~NullExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -442,7 +439,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(TrueLiteral)
|
||||
|
||||
TrueLiteral() { kind = K; }
|
||||
virtual ~TrueLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -462,7 +458,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(FalseLiteral)
|
||||
|
||||
FalseLiteral() { kind = K; }
|
||||
virtual ~FalseLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -483,7 +478,6 @@ public:
|
||||
|
||||
NumericLiteral(double v):
|
||||
value(v) { kind = K; }
|
||||
virtual ~NumericLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -506,8 +500,6 @@ public:
|
||||
StringLiteral(NameId *v):
|
||||
value (v) { kind = K; }
|
||||
|
||||
virtual ~StringLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -529,8 +521,6 @@ public:
|
||||
RegExpLiteral(NameId *p, int f):
|
||||
pattern (p), flags (f) { kind = K; }
|
||||
|
||||
virtual ~RegExpLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -562,8 +552,6 @@ public:
|
||||
elements (elts), elision (e)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~ArrayLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -591,8 +579,6 @@ public:
|
||||
ObjectLiteral(PropertyNameAndValueList *plist):
|
||||
properties (plist) { kind = K; }
|
||||
|
||||
virtual ~ObjectLiteral() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -624,8 +610,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~ElementList() {}
|
||||
|
||||
inline ElementList *finish ()
|
||||
{
|
||||
ElementList *front = next;
|
||||
@@ -657,8 +641,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~Elision() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline Elision *finish ()
|
||||
@@ -690,8 +672,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~PropertyNameAndValueList() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline PropertyNameAndValueList *finish ()
|
||||
@@ -715,7 +695,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(PropertyName)
|
||||
|
||||
PropertyName() { kind = K; }
|
||||
virtual ~PropertyName() {}
|
||||
|
||||
// attributes
|
||||
SourceLocation propertyNameToken;
|
||||
@@ -729,8 +708,6 @@ public:
|
||||
IdentifierPropertyName(NameId *n):
|
||||
id (n) { kind = K; }
|
||||
|
||||
virtual ~IdentifierPropertyName() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -744,7 +721,6 @@ public:
|
||||
|
||||
StringLiteralPropertyName(NameId *n):
|
||||
id (n) { kind = K; }
|
||||
virtual ~StringLiteralPropertyName() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -759,7 +735,6 @@ public:
|
||||
|
||||
NumericLiteralPropertyName(double n):
|
||||
id (n) { kind = K; }
|
||||
virtual ~NumericLiteralPropertyName() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -776,8 +751,6 @@ public:
|
||||
base (b), expression (e)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~ArrayMemberExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -802,8 +775,6 @@ public:
|
||||
base (b), name (n)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~FieldMemberExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -828,8 +799,6 @@ public:
|
||||
base (b), arguments (a)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~NewMemberExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -854,8 +823,6 @@ public:
|
||||
NewExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~NewExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -878,8 +845,6 @@ public:
|
||||
base (b), arguments (a)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~CallExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -912,8 +877,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~ArgumentList() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline ArgumentList *finish ()
|
||||
@@ -937,8 +900,6 @@ public:
|
||||
PostIncrementExpression(ExpressionNode *b):
|
||||
base (b) { kind = K; }
|
||||
|
||||
virtual ~PostIncrementExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -960,8 +921,6 @@ public:
|
||||
PostDecrementExpression(ExpressionNode *b):
|
||||
base (b) { kind = K; }
|
||||
|
||||
virtual ~PostDecrementExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -982,7 +941,6 @@ public:
|
||||
|
||||
DeleteExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
virtual ~DeleteExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -1005,8 +963,6 @@ public:
|
||||
VoidExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~VoidExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1028,8 +984,6 @@ public:
|
||||
TypeOfExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~TypeOfExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1051,8 +1005,6 @@ public:
|
||||
PreIncrementExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~PreIncrementExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1074,8 +1026,6 @@ public:
|
||||
PreDecrementExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~PreDecrementExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1097,8 +1047,6 @@ public:
|
||||
UnaryPlusExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~UnaryPlusExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1120,8 +1068,6 @@ public:
|
||||
UnaryMinusExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~UnaryMinusExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1143,8 +1089,6 @@ public:
|
||||
TildeExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~TildeExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1166,8 +1110,6 @@ public:
|
||||
NotExpression(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~NotExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1190,8 +1132,6 @@ public:
|
||||
left (l), op (o), right (r)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~BinaryExpression() {}
|
||||
|
||||
virtual BinaryExpression *binaryExpressionCast();
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
@@ -1218,8 +1158,6 @@ public:
|
||||
expression (e), ok (t), ko (f)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~ConditionalExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1244,8 +1182,6 @@ public:
|
||||
Expression(ExpressionNode *l, ExpressionNode *r):
|
||||
left (l), right (r) { kind = K; }
|
||||
|
||||
virtual ~Expression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1268,8 +1204,6 @@ public:
|
||||
Block(StatementList *slist):
|
||||
statements (slist) { kind = K; }
|
||||
|
||||
virtual ~Block() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1301,8 +1235,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~StatementList() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline StatementList *finish ()
|
||||
@@ -1326,8 +1258,6 @@ public:
|
||||
declarations (vlist)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~VariableStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1351,8 +1281,6 @@ public:
|
||||
name (n), expression (e), readOnly(false)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~VariableDeclaration() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1379,8 +1307,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~VariableDeclarationList() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline VariableDeclarationList *finish (bool readOnly)
|
||||
@@ -1407,7 +1333,6 @@ public:
|
||||
QMLJS_DECLARE_AST_NODE(EmptyStatement)
|
||||
|
||||
EmptyStatement() { kind = K; }
|
||||
virtual ~EmptyStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
@@ -1429,8 +1354,6 @@ public:
|
||||
ExpressionStatement(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~ExpressionStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1453,8 +1376,6 @@ public:
|
||||
expression (e), ok (t), ko (f)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~IfStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1487,8 +1408,6 @@ public:
|
||||
statement (stmt), expression (e)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~DoWhileStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1516,8 +1435,6 @@ public:
|
||||
expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~WhileStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1543,8 +1460,6 @@ public:
|
||||
initialiser (i), condition (c), expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~ForStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1574,8 +1489,6 @@ public:
|
||||
declarations (vlist), condition (c), expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~LocalForStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1606,8 +1519,6 @@ public:
|
||||
initialiser (i), expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~ForEachStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1635,8 +1546,6 @@ public:
|
||||
declaration (v), expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~LocalForEachStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1664,8 +1573,6 @@ public:
|
||||
ContinueStatement(NameId *l = 0):
|
||||
label (l) { kind = K; }
|
||||
|
||||
virtual ~ContinueStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1689,8 +1596,6 @@ public:
|
||||
BreakStatement(NameId *l = 0):
|
||||
label (l) { kind = K; }
|
||||
|
||||
virtual ~BreakStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1714,8 +1619,6 @@ public:
|
||||
ReturnStatement(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~ReturnStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1739,8 +1642,6 @@ public:
|
||||
expression (e), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~WithStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1762,12 +1663,10 @@ class QML_PARSER_EXPORT CaseBlock: public Node
|
||||
public:
|
||||
QMLJS_DECLARE_AST_NODE(CaseBlock)
|
||||
|
||||
explicit CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
|
||||
CaseBlock(CaseClauses *c, DefaultClause *d = 0, CaseClauses *r = 0):
|
||||
clauses (c), defaultClause (d), moreClauses (r)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~CaseBlock() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1787,8 +1686,6 @@ public:
|
||||
expression (e), block (b)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~SwitchStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1822,8 +1719,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~CaseClauses() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline CaseClauses *finish ()
|
||||
@@ -1847,8 +1742,6 @@ public:
|
||||
expression (e), statements (slist)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~CaseClause() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1867,8 +1760,6 @@ public:
|
||||
statements (slist)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~DefaultClause() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1886,8 +1777,6 @@ public:
|
||||
label (l), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~LabelledStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1911,8 +1800,6 @@ public:
|
||||
ThrowStatement(ExpressionNode *e):
|
||||
expression (e) { kind = K; }
|
||||
|
||||
virtual ~ThrowStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -1936,8 +1823,6 @@ public:
|
||||
name (n), statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~Catch() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1958,8 +1843,6 @@ public:
|
||||
statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~Finally() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -1984,8 +1867,6 @@ public:
|
||||
statement (stmt), catchExpression (c), finallyExpression (0)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~TryStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -2017,8 +1898,6 @@ public:
|
||||
name (n), formals (f), body (b)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~FunctionExpression() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -2048,8 +1927,6 @@ public:
|
||||
FunctionExpression(n, f, b)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~FunctionDeclaration() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
};
|
||||
|
||||
@@ -2070,8 +1947,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~FormalParameterList() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline FormalParameterList *finish ()
|
||||
@@ -2097,8 +1972,6 @@ public:
|
||||
elements (elts)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~FunctionBody() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -2114,8 +1987,6 @@ public:
|
||||
elements (elts)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~Program() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -2139,8 +2010,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~SourceElements() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
inline SourceElements *finish ()
|
||||
@@ -2162,8 +2031,6 @@ public:
|
||||
|
||||
inline SourceElement()
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~SourceElement() {}
|
||||
};
|
||||
|
||||
class QML_PARSER_EXPORT FunctionSourceElement: public SourceElement
|
||||
@@ -2175,8 +2042,6 @@ public:
|
||||
declaration (f)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~FunctionSourceElement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -2192,8 +2057,6 @@ public:
|
||||
statement (stmt)
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~StatementSourceElement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
// attributes
|
||||
@@ -2208,8 +2071,6 @@ public:
|
||||
DebuggerStatement()
|
||||
{ kind = K; }
|
||||
|
||||
virtual ~DebuggerStatement() {}
|
||||
|
||||
virtual void accept0(Visitor *visitor);
|
||||
|
||||
virtual SourceLocation firstSourceLocation() const
|
||||
@@ -2256,8 +2117,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~UiQualifiedId() {}
|
||||
|
||||
UiQualifiedId *finish()
|
||||
{
|
||||
UiQualifiedId *head = next;
|
||||
@@ -2459,8 +2318,6 @@ public:
|
||||
previous->next = this;
|
||||
}
|
||||
|
||||
virtual ~UiParameterList() {}
|
||||
|
||||
virtual void accept0(Visitor *) {}
|
||||
|
||||
inline UiParameterList *finish ()
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace QmlJS { namespace AST {
|
||||
class SourceLocation
|
||||
{
|
||||
public:
|
||||
explicit SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
|
||||
SourceLocation(quint32 offset = 0, quint32 length = 0, quint32 line = 0, quint32 column = 0)
|
||||
: offset(offset), length(length),
|
||||
startLine(line), startColumn(column)
|
||||
{ }
|
||||
|
||||
@@ -346,9 +346,9 @@ const short QmlJSGrammar::action_index [] = {
|
||||
|
||||
const short QmlJSGrammar::action_info [] = {
|
||||
399, 352, 345, -101, 343, 457, 440, 403, 257, -112,
|
||||
-125, -131, -123, -98, -120, 348, -128, 389, 453, 391,
|
||||
-125, -131, -123, 346, -120, 348, -128, 389, 453, 391,
|
||||
416, 401, 408, 563, -101, -123, 416, -120, 539, -131,
|
||||
-98, -112, -125, 348, 257, 99, 71, 645, 621, 101,
|
||||
346, -112, -125, 348, 257, 99, 71, 645, 621, 101,
|
||||
-128, 440, 141, 621, 164, 431, 539, 430, 453, 573,
|
||||
457, 444, 440, 424, 71, 424, 101, 446, 559, 420,
|
||||
424, 448, 539, 440, 570, 539, 466, 527, 312, 346,
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#include <string.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
extern double qstrtod(const char *s00, char const **se, bool *ok);
|
||||
Q_CORE_EXPORT double qstrtod(const char *s00, char const **se, bool *ok);
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_QML_BEGIN_NAMESPACE
|
||||
@@ -103,7 +103,7 @@ Lexer::Lexer(Engine *eng, bool tokenizeComments)
|
||||
prohibitAutomaticSemicolon(false),
|
||||
tokenizeComments(tokenizeComments)
|
||||
{
|
||||
driver->setLexer(this);
|
||||
if (driver) driver->setLexer(this);
|
||||
// allocate space for read buffers
|
||||
buffer8 = new char[size8];
|
||||
buffer16 = new QChar[size16];
|
||||
@@ -120,7 +120,7 @@ Lexer::~Lexer()
|
||||
|
||||
void Lexer::setCode(const QString &c, int lineno)
|
||||
{
|
||||
errmsg = QString();
|
||||
errmsg.clear();
|
||||
yylineno = lineno;
|
||||
yycolumn = 1;
|
||||
restrKeyword = false;
|
||||
@@ -484,6 +484,8 @@ int Lexer::lex()
|
||||
stackToken = -1;
|
||||
}
|
||||
|
||||
bool identifierWithEscapedUnicode = false;
|
||||
|
||||
while (!done) {
|
||||
switch (state) {
|
||||
case Start:
|
||||
@@ -508,22 +510,44 @@ int Lexer::lex()
|
||||
setDone(Eof);
|
||||
}
|
||||
} else if (isLineTerminator()) {
|
||||
shiftWindowsLineBreak();
|
||||
yylineno++;
|
||||
yycolumn = 0;
|
||||
bol = true;
|
||||
terminator = true;
|
||||
syncProhibitAutomaticSemicolon();
|
||||
if (restrKeyword) {
|
||||
// automatic semicolon insertion
|
||||
recordStartPos();
|
||||
token = QmlJSGrammar::T_SEMICOLON;
|
||||
setDone(Other);
|
||||
} else {
|
||||
shiftWindowsLineBreak();
|
||||
yylineno++;
|
||||
yycolumn = 0;
|
||||
bol = true;
|
||||
terminator = true;
|
||||
syncProhibitAutomaticSemicolon();
|
||||
}
|
||||
} else if (current == '"' || current == '\'') {
|
||||
recordStartPos();
|
||||
state = InString;
|
||||
multiLineString = false;
|
||||
stringType = current;
|
||||
} else if (current == '\\' && next1 == 'u') {
|
||||
identifierWithEscapedUnicode = true;
|
||||
recordStartPos();
|
||||
|
||||
shift(2); // skip the unicode escape prefix `\u'
|
||||
|
||||
if (isHexDigit(current) && isHexDigit(next1) &&
|
||||
isHexDigit(next2) && isHexDigit(next3)) {
|
||||
record16(convertUnicode(current, next1, next2, next3));
|
||||
shift(3);
|
||||
state = InIdentifier;
|
||||
} else {
|
||||
setDone(Bad);
|
||||
err = IllegalUnicodeEscapeSequence;
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Illegal unicode escape sequence");
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (isIdentLetter(current)) {
|
||||
identifierWithEscapedUnicode = false;
|
||||
recordStartPos();
|
||||
record16(current);
|
||||
state = InIdentifier;
|
||||
@@ -656,9 +680,9 @@ int Lexer::lex()
|
||||
setDone(Other);
|
||||
} else
|
||||
state = Start;
|
||||
driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
|
||||
if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
|
||||
} else if (current == 0) {
|
||||
driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
|
||||
if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
|
||||
setDone(Eof);
|
||||
}
|
||||
|
||||
@@ -668,14 +692,14 @@ int Lexer::lex()
|
||||
setDone(Bad);
|
||||
err = UnclosedComment;
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Unclosed comment at end of file");
|
||||
driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
|
||||
if (driver) driver->addComment(startpos+2, tokenLength()-2, startlineno, startcolumn+2);
|
||||
} else if (isLineTerminator()) {
|
||||
shiftWindowsLineBreak();
|
||||
yylineno++;
|
||||
} else if (current == '*' && next1 == '/') {
|
||||
state = Start;
|
||||
shift(1);
|
||||
driver->addComment(startpos, tokenLength(), startlineno, startcolumn);
|
||||
if (driver) driver->addComment(startpos+2, tokenLength()-3, startlineno, startcolumn+2);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -683,6 +707,21 @@ int Lexer::lex()
|
||||
if (isIdentLetter(current) || isDecimalDigit(current)) {
|
||||
record16(current);
|
||||
break;
|
||||
} else if (current == '\\' && next1 == 'u') {
|
||||
identifierWithEscapedUnicode = true;
|
||||
shift(2); // skip the unicode escape prefix `\u'
|
||||
|
||||
if (isHexDigit(current) && isHexDigit(next1) &&
|
||||
isHexDigit(next2) && isHexDigit(next3)) {
|
||||
record16(convertUnicode(current, next1, next2, next3));
|
||||
shift(3);
|
||||
break;
|
||||
} else {
|
||||
setDone(Bad);
|
||||
err = IllegalUnicodeEscapeSequence;
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Illegal unicode escape sequence");
|
||||
break;
|
||||
}
|
||||
}
|
||||
setDone(Identifier);
|
||||
break;
|
||||
@@ -825,7 +864,11 @@ int Lexer::lex()
|
||||
delimited = true;
|
||||
return token;
|
||||
case Identifier:
|
||||
if ((token = findReservedWord(buffer16, pos16)) < 0) {
|
||||
token = -1;
|
||||
if (! identifierWithEscapedUnicode)
|
||||
token = findReservedWord(buffer16, pos16);
|
||||
|
||||
if (token < 0) {
|
||||
/* TODO: close leak on parse error. same holds true for String */
|
||||
if (driver)
|
||||
qsyylval.ustr = driver->intern(buffer16, pos16);
|
||||
@@ -1104,47 +1147,97 @@ void Lexer::recordStartPos()
|
||||
bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
|
||||
{
|
||||
pos16 = 0;
|
||||
bool lastWasEscape = false;
|
||||
pattern = 0;
|
||||
|
||||
if (prefix == EqualPrefix)
|
||||
record16(QLatin1Char('='));
|
||||
|
||||
while (1) {
|
||||
if (isLineTerminator() || current == 0) {
|
||||
while (true) {
|
||||
switch (current) {
|
||||
|
||||
case 0: // eof
|
||||
case '\n': case '\r': // line terminator
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Unterminated regular expression literal");
|
||||
return false;
|
||||
}
|
||||
else if (current != '/' || lastWasEscape == true)
|
||||
{
|
||||
record16(current);
|
||||
lastWasEscape = !lastWasEscape && (current == '\\');
|
||||
}
|
||||
else {
|
||||
if (driver)
|
||||
|
||||
case '/':
|
||||
shift(1);
|
||||
|
||||
if (driver) // create the pattern
|
||||
pattern = driver->intern(buffer16, pos16);
|
||||
else
|
||||
pattern = 0;
|
||||
|
||||
// scan the flags
|
||||
pos16 = 0;
|
||||
flags = 0;
|
||||
while (isIdentLetter(current)) {
|
||||
int flag = Ecma::RegExp::flagFromChar(current);
|
||||
if (flag == 0) {
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Invalid regular expression flag '%0'")
|
||||
.arg(QChar(current));
|
||||
return false;
|
||||
}
|
||||
flags |= flag;
|
||||
record16(current);
|
||||
shift(1);
|
||||
}
|
||||
return true;
|
||||
|
||||
case '\\':
|
||||
// regular expression backslash sequence
|
||||
record16(current);
|
||||
shift(1);
|
||||
|
||||
if (! current || isLineTerminator()) {
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Unterminated regular expression backslash sequence");
|
||||
return false;
|
||||
}
|
||||
|
||||
record16(current);
|
||||
shift(1);
|
||||
break;
|
||||
}
|
||||
shift(1);
|
||||
}
|
||||
|
||||
flags = 0;
|
||||
while (isIdentLetter(current)) {
|
||||
int flag = Ecma::RegExp::flagFromChar(current);
|
||||
if (flag == 0) {
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Invalid regular expression flag '%0'")
|
||||
.arg(QChar(current));
|
||||
return false;
|
||||
}
|
||||
flags |= flag;
|
||||
record16(current);
|
||||
shift(1);
|
||||
}
|
||||
case '[':
|
||||
// regular expression class
|
||||
record16(current);
|
||||
shift(1);
|
||||
|
||||
return true;
|
||||
while (current && ! isLineTerminator()) {
|
||||
if (current == ']')
|
||||
break;
|
||||
else if (current == '\\') {
|
||||
// regular expression backslash sequence
|
||||
record16(current);
|
||||
shift(1);
|
||||
|
||||
if (! current || isLineTerminator()) {
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Unterminated regular expression backslash sequence");
|
||||
return false;
|
||||
}
|
||||
|
||||
record16(current);
|
||||
shift(1);
|
||||
} else {
|
||||
record16(current);
|
||||
shift(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (current != ']') {
|
||||
errmsg = QCoreApplication::translate("QmlParser", "Unterminated regular expression class");
|
||||
return false;
|
||||
}
|
||||
|
||||
record16(current);
|
||||
shift(1); // skip ]
|
||||
break;
|
||||
|
||||
default:
|
||||
record16(current);
|
||||
shift(1);
|
||||
} // switch
|
||||
} // while
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Lexer::syncProhibitAutomaticSemicolon()
|
||||
|
||||
@@ -67,7 +67,7 @@ class NameId;
|
||||
class QML_PARSER_EXPORT Lexer
|
||||
{
|
||||
public:
|
||||
explicit Lexer(Engine *eng, bool tokenizeComments = false);
|
||||
Lexer(Engine *eng, bool tokenizeComments = false);
|
||||
~Lexer();
|
||||
|
||||
void setCode(const QString &c, int lineno);
|
||||
|
||||
@@ -93,6 +93,9 @@ Interpreter::ObjectValue *Bind::findQmlObject(AST::Node *node) const
|
||||
bool Bind::usesQmlPrototype(ObjectValue *prototype,
|
||||
const Context *context) const
|
||||
{
|
||||
// ### This function is disabled for performance reasons.
|
||||
return false;
|
||||
|
||||
foreach (ObjectValue *object, _qmlObjects.values()) {
|
||||
const ObjectValue *resolvedPrototype = object->prototype(context);
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ class QMLJS_EXPORT IContextPane : public QObject
|
||||
public:
|
||||
IContextPane(QObject *parent = 0) : QObject(parent) {}
|
||||
virtual ~IContextPane() {}
|
||||
virtual void apply(TextEditor::BaseTextEditorEditable *editor, LookupContext::Ptr lookupContext, AST::Node *node, bool update, bool force = false) = 0;
|
||||
virtual void apply(TextEditor::BaseTextEditorEditable *editor, Document::Ptr document, LookupContext::Ptr lookupContext, AST::Node *node, bool update, bool force = false) = 0;
|
||||
virtual void setEnabled(bool) = 0;
|
||||
virtual bool isAvailable(TextEditor::BaseTextEditorEditable *editor, LookupContext::Ptr lookupContext, AST::Node *node) = 0;
|
||||
virtual bool isAvailable(TextEditor::BaseTextEditorEditable *editor, Document::Ptr document, AST::Node *node) = 0;
|
||||
virtual QWidget* widget() = 0;
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
@@ -2401,6 +2401,11 @@ Engine::Engine()
|
||||
initializePrototypes();
|
||||
|
||||
_cppQmlTypes.load(this, CppQmlTypesLoader::builtinObjects);
|
||||
|
||||
// the 'Qt' object is dumped even though it is not exported
|
||||
// it contains useful information, in particular on enums - add the
|
||||
// object as a prototype to our custom Qt object to offer these for completion
|
||||
_qtObject->setPrototype(_cppQmlTypes.typeForImport(QLatin1String("Qt")));
|
||||
}
|
||||
|
||||
Engine::~Engine()
|
||||
|
||||
@@ -665,13 +665,13 @@ Rewriter::Range Rewriter::addObject(UiArrayBinding *ast, const QString &content,
|
||||
QString textToInsert;
|
||||
if (insertAfter && insertAfter->member) {
|
||||
insertionPoint = insertAfter->member->lastSourceLocation().end();
|
||||
textToInsert += QLatin1String("\n");
|
||||
textToInsert = QLatin1String(",\n") + content;
|
||||
} else {
|
||||
insertionPoint = ast->lbracketToken.end();
|
||||
textToInsert += QLatin1String("\n") + content + QLatin1Char(',');
|
||||
}
|
||||
|
||||
textToInsert += content;
|
||||
m_changeSet->insert(insertionPoint, QLatin1String("\n") + textToInsert);
|
||||
m_changeSet->insert(insertionPoint, textToInsert);
|
||||
|
||||
return Range(insertionPoint, insertionPoint);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,8 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
|
||||
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
|
||||
if ((qmlMetaObject->className() == QLatin1String("ListElement")
|
||||
|| qmlMetaObject->className() == QLatin1String("Connections")
|
||||
) && qmlMetaObject->packageName() == QLatin1String("Qt")) {
|
||||
) && (qmlMetaObject->packageName() == QLatin1String("Qt")
|
||||
|| qmlMetaObject->packageName() == QLatin1String("QtQuick"))) {
|
||||
scopeChain.qmlScopeObjects.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,6 @@ SettingsDialog::SettingsDialog(QWidget *parent) :
|
||||
m_proxyModel, SLOT(setFilterFixedString(QString)));
|
||||
connect(m_filterLineEdit, SIGNAL(filterChanged(QString)), this, SLOT(filter(QString)));
|
||||
m_categoryList->setFocus();
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
}
|
||||
|
||||
void SettingsDialog::showPage(const QString &categoryId, const QString &pageId)
|
||||
@@ -522,6 +521,11 @@ bool SettingsDialog::execDialog()
|
||||
if (!m_running) {
|
||||
m_running = true;
|
||||
exec();
|
||||
m_running = false;
|
||||
m_instance = 0;
|
||||
// make sure that the current "single" instance is deleted
|
||||
// we can't delete right away, since we still access the m_applied member
|
||||
deleteLater();
|
||||
} else {
|
||||
// exec dialog is called while the instance is already running
|
||||
// this can happen when a event triggers a code path that wants to
|
||||
|
||||
@@ -455,6 +455,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
|
||||
EditorManager::~EditorManager()
|
||||
{
|
||||
m_instance = 0;
|
||||
if (m_d->m_core) {
|
||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||
if (m_d->m_coreListener) {
|
||||
|
||||
@@ -165,7 +165,6 @@ NavigationWidget::NavigationWidget(QAction *toggleSideBarAction) :
|
||||
{
|
||||
d->m_factoryModel->setSortRole(FactoryPriorityRole);
|
||||
setOrientation(Qt::Vertical);
|
||||
insertSubItem(0, -1); // we don't have any entry to show yet
|
||||
d->m_instance = this;
|
||||
}
|
||||
|
||||
@@ -327,17 +326,22 @@ void NavigationWidget::restoreSettings(QSettings *settings)
|
||||
settings->setValue("Navigation/Version", 2);
|
||||
}
|
||||
|
||||
for (int i=0; i<viewIds.count(); ++i) {
|
||||
const QString &view = viewIds.at(i);
|
||||
int index = factoryIndex(view);
|
||||
|
||||
if (i >= d->m_subWidgets.size()) {
|
||||
insertSubItem(i, index);
|
||||
int position = 0;
|
||||
foreach (const QString &id, viewIds) {
|
||||
int index = factoryIndex(id);
|
||||
if (index >= 0) {
|
||||
// Only add if the id was actually found!
|
||||
insertSubItem(position, index);
|
||||
++position;
|
||||
} else {
|
||||
d->m_subWidgets.at(i)->setFactoryIndex(index);
|
||||
restoreSplitterState = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (d->m_subWidgets.isEmpty())
|
||||
// Make sure we have at least the projects widget
|
||||
insertSubItem(0, qMax(0, factoryIndex(QLatin1String("Projects"))));
|
||||
|
||||
if (settings->contains("Navigation/Visible")) {
|
||||
setShown(settings->value("Navigation/Visible").toBool());
|
||||
} else {
|
||||
|
||||
@@ -83,14 +83,7 @@ ClassNamePage::ClassNamePage(QWidget *parent) :
|
||||
pageLayout->addWidget(m_newClassWidget);
|
||||
QSpacerItem *vSpacer = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding);
|
||||
pageLayout->addItem(vSpacer);
|
||||
QHBoxLayout *buttonLayout = new QHBoxLayout;
|
||||
pageLayout->addLayout(buttonLayout);
|
||||
QSpacerItem *hSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored);
|
||||
buttonLayout->addItem(hSpacer);
|
||||
QToolButton *settingsButton = new QToolButton;
|
||||
settingsButton->setText(tr("Configure..."));
|
||||
connect(settingsButton, SIGNAL(clicked()), this, SLOT(slotSettings()));
|
||||
buttonLayout->addWidget(settingsButton);
|
||||
|
||||
initParameters();
|
||||
}
|
||||
|
||||
@@ -114,16 +107,6 @@ void ClassNamePage::initParameters()
|
||||
m_newClassWidget->setLowerCaseFiles(lowerCaseFiles(core));
|
||||
}
|
||||
|
||||
void ClassNamePage::slotSettings()
|
||||
{
|
||||
const QString id = QLatin1String(CppTools::Constants::CPP_SETTINGS_ID);
|
||||
const QString cat = QLatin1String(CppTools::Constants::CPP_SETTINGS_CATEGORY);
|
||||
if (Core::ICore::instance()->showOptionsDialog(cat, id, this)) {
|
||||
initParameters();
|
||||
m_newClassWidget->triggerUpdateFileNames();
|
||||
}
|
||||
}
|
||||
|
||||
void ClassNamePage::slotValidChanged()
|
||||
{
|
||||
const bool validNow = m_newClassWidget->isValid();
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
|
||||
private slots:
|
||||
void slotValidChanged();
|
||||
void slotSettings();
|
||||
|
||||
private:
|
||||
void initParameters();
|
||||
|
||||
@@ -432,7 +432,8 @@ CPPEditor::CPPEditor(QWidget *parent)
|
||||
|
||||
CPPEditor::~CPPEditor()
|
||||
{
|
||||
Core::EditorManager::instance()->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
|
||||
if (Core::EditorManager *em = Core::EditorManager::instance())
|
||||
em->hideEditorInfoBar(QLatin1String("CppEditor.Rename"));
|
||||
|
||||
m_semanticHighlighter->abort();
|
||||
m_semanticHighlighter->wait();
|
||||
@@ -1337,7 +1338,7 @@ CPPEditor::Link CPPEditor::findLinkAt(const QTextCursor &cursor,
|
||||
} else {
|
||||
// Handle macro uses
|
||||
const Document::MacroUse *use = doc->findMacroUseAt(endOfToken - 1);
|
||||
if (use) {
|
||||
if (use && use->macro().fileName() != QLatin1String("<configuration>")) {
|
||||
const Macro ¯o = use->macro();
|
||||
link.fileName = macro.fileName();
|
||||
link.line = macro.line();
|
||||
|
||||
@@ -93,6 +93,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
case namespace_start:
|
||||
switch (kind) {
|
||||
case T_LBRACE: enter(namespace_open); break;
|
||||
case T_SEMICOLON:
|
||||
case T_RBRACE: leave(); break;
|
||||
} break;
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QProxyModel>
|
||||
#include <QtGui/QSortFilterProxyModel>
|
||||
#include <QtGui/QMessageBox>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
@@ -424,6 +425,20 @@ void AttachExternalDialog::pidChanged(const QString &pid)
|
||||
okButton()->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void AttachExternalDialog::accept()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
const qint64 pid = attachPID();
|
||||
if (pid && isWinProcessBeingDebugged(pid)) {
|
||||
QMessageBox::warning(this, tr("Process Already Under Debugger Control"),
|
||||
tr("The process %1 is already under the control of a debugger.\n"
|
||||
"Qt Creator cannot attach to it.").arg(pid));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
@@ -92,6 +92,8 @@ public:
|
||||
qint64 attachPID() const;
|
||||
QString executable() const;
|
||||
|
||||
virtual void accept();
|
||||
|
||||
private slots:
|
||||
void rebuildProcessList();
|
||||
void procSelected(const QModelIndex &index);
|
||||
|
||||
@@ -226,6 +226,7 @@ public:
|
||||
m_startParameters(sp),
|
||||
m_state(DebuggerNotReady),
|
||||
m_lastGoodState(DebuggerNotReady),
|
||||
m_targetState(DebuggerNotReady),
|
||||
m_breakHandler(engine),
|
||||
m_commandHandler(engine),
|
||||
m_modulesHandler(engine),
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtCore/QtPlugin>
|
||||
#include <QtCore/QScopedPointer>
|
||||
|
||||
#include <QtGui/QAbstractItemView>
|
||||
#include <QtGui/QAction>
|
||||
@@ -383,14 +384,13 @@ const char * const ADD_TO_WATCH2 = "Debugger.AddToWatch2";
|
||||
const char * const OPERATE_BY_INSTRUCTION = "Debugger.OperateByInstruction";
|
||||
const char * const FRAME_UP = "Debugger.FrameUp";
|
||||
const char * const FRAME_DOWN = "Debugger.FrameDown";
|
||||
const char * const DEBUG_KEY = "F5";
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
const char * const STOP_KEY = "Shift+F5";
|
||||
const char * const STOP_KEY = "Shift+Ctrl+Y";
|
||||
const char * const RESET_KEY = "Ctrl+Shift+F5";
|
||||
const char * const STEP_KEY = "F7";
|
||||
const char * const STEPOUT_KEY = "Shift+F7";
|
||||
const char * const NEXT_KEY = "F6";
|
||||
const char * const STEP_KEY = "Ctrl+Shift+I";
|
||||
const char * const STEPOUT_KEY = "Ctrl+Shift+T";
|
||||
const char * const NEXT_KEY = "Ctrl+Shift+O";
|
||||
const char * const REVERSE_KEY = "";
|
||||
const char * const RUN_TO_LINE_KEY = "Shift+F8";
|
||||
const char * const RUN_TO_FUNCTION_KEY = "Ctrl+F6";
|
||||
@@ -461,6 +461,7 @@ void addCdbOptionPages(QList<Core::IOptionsPage*> *opts);
|
||||
struct AttachRemoteParameters
|
||||
{
|
||||
AttachRemoteParameters() : attachPid(0), winCrashEvent(0) {}
|
||||
void clear();
|
||||
|
||||
quint64 attachPid;
|
||||
QString attachTarget; // core file name or server:port
|
||||
@@ -468,6 +469,11 @@ struct AttachRemoteParameters
|
||||
quint64 winCrashEvent;
|
||||
};
|
||||
|
||||
void AttachRemoteParameters::clear()
|
||||
{
|
||||
attachPid = winCrashEvent = 0;
|
||||
attachTarget.clear();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -791,6 +797,7 @@ static bool parseArguments(const QStringList &args,
|
||||
AttachRemoteParameters *attachRemoteParameters,
|
||||
unsigned *enabledEngines, QString *errorMessage)
|
||||
{
|
||||
attachRemoteParameters->clear();
|
||||
const QStringList::const_iterator cend = args.constEnd();
|
||||
for (QStringList::const_iterator it = args.constBegin(); it != cend; ++it)
|
||||
if (!parseArgument(it, cend, attachRemoteParameters, enabledEngines, errorMessage))
|
||||
@@ -919,9 +926,9 @@ public slots:
|
||||
void attachExternalApplication();
|
||||
void attachExternalApplication
|
||||
(qint64 pid, const QString &binary, const QString &crashParameter);
|
||||
bool attachCmdLine();
|
||||
void attachCore();
|
||||
void attachCore(const QString &core, const QString &exeFileName);
|
||||
void attachCmdLine();
|
||||
void attachRemote(const QString &spec);
|
||||
void attachRemoteTcf();
|
||||
|
||||
@@ -952,7 +959,6 @@ public slots:
|
||||
void updateState(DebuggerEngine *engine);
|
||||
void onCurrentProjectChanged(ProjectExplorer::Project *project);
|
||||
|
||||
void resetLocation();
|
||||
void gotoLocation(const QString &file, int line, bool setMarker);
|
||||
|
||||
void clearStatusMessage();
|
||||
@@ -963,6 +969,7 @@ public slots:
|
||||
|
||||
void executeDebuggerCommand();
|
||||
void scriptExpressionEntered(const QString &expression);
|
||||
void coreShutdown();
|
||||
|
||||
public:
|
||||
DebuggerState m_state;
|
||||
@@ -972,7 +979,7 @@ public:
|
||||
DebuggerRunControlFactory *m_debuggerRunControlFactory;
|
||||
|
||||
QString m_previousMode;
|
||||
TextEditor::BaseTextMark *m_locationMark;
|
||||
QScopedPointer<TextEditor::BaseTextMark> m_locationMark;
|
||||
Core::Context m_continuableContext;
|
||||
Core::Context m_interruptibleContext;
|
||||
Core::Context m_undisturbableContext;
|
||||
@@ -1037,9 +1044,11 @@ public:
|
||||
DebuggerPlugin *m_plugin;
|
||||
|
||||
SnapshotHandler *m_snapshotHandler;
|
||||
bool m_shuttingDown;
|
||||
};
|
||||
|
||||
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
|
||||
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) :
|
||||
m_shuttingDown(false)
|
||||
{
|
||||
m_plugin = plugin;
|
||||
|
||||
@@ -1072,7 +1081,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
|
||||
|
||||
m_sessionEngine = 0;
|
||||
m_debugMode = 0;
|
||||
m_locationMark = 0;
|
||||
|
||||
m_continuableContext = Core::Context(0);
|
||||
m_interruptibleContext = Core::Context(0);
|
||||
@@ -1100,6 +1108,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
// FIXME: Move part of this to extensionsInitialized()?
|
||||
ICore *core = ICore::instance();
|
||||
QTC_ASSERT(core, return false);
|
||||
connect(core, SIGNAL(coreAboutToClose()), this, SLOT(coreShutdown()));
|
||||
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
QTC_ASSERT(am, return false);
|
||||
@@ -1445,7 +1454,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
cmd = am->registerAction(m_actions.interruptAction,
|
||||
PE::DEBUG, m_interruptibleContext);
|
||||
cmd->setDefaultKeySequence(QKeySequence(Constants::STOP_KEY));
|
||||
cmd->setDefaultText(tr("Interrupt Debugger"));
|
||||
|
||||
cmd = am->registerAction(m_actions.undisturbableAction,
|
||||
@@ -1604,8 +1612,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
m_plugin->addAutoReleasedObject(op);
|
||||
m_plugin->addAutoReleasedObject(new DebuggingHelperOptionPage);
|
||||
|
||||
m_locationMark = 0;
|
||||
|
||||
//setSimpleDockWidgetArrangement(Lang_Cpp);
|
||||
|
||||
connect(ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)),
|
||||
@@ -1785,7 +1791,9 @@ void DebuggerPluginPrivate::startExternalApplication()
|
||||
&& (sp.processArgs.front() == _("@tcf@") || sp.processArgs.front() == _("@sym@")))
|
||||
sp.toolChainType = ToolChain::RVCT_ARMV5;
|
||||
|
||||
startDebugger(m_debuggerRunControlFactory->create(sp));
|
||||
|
||||
if (RunControl *rc = m_debuggerRunControlFactory->create(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::notifyCurrentEngine(int role, const QVariant &value)
|
||||
@@ -1815,8 +1823,8 @@ void DebuggerPluginPrivate::attachExternalApplication
|
||||
sp.executable = binary;
|
||||
sp.crashParameter = crashParameter;
|
||||
sp.startMode = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal;
|
||||
DebuggerRunControl *rc = createDebugger(sp);
|
||||
startDebugger(rc);
|
||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachCore()
|
||||
@@ -1838,8 +1846,8 @@ void DebuggerPluginPrivate::attachCore(const QString &core, const QString &exe)
|
||||
sp.coreFile = core;
|
||||
sp.displayName = tr("Core file \"%1\"").arg(core);
|
||||
sp.startMode = AttachCore;
|
||||
DebuggerRunControl *rc = createDebugger(sp);
|
||||
startDebugger(rc);
|
||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachRemote(const QString &spec)
|
||||
@@ -1851,8 +1859,8 @@ void DebuggerPluginPrivate::attachRemote(const QString &spec)
|
||||
sp.remoteArchitecture = spec.section('@', 2, 2);
|
||||
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
|
||||
sp.startMode = AttachToRemote;
|
||||
DebuggerRunControl *rc = createDebugger(sp);
|
||||
startDebugger(rc);
|
||||
if (DebuggerRunControl *rc = createDebugger(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::startRemoteApplication()
|
||||
@@ -1897,7 +1905,8 @@ void DebuggerPluginPrivate::startRemoteApplication()
|
||||
sp.useServerStartScript = dlg.useServerStartScript();
|
||||
sp.serverStartScript = dlg.serverStartScript();
|
||||
sp.sysRoot = dlg.sysRoot();
|
||||
startDebugger(createDebugger(sp));
|
||||
if (RunControl *rc = createDebugger(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::enableReverseDebuggingTriggered(const QVariant &value)
|
||||
@@ -1935,10 +1944,11 @@ void DebuggerPluginPrivate::attachRemoteTcf()
|
||||
sp.startMode = AttachTcf;
|
||||
if (dlg.useServerStartScript())
|
||||
sp.serverStartScript = dlg.serverStartScript();
|
||||
startDebugger(createDebugger(sp));
|
||||
if (RunControl *rc = createDebugger(sp))
|
||||
startDebugger(rc);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::attachCmdLine()
|
||||
bool DebuggerPluginPrivate::attachCmdLine()
|
||||
{
|
||||
if (m_attachRemoteParameters.attachPid) {
|
||||
showStatusMessage(tr("Attaching to PID %1.")
|
||||
@@ -1947,7 +1957,7 @@ void DebuggerPluginPrivate::attachCmdLine()
|
||||
? QString::number(m_attachRemoteParameters.winCrashEvent) : QString();
|
||||
attachExternalApplication(m_attachRemoteParameters.attachPid,
|
||||
QString(), crashParameter);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
const QString target = m_attachRemoteParameters.attachTarget;
|
||||
if (!target.isEmpty()) {
|
||||
@@ -1958,7 +1968,9 @@ void DebuggerPluginPrivate::attachCmdLine()
|
||||
showStatusMessage(tr("Attaching to core %1.").arg(target));
|
||||
attachCore(target, QString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::editorOpened(Core::IEditor *editor)
|
||||
@@ -2122,7 +2134,7 @@ void DebuggerPluginPrivate::fontSettingsChanged
|
||||
|
||||
void DebuggerPluginPrivate::cleanupViews()
|
||||
{
|
||||
resetLocation();
|
||||
m_plugin->resetLocation();
|
||||
m_actions.reverseDirectionAction->setChecked(false);
|
||||
m_actions.reverseDirectionAction->setEnabled(false);
|
||||
hideDebuggerToolTip();
|
||||
@@ -2291,7 +2303,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_actions.continueAction->setEnabled(false);
|
||||
m_actions.stopAction->setEnabled(false);
|
||||
am->command(Constants::STOP)->setKeySequence(QKeySequence());
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY));
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(ProjectExplorer::Constants::DEBUG_KEY));
|
||||
core->updateAdditionalContexts(m_anyContext, Context());
|
||||
} else if (m_state == InferiorStopOk) {
|
||||
// F5 continues, Shift-F5 kills. It is "continuable".
|
||||
@@ -2299,7 +2311,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_actions.continueAction->setEnabled(true);
|
||||
m_actions.stopAction->setEnabled(true);
|
||||
am->command(Constants::STOP)->setKeySequence(QKeySequence(STOP_KEY));
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY));
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(ProjectExplorer::Constants::DEBUG_KEY));
|
||||
core->updateAdditionalContexts(m_anyContext, m_continuableContext);
|
||||
} else if (m_state == InferiorRunOk) {
|
||||
// Shift-F5 interrupts. It is also "interruptible".
|
||||
@@ -2315,7 +2327,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_actions.continueAction->setEnabled(false);
|
||||
m_actions.stopAction->setEnabled(false);
|
||||
am->command(Constants::STOP)->setKeySequence(QKeySequence());
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(DEBUG_KEY));
|
||||
am->command(PE::DEBUG)->setKeySequence(QKeySequence(ProjectExplorer::Constants::DEBUG_KEY));
|
||||
//core->updateAdditionalContexts(m_anyContext, m_finishedContext);
|
||||
m_codeModelSnapshot = CPlusPlus::Snapshot();
|
||||
core->updateAdditionalContexts(m_anyContext, Context());
|
||||
@@ -2400,14 +2412,12 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_scriptConsoleWindow->setEnabled(stopped);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::resetLocation()
|
||||
{
|
||||
delete m_locationMark;
|
||||
m_locationMark = 0;
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::gotoLocation(const QString &file, int line, bool setMarker)
|
||||
{
|
||||
// CDB might hit on breakpoints while shutting down.
|
||||
if (m_shuttingDown)
|
||||
return;
|
||||
|
||||
bool newEditor = false;
|
||||
ITextEditor *editor =
|
||||
BaseTextEditor::openEditorAt(file, line, 0, QString(),
|
||||
@@ -2416,10 +2426,8 @@ void DebuggerPluginPrivate::gotoLocation(const QString &file, int line, bool set
|
||||
return;
|
||||
if (newEditor)
|
||||
editor->setProperty("OpenedByDebugger", true);
|
||||
if (setMarker) {
|
||||
resetLocation();
|
||||
m_locationMark = new LocationMark(file, line);
|
||||
}
|
||||
if (setMarker)
|
||||
m_locationMark.reset(new LocationMark(file, line));
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::onModeChanged(IMode *mode)
|
||||
@@ -2543,6 +2551,10 @@ void DebuggerPluginPrivate::openMemoryEditor()
|
||||
QModelIndex(), dialog.address(), RequestShowMemoryRole);
|
||||
}
|
||||
|
||||
void DebuggerPluginPrivate::coreShutdown()
|
||||
{
|
||||
m_shuttingDown = true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -2576,9 +2588,6 @@ DebuggerPlugin::~DebuggerPlugin()
|
||||
delete d->m_debugMode;
|
||||
d->m_debugMode = 0;
|
||||
|
||||
delete d->m_locationMark;
|
||||
d->m_locationMark = 0;
|
||||
|
||||
removeObject(d->m_uiSwitcher);
|
||||
delete d->m_uiSwitcher;
|
||||
d->m_uiSwitcher = 0;
|
||||
@@ -2625,34 +2634,19 @@ QVariant DebuggerPlugin::configValue(const QString &name) const
|
||||
|
||||
void DebuggerPlugin::resetLocation()
|
||||
{
|
||||
d->resetLocation();
|
||||
//qDebug() << "RESET_LOCATION: current:" << currentTextEditor();
|
||||
//qDebug() << "RESET_LOCATION: locations:" << m_locationMark;
|
||||
//qDebug() << "RESET_LOCATION: stored:" << m_locationMark->editor();
|
||||
delete d->m_locationMark;
|
||||
d->m_locationMark = 0;
|
||||
d->m_locationMark.reset();
|
||||
}
|
||||
|
||||
void DebuggerPlugin::gotoLocation(const QString &file, int line, bool setMarker)
|
||||
{
|
||||
bool newEditor = false;
|
||||
ITextEditor *editor =
|
||||
BaseTextEditor::openEditorAt(file, line, 0, QString(),
|
||||
EditorManager::IgnoreNavigationHistory,
|
||||
&newEditor);
|
||||
if (!editor)
|
||||
return;
|
||||
if (newEditor)
|
||||
editor->setProperty("OpenedByDebugger", true);
|
||||
if (setMarker) {
|
||||
resetLocation();
|
||||
d->m_locationMark = new LocationMark(file, line);
|
||||
}
|
||||
d->gotoLocation(file, line, setMarker);
|
||||
}
|
||||
|
||||
void DebuggerPlugin::openTextEditor(const QString &titlePattern0,
|
||||
const QString &contents)
|
||||
{
|
||||
if (d->m_shuttingDown)
|
||||
return;
|
||||
QString titlePattern = titlePattern0;
|
||||
EditorManager *editorManager = EditorManager::instance();
|
||||
QTC_ASSERT(editorManager, return);
|
||||
@@ -2865,6 +2859,27 @@ bool DebuggerPlugin::hasSnapsnots() const
|
||||
return d->m_snapshotHandler->size();
|
||||
}
|
||||
|
||||
void DebuggerPlugin::remoteCommand(const QStringList &options, const QStringList &)
|
||||
{
|
||||
unsigned enabledEngines = 0;
|
||||
QString errorMessage;
|
||||
bool success = false;
|
||||
do {
|
||||
if (!parseArguments(options, &d->m_attachRemoteParameters, &enabledEngines, &errorMessage))
|
||||
break;
|
||||
|
||||
if (!d->attachCmdLine()) {
|
||||
errorMessage = QString::fromLatin1("Incomplete remote attach command received: %1").
|
||||
arg(options.join(QString(QLatin1Char(' '))));
|
||||
break;
|
||||
}
|
||||
success = true;
|
||||
} while (false);
|
||||
|
||||
if (!success)
|
||||
qWarning("%s", qPrintable(errorMessage));
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Testing
|
||||
|
||||
@@ -80,6 +80,7 @@ public:
|
||||
QVariant configValue(const QString &name) const;
|
||||
void setConfigValue(const QString &name, const QVariant &value);
|
||||
void updateState(DebuggerEngine *engine);
|
||||
virtual void remoteCommand(const QStringList &options, const QStringList &arguments);
|
||||
|
||||
QIcon locationMarkIcon() const;
|
||||
void activateDebugMode();
|
||||
|
||||
@@ -276,7 +276,8 @@ unsigned DebuggerRunnerPrivate::enabledEngines() const
|
||||
|
||||
DebuggerRunnerPrivate::DebuggerRunnerPrivate(RunConfiguration *runConfiguration,
|
||||
unsigned enabledEngines) :
|
||||
m_myRunConfiguration(runConfiguration)
|
||||
m_engine(0)
|
||||
, m_myRunConfiguration(runConfiguration)
|
||||
, m_running(false)
|
||||
, m_cmdLineEnabledEngines(enabledEngines)
|
||||
{
|
||||
@@ -401,6 +402,10 @@ DebuggerEngineType DebuggerRunControl::engineForMode(unsigned enabledEngineTypes
|
||||
// Preferably Windows debugger for attaching locally.
|
||||
if (startMode != AttachToRemote && (enabledEngineTypes & CdbEngineType))
|
||||
return CdbEngineType;
|
||||
if (startMode == AttachCrashedExternal) {
|
||||
d->m_errorMessage = tr("There is no debugging engine available for post-mortem debugging.");
|
||||
return NoEngineType;
|
||||
}
|
||||
return GdbEngineType;
|
||||
#else
|
||||
Q_UNUSED(startMode)
|
||||
@@ -439,10 +444,11 @@ void DebuggerRunControl::createEngine(const DebuggerStartParameters &startParams
|
||||
&& !sp.executable.isEmpty())
|
||||
engineType = engineForExecutable(enabledEngineTypes, sp.executable);
|
||||
|
||||
if (!engineType)
|
||||
if (engineType == NoEngineType)
|
||||
engineType = engineForMode(enabledEngineTypes, sp.startMode);
|
||||
|
||||
if (engineType != QmlEngineType && (activeLangs & QmlLanguage)) {
|
||||
if ((engineType != QmlEngineType && engineType != NoEngineType)
|
||||
&& (activeLangs & QmlLanguage)) {
|
||||
if (activeLangs & CppLanguage) {
|
||||
sp.cppEngineType = engineType;
|
||||
engineType = QmlCppEngineType;
|
||||
|
||||
@@ -449,7 +449,7 @@ void QmlCppEngine::finishDebugger()
|
||||
|
||||
void QmlCppEngine::setupSlaveEngineOnTimer()
|
||||
{
|
||||
QTimer::singleShot(ConnectionWaitTimeMs, this, SLOT(setupSlaveEngine()));
|
||||
QTimer::singleShot(0, this, SLOT(setupSlaveEngine()));
|
||||
}
|
||||
|
||||
void QmlCppEngine::setupSlaveEngine()
|
||||
|
||||
@@ -260,9 +260,13 @@ void QmlEngine::shutdownInferiorAsSlave()
|
||||
if (state() == InferiorRunOk) {
|
||||
setState(InferiorStopRequested);
|
||||
setState(InferiorStopOk);
|
||||
setState(InferiorShutdownRequested);
|
||||
setState(InferiorShutdownOk);
|
||||
} else {
|
||||
// force
|
||||
setState(InferiorShutdownRequested, true);
|
||||
setState(InferiorShutdownOk);
|
||||
}
|
||||
setState(InferiorShutdownRequested);
|
||||
setState(InferiorShutdownOk);
|
||||
}
|
||||
|
||||
void QmlEngine::shutdownEngineAsSlave()
|
||||
@@ -683,6 +687,8 @@ void QmlEngine::messageReceived(const QByteArray &message)
|
||||
if (processedFilename == file
|
||||
&& data->lineNumber == line) {
|
||||
data->pending = false;
|
||||
data->bpFileName = file;
|
||||
data->bpLineNumber = line;
|
||||
data->updateMarker();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,5 +242,22 @@ QString winNormalizeFileName(const QString &f)
|
||||
return rc.isEmpty() ? f : rc;
|
||||
}
|
||||
|
||||
bool isWinProcessBeingDebugged(unsigned long pid)
|
||||
{
|
||||
// Exclude VS 2005
|
||||
#if defined(_MSC_VER) && _MSC_VER < 1400
|
||||
Q_UNUSED(pid);
|
||||
return false;
|
||||
#else
|
||||
HANDLE processHandle = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
|
||||
if (processHandle == NULL)
|
||||
return false;
|
||||
BOOL debugged = FALSE;
|
||||
CheckRemoteDebuggerPresent(processHandle, &debugged);
|
||||
CloseHandle(processHandle);
|
||||
return debugged != FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
@@ -57,6 +57,8 @@ unsigned long winGetCurrentProcessId();
|
||||
|
||||
QString winNormalizeFileName(const QString &f);
|
||||
|
||||
bool isWinProcessBeingDebugged(unsigned long pid);
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ FormClassWizardPage::FormClassWizardPage(QWidget * parent) :
|
||||
m_ui->newClassWidget->setClassTypeComboVisible(false);
|
||||
|
||||
connect(m_ui->newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
|
||||
connect(m_ui->settingsToolButton, SIGNAL(clicked()), this, SLOT(slotSettings()));
|
||||
|
||||
initFileGenerationSettings();
|
||||
}
|
||||
@@ -90,17 +89,6 @@ void FormClassWizardPage::initFileGenerationSettings()
|
||||
m_ui->newClassWidget->setLowerCaseFiles(lowercaseHeaderFiles());
|
||||
}
|
||||
|
||||
// Pop up settings dialog for generation settings
|
||||
void FormClassWizardPage::slotSettings()
|
||||
{
|
||||
const QString id = QLatin1String(CppTools::Constants::CPP_SETTINGS_ID);
|
||||
const QString cat = QLatin1String(CppTools::Constants::CPP_SETTINGS_CATEGORY);
|
||||
if (Core::ICore::instance()->showOptionsDialog(cat, id, this)) {
|
||||
initFileGenerationSettings();
|
||||
m_ui->newClassWidget->triggerUpdateFileNames();
|
||||
}
|
||||
}
|
||||
|
||||
void FormClassWizardPage::setClassName(const QString &suggestedClassName)
|
||||
{
|
||||
// Is it valid, now?
|
||||
|
||||
@@ -68,7 +68,6 @@ public:
|
||||
public slots:
|
||||
void setClassName(const QString &suggestedClassName);
|
||||
void setPath(const QString &);
|
||||
void slotSettings();
|
||||
|
||||
private slots:
|
||||
void slotValidChanged();
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>Designer::Internal::FormClassWizardPage</class>
|
||||
<widget class="QWizardPage" name="Designer::Internal::FormClassWizardPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>542</width>
|
||||
<height>267</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Choose a Class Name</string>
|
||||
</property>
|
||||
@@ -21,35 +13,11 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="Utils::NewClassWidget" name="newClassWidget" native="true"/>
|
||||
<widget class="Utils::NewClassWidget" name="newClassWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="settingsToolButton">
|
||||
<property name="text">
|
||||
<string>Configure...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
||||
@@ -422,8 +422,8 @@ bool FormClassWizardParametersPrivate::generateCpp(const FormClassWizardGenerati
|
||||
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "(QWidget *parent) :\n"
|
||||
<< namespaceIndent << indent << formBaseClass << "(parent)";
|
||||
if (embedding == FormClassWizardGenerationParameters::PointerAggregatedUiClass)
|
||||
sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")\n";
|
||||
sourceStr << namespaceIndent << "{\n" << namespaceIndent << indent;
|
||||
sourceStr << ",\n" << namespaceIndent << indent << uiMemberC << "(new " << uiClassName << ")";
|
||||
sourceStr << '\n' << namespaceIndent << "{\n" << namespaceIndent << indent;
|
||||
writeUiMemberAccess(generationParameters, sourceStr);
|
||||
sourceStr << "setupUi(this);\n" << namespaceIndent << "}\n";
|
||||
// Deleting destructor for ptr
|
||||
|
||||
@@ -491,6 +491,7 @@ public:
|
||||
void aboutToShutdown();
|
||||
|
||||
private slots:
|
||||
void onCoreAboutToClose();
|
||||
void editorOpened(Core::IEditor *);
|
||||
void editorAboutToClose(Core::IEditor *);
|
||||
|
||||
@@ -583,6 +584,13 @@ FakeVimPluginPrivate::~FakeVimPluginPrivate()
|
||||
m_fakeVimExCommandsPage = 0;
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::onCoreAboutToClose()
|
||||
{
|
||||
// don't attach to editors any more
|
||||
disconnect(editorManager(), SIGNAL(editorOpened(Core::IEditor*)),
|
||||
this, SLOT(editorOpened(Core::IEditor*)));
|
||||
}
|
||||
|
||||
void FakeVimPluginPrivate::aboutToShutdown()
|
||||
{
|
||||
theFakeVimSettings()->writeSettings(ICore::instance()->settings());
|
||||
@@ -615,6 +623,8 @@ bool FakeVimPluginPrivate::initialize()
|
||||
actionManager()->actionContainer(Core::Constants::M_EDIT_ADVANCED);
|
||||
advancedMenu->addAction(cmd, Core::Constants::G_EDIT_EDITOR);
|
||||
|
||||
connect(m_core, SIGNAL(coreAboutToClose()), this, SLOT(onCoreAboutToClose()));
|
||||
|
||||
// EditorManager
|
||||
connect(editorManager(), SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
this, SLOT(editorAboutToClose(Core::IEditor*)));
|
||||
|
||||
@@ -355,7 +355,8 @@ void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
|
||||
|
||||
QString AbstractProcessStep::expandedCommand() const
|
||||
{
|
||||
QString command = m_environment.searchInPath(m_command, QStringList() << workingDirectory());
|
||||
QString command = m_environment.searchInPath(
|
||||
m_command, QStringList() << m_environment.expandVariables(m_workingDirectory));
|
||||
if (command.isEmpty())
|
||||
command = m_command;
|
||||
return command;
|
||||
|
||||
@@ -690,7 +690,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
cmd->setAttribute(Core::Command::CA_UpdateText);
|
||||
cmd->setAttribute(Core::Command::CA_UpdateIcon);
|
||||
cmd->setDefaultText(tr("Start Debugging"));
|
||||
cmd->setDefaultKeySequence(QKeySequence(tr("F5")));
|
||||
cmd->setDefaultKeySequence(QKeySequence(Constants::DEBUG_KEY));
|
||||
mstartdebugging->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
|
||||
modeManager->addAction(cmd, Constants::P_ACTION_DEBUG);
|
||||
|
||||
|
||||
@@ -226,6 +226,12 @@ const char * const DEFAULT_DEPLOYCONFIGURATION_ID = "ProjectExplorer.DefaultDepl
|
||||
// Run Configuration defaults:
|
||||
const int QML_DEFAULT_DEBUG_SERVER_PORT = 3768;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
const char * const DEBUG_KEY = "Ctrl+Y";
|
||||
#else
|
||||
const char * const DEBUG_KEY = "F5";
|
||||
#endif
|
||||
|
||||
} // namespace Constants
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
|
||||
@@ -200,7 +200,6 @@ static QList<ProjectEntry> findDeployProject(const QList<ProjectEntry> &projects
|
||||
// path. Either a direct match on the directory or the directory with
|
||||
// the longest matching path (list containing"/project/subproject1" matching
|
||||
// common path "/project/subproject1/newuserpath").
|
||||
// This relies on 'pro' occurring before 'pri' in the list.
|
||||
static int findMatchingProject(const QList<ProjectEntry> &projects,
|
||||
const QString &commonPath)
|
||||
{
|
||||
@@ -209,14 +208,20 @@ static int findMatchingProject(const QList<ProjectEntry> &projects,
|
||||
|
||||
int bestMatch = -1;
|
||||
int bestMatchLength = 0;
|
||||
bool bestMatchIsProFile = false;
|
||||
const int count = projects.size();
|
||||
for (int p = 0; p < count; p++) {
|
||||
// Direct match or better match? (note that the wizards' files are native).
|
||||
const QString &projectDirectory = projects.at(p).directory;
|
||||
if (projectDirectory == commonPath)
|
||||
return p;
|
||||
if (projectDirectory.size() > bestMatchLength
|
||||
&& commonPath.startsWith(projectDirectory)) {
|
||||
const ProjectEntry &entry = projects.at(p);
|
||||
const QString &projectDirectory = entry.directory;
|
||||
const int projectDirectorySize = projectDirectory.size();
|
||||
if (projectDirectorySize == bestMatchLength && bestMatchIsProFile)
|
||||
continue; // prefer first pro file over all other files with same bestMatchLength
|
||||
if (projectDirectorySize == bestMatchLength && entry.type == ProjectEntry::PriFile)
|
||||
continue; // we already have a match with same bestMatchLength that is at least a pri file
|
||||
if (projectDirectorySize >= bestMatchLength
|
||||
&& commonPath.startsWith(projectDirectory)) {
|
||||
bestMatchIsProFile = (entry.type == ProjectEntry::ProFile);
|
||||
bestMatchLength = projectDirectory.size();
|
||||
bestMatch = p;
|
||||
}
|
||||
|
||||
@@ -277,6 +277,12 @@ void RewriterView::importAdded(const Import &import)
|
||||
if (textToModelMerger()->isActive())
|
||||
return;
|
||||
|
||||
if (import.url() == "Qt")
|
||||
foreach (const Import &import, model()->imports()) {
|
||||
if (import.url() == "QtQuick")
|
||||
return; //QtQuick magic we do not have to add an import for Qt
|
||||
}
|
||||
|
||||
modelToTextMerger()->addImport(import);
|
||||
|
||||
if (!isModificationGroupActive())
|
||||
|
||||
@@ -77,7 +77,27 @@ static inline QString deEscape(const QString &value)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int fixUpMajorVersionForQtQuick(const QString &value, int i)
|
||||
{
|
||||
if (i == 1 && value == "QtQuick")
|
||||
return 4;
|
||||
else return i;
|
||||
}
|
||||
|
||||
static inline int fixUpMinorVersionForQtQuick(const QString &value, int i)
|
||||
{
|
||||
if (i == 0 && value == "QtQuick")
|
||||
return 7;
|
||||
else return i;
|
||||
}
|
||||
|
||||
static inline QString fixUpPackeNameForQtQuick(const QString &value)
|
||||
{
|
||||
if (value == "QtQuick")
|
||||
return "Qt";
|
||||
return value;
|
||||
}
|
||||
|
||||
static inline bool isSignalPropertyName(const QString &signalName)
|
||||
{
|
||||
@@ -232,9 +252,11 @@ public:
|
||||
|
||||
const Interpreter::QmlObjectValue * qmlValue = dynamic_cast<const Interpreter::QmlObjectValue *>(value);
|
||||
if (qmlValue) {
|
||||
typeName = qmlValue->packageName() + QLatin1String("/") + qmlValue->className();
|
||||
majorVersion = qmlValue->version().major();
|
||||
minorVersion = qmlValue->version().minor();
|
||||
typeName = fixUpPackeNameForQtQuick(qmlValue->packageName()) + QLatin1String("/") + qmlValue->className();
|
||||
|
||||
//### todo this is just a hack to support QtQuick 1.0
|
||||
majorVersion = fixUpMajorVersionForQtQuick(qmlValue->packageName(), qmlValue->version().major());
|
||||
minorVersion = fixUpMinorVersionForQtQuick(qmlValue->packageName(), qmlValue->version().minor());
|
||||
} else {
|
||||
for (UiQualifiedId *iter = astTypeNode; iter; iter = iter->next)
|
||||
if (!iter->next && iter->name)
|
||||
@@ -590,17 +612,6 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
|
||||
|
||||
setupImports(doc, differenceHandler);
|
||||
|
||||
foreach (const Import &import, m_rewriterView->model()->imports()) {
|
||||
if (import.url() == "QtQuick") {
|
||||
QList<RewriterView::Error> errors;
|
||||
RewriterView::Error error(QCoreApplication::translate("QmlDesigner::TextToModelMerger",
|
||||
"Unsupported import:\nimport QtQuick 1.0 use import Qt 4.7 instead"));
|
||||
errors.append(error);
|
||||
m_rewriterView->setErrors(errors);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
UiObjectMember *astRootNode = 0;
|
||||
if (UiProgram *program = doc->qmlProgram())
|
||||
if (program->members)
|
||||
|
||||
@@ -84,7 +84,6 @@ enum {
|
||||
UPDATE_DOCUMENT_DEFAULT_INTERVAL = 100,
|
||||
UPDATE_USES_DEFAULT_INTERVAL = 150,
|
||||
UPDATE_OUTLINE_INTERVAL = 500, // msecs after new semantic info has been arrived / cursor has moved
|
||||
TOOLTIP_TIMER_INTERVAL = 1000 // delay after we show the Quick ToolBar after a tooltip
|
||||
};
|
||||
|
||||
using namespace QmlJS;
|
||||
@@ -680,7 +679,6 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
m_modelManager(0),
|
||||
m_contextPane(0),
|
||||
m_updateSelectedElements(false),
|
||||
m_toolTipPosition(0),
|
||||
m_findReferences(new FindReferences(this))
|
||||
{
|
||||
qRegisterMetaType<QmlJSEditor::Internal::SemanticInfo>("QmlJSEditor::Internal::SemanticInfo");
|
||||
@@ -728,11 +726,6 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
m_cursorPositionTimer->setSingleShot(true);
|
||||
connect(m_cursorPositionTimer, SIGNAL(timeout()), this, SLOT(updateCursorPositionNow()));
|
||||
|
||||
m_toolTipTimer = new QTimer(this);
|
||||
m_toolTipTimer->setInterval(TOOLTIP_TIMER_INTERVAL);
|
||||
m_toolTipTimer->setSingleShot(true);
|
||||
connect(m_toolTipTimer, SIGNAL(timeout()), this, SLOT(updateToolTipNow()));
|
||||
|
||||
baseTextDocument()->setSyntaxHighlighter(new Highlighter(document()));
|
||||
|
||||
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
|
||||
@@ -760,9 +753,6 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
|
||||
connect(this, SIGNAL(refactorMarkerClicked(TextEditor::Internal::RefactorMarker)),
|
||||
SLOT(onRefactorMarkerClicked(TextEditor::Internal::RefactorMarker)));
|
||||
|
||||
connect(editableInterface(), SIGNAL(tooltipRequested(TextEditor::ITextEditor*, QPoint, int)),
|
||||
SLOT(onTooltipRequested(TextEditor::ITextEditor*, QPoint, int)));
|
||||
|
||||
setRequestMarkEnabled(true);
|
||||
}
|
||||
|
||||
@@ -992,8 +982,8 @@ void QmlJSTextEditor::updateCursorPositionNow()
|
||||
Node *oldNode = m_semanticInfo.declaringMemberNoProperties(m_oldCursorPosition);
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
||||
if (oldNode != newNode && m_oldCursorPosition != -1)
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.lookupContext(), newNode, false);
|
||||
if (m_contextPane->isAvailable(editableInterface(), m_semanticInfo.lookupContext(), newNode) &&
|
||||
m_contextPane->apply(editableInterface(), semanticInfo().document, LookupContext::Ptr(),newNode, false);
|
||||
if (m_contextPane->isAvailable(editableInterface(), semanticInfo().document, newNode) &&
|
||||
!m_contextPane->widget()->isVisible()) {
|
||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
||||
if (UiObjectMember *m = newNode->uiObjectMemberCast()) {
|
||||
@@ -1463,7 +1453,7 @@ void QmlJSTextEditor::showContextPane()
|
||||
{
|
||||
if (m_contextPane && m_semanticInfo.isValid()) {
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.lookupContext(), newNode, false, true);
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.document, m_semanticInfo.lookupContext(), newNode, false, true);
|
||||
m_oldCursorPosition = position();
|
||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
||||
setRefactorMarkers(markers);
|
||||
@@ -1476,40 +1466,6 @@ void QmlJSTextEditor::performQuickFix(int index)
|
||||
op->perform();
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::onTooltipRequested(TextEditor::ITextEditor* /* editor */, QPoint /* point */, int position)
|
||||
{
|
||||
m_toolTipPosition = position;
|
||||
if (m_contextPane) {
|
||||
m_toolTipTimer->start();
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::updateToolTipNow()
|
||||
{
|
||||
if (!TextEditor::ToolTip::instance()->isVisible())
|
||||
return;
|
||||
|
||||
if (m_contextPane && m_semanticInfo.isValid()) {
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(m_toolTipPosition);
|
||||
if (m_contextPane->isAvailable(editableInterface(), m_semanticInfo.lookupContext(), newNode)) {
|
||||
if (UiQualifiedId *q = qualifiedTypeNameId(newNode)) {
|
||||
const int start = q->identifierToken.begin();
|
||||
for (; q; q = q->next) {
|
||||
if (! q->next) {
|
||||
const int end = q->identifierToken.end();
|
||||
if (m_toolTipPosition >= start && m_toolTipPosition <= end) {
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.lookupContext(), newNode, false, true);
|
||||
m_oldCursorPosition = m_toolTipPosition;
|
||||
QList<TextEditor::Internal::RefactorMarker> markers;
|
||||
setRefactorMarkers(markers);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QmlJSTextEditor::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
QMenu *menu = new QMenu();
|
||||
@@ -1592,7 +1548,7 @@ void QmlJSTextEditor::wheelEvent(QWheelEvent *event)
|
||||
LookupContext::Ptr lookupContext;
|
||||
if (m_semanticInfo.isValid())
|
||||
lookupContext = m_semanticInfo.lookupContext();
|
||||
m_contextPane->apply(editableInterface(), lookupContext, m_semanticInfo.declaringMemberNoProperties(m_oldCursorPosition), false, true);
|
||||
m_contextPane->apply(editableInterface(), semanticInfo().document, QmlJS::LookupContext::Ptr(), m_semanticInfo.declaringMemberNoProperties(m_oldCursorPosition), false, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1842,7 +1798,7 @@ void QmlJSTextEditor::updateSemanticInfo(const SemanticInfo &semanticInfo)
|
||||
if (m_contextPane) {
|
||||
Node *newNode = m_semanticInfo.declaringMemberNoProperties(position());
|
||||
if (newNode) {
|
||||
m_contextPane->apply(editableInterface(), m_semanticInfo.lookupContext(), newNode, true);
|
||||
m_contextPane->apply(editableInterface(), semanticInfo.document, LookupContext::Ptr(), newNode, true);
|
||||
m_cursorPositionTimer->start(); //update text marker
|
||||
}
|
||||
}
|
||||
@@ -1895,10 +1851,7 @@ bool QmlJSTextEditor::hideContextPane()
|
||||
{
|
||||
bool b = (m_contextPane) && m_contextPane->widget()->isVisible();
|
||||
if (b) {
|
||||
LookupContext::Ptr lookupContext;
|
||||
if (m_semanticInfo.isValid())
|
||||
lookupContext = m_semanticInfo.lookupContext();
|
||||
m_contextPane->apply(editableInterface(), lookupContext, 0, false);
|
||||
m_contextPane->apply(editableInterface(), semanticInfo().document, LookupContext::Ptr(), 0, false);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
@@ -2006,6 +1959,7 @@ SemanticInfo SemanticHighlighter::semanticInfo(const Source &source)
|
||||
doc = snapshot.documentFromSource(source.code, source.fileName);
|
||||
doc->setEditorRevision(source.revision);
|
||||
doc->parse();
|
||||
snapshot.insert(doc);
|
||||
}
|
||||
|
||||
SemanticInfo semanticInfo;
|
||||
|
||||
@@ -281,8 +281,6 @@ private slots:
|
||||
void onRefactorMarkerClicked(const TextEditor::Internal::RefactorMarker &marker);
|
||||
|
||||
void performQuickFix(int index);
|
||||
void onTooltipRequested(TextEditor::ITextEditor* editor, QPoint point, int position);
|
||||
void updateToolTipNow();
|
||||
|
||||
protected:
|
||||
void contextMenuEvent(QContextMenuEvent *e);
|
||||
@@ -320,7 +318,6 @@ private:
|
||||
QTimer *m_semanticRehighlightTimer;
|
||||
QTimer *m_updateOutlineTimer;
|
||||
QTimer *m_updateOutlineIndexTimer;
|
||||
QTimer *m_toolTipTimer;
|
||||
QTimer *m_cursorPositionTimer;
|
||||
QComboBox *m_outlineCombo;
|
||||
QmlOutlineModel *m_outlineModel;
|
||||
@@ -338,7 +335,6 @@ private:
|
||||
QmlJS::IContextPane *m_contextPane;
|
||||
int m_oldCursorPosition;
|
||||
bool m_updateSelectedElements;
|
||||
int m_toolTipPosition;
|
||||
|
||||
FindReferences *m_findReferences;
|
||||
};
|
||||
|
||||
@@ -367,11 +367,6 @@ void QmlOutlineModel::update(const SemanticInfo &semanticInfo)
|
||||
m_treePos.append(0);
|
||||
m_currentItem = invisibleRootItem();
|
||||
|
||||
// Set up lookup context once to do the element type lookup
|
||||
//
|
||||
// We're simplifying here by using the root context everywhere; should be
|
||||
// ok since there is AFAIK no way to introduce new type names in a sub-context.
|
||||
m_context = semanticInfo.lookupContext();
|
||||
m_typeToIcon.clear();
|
||||
m_itemToNode.clear();
|
||||
m_itemToIdNode.clear();
|
||||
@@ -381,8 +376,6 @@ void QmlOutlineModel::update(const SemanticInfo &semanticInfo)
|
||||
QmlOutlineModelSync syncModel(this);
|
||||
syncModel(m_semanticInfo.document);
|
||||
|
||||
m_context.clear();
|
||||
|
||||
emit updated();
|
||||
}
|
||||
|
||||
@@ -815,26 +808,18 @@ AST::SourceLocation QmlOutlineModel::getLocation(AST::ExpressionNode *exprNode)
|
||||
}
|
||||
|
||||
QIcon QmlOutlineModel::getIcon(AST::UiQualifiedId *qualifiedId) {
|
||||
const Interpreter::Value *value = m_context->evaluate(qualifiedId);
|
||||
QIcon icon;
|
||||
if (qualifiedId) {
|
||||
QString name = asString(qualifiedId);
|
||||
if (name.contains(QLatin1Char('.')))
|
||||
name = name.split(QLatin1Char('.')).last();
|
||||
|
||||
if (const Interpreter::ObjectValue *objectValue = value->asObjectValue()) {
|
||||
do {
|
||||
QString module;
|
||||
QString typeName;
|
||||
if (const Interpreter::QmlObjectValue *qmlObjectValue =
|
||||
dynamic_cast<const Interpreter::QmlObjectValue*>(objectValue)) {
|
||||
module = qmlObjectValue->packageName();
|
||||
}
|
||||
typeName = objectValue->className();
|
||||
|
||||
QIcon icon = m_icons->icon(module, typeName);
|
||||
if (! icon.isNull())
|
||||
return icon;
|
||||
|
||||
objectValue = objectValue->prototype(m_context->context());
|
||||
} while (objectValue);
|
||||
// TODO: get rid of namespace prefixes.
|
||||
icon = m_icons->icon("Qt", name);
|
||||
if (icon.isNull())
|
||||
icon = m_icons->icon("QtWebkit", name);
|
||||
}
|
||||
return QIcon();
|
||||
return icon;
|
||||
}
|
||||
|
||||
QString QmlOutlineModel::getAnnotation(AST::UiObjectInitializer *objectInitializer) {
|
||||
|
||||
@@ -120,7 +120,6 @@ private:
|
||||
QStandardItem *m_currentItem;
|
||||
QmlJS::Icons *m_icons;
|
||||
|
||||
QmlJS::LookupContext::Ptr m_context;
|
||||
QHash<QString, QIcon> m_typeToIcon;
|
||||
QHash<QmlOutlineItem*,QIcon> m_itemToIcon;
|
||||
QHash<QmlOutlineItem*,QmlJS::AST::Node*> m_itemToNode;
|
||||
|
||||
@@ -98,17 +98,14 @@ QuickToolBar::~QuickToolBar()
|
||||
m_widget.clear();
|
||||
}
|
||||
|
||||
void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupContext::Ptr lookupContext, AST::Node *node, bool update, bool force)
|
||||
void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, Document::Ptr document, LookupContext::Ptr lookupContext, AST::Node *node, bool update, bool force)
|
||||
{
|
||||
if (!QuickToolBarSettings::get().enableContextPane && !force && !update) {
|
||||
contextWidget()->hide();
|
||||
return;
|
||||
}
|
||||
|
||||
if (lookupContext.isNull())
|
||||
return;
|
||||
Document::Ptr doc = lookupContext->document();
|
||||
if (doc.isNull())
|
||||
if (document.isNull())
|
||||
return;
|
||||
|
||||
if (update && editor != m_editor)
|
||||
@@ -116,24 +113,26 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupConte
|
||||
|
||||
m_blockWriting = true;
|
||||
|
||||
const Interpreter::ObjectValue *scopeObject = doc->bind()->findQmlObject(node);
|
||||
const Interpreter::ObjectValue *scopeObject = document->bind()->findQmlObject(node);
|
||||
|
||||
QStringList prototypes;
|
||||
while (scopeObject) {
|
||||
prototypes.append(scopeObject->className());
|
||||
scopeObject = scopeObject->prototype(lookupContext->context());
|
||||
}
|
||||
if (!lookupContext.isNull()) {
|
||||
m_prototypes.clear();
|
||||
while (scopeObject) {
|
||||
m_prototypes.append(scopeObject->className());
|
||||
scopeObject = scopeObject->prototype(lookupContext->context());
|
||||
}
|
||||
|
||||
if (prototypes.contains("PropertyChanges")) {
|
||||
const Interpreter::ObjectValue *targetObject = getPropertyChangesTarget(node, lookupContext);
|
||||
prototypes.clear();
|
||||
while (targetObject) {
|
||||
prototypes.append(targetObject->className());
|
||||
targetObject = targetObject->prototype(lookupContext->context());
|
||||
if (m_prototypes.contains("PropertyChanges")) {
|
||||
const Interpreter::ObjectValue *targetObject = getPropertyChangesTarget(node, lookupContext);
|
||||
m_prototypes.clear();
|
||||
while (targetObject) {
|
||||
m_prototypes.append(targetObject->className());
|
||||
targetObject = targetObject->prototype(lookupContext->context());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEnabled(doc->isParsedCorrectly());
|
||||
setEnabled(document->isParsedCorrectly());
|
||||
m_editor = editor;
|
||||
contextWidget()->setParent(editor->widget()->parentWidget());
|
||||
contextWidget()->colorDialog()->setParent(editor->widget()->parentWidget());
|
||||
@@ -158,6 +157,8 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupConte
|
||||
end = objectBinding->lastSourceLocation().end();
|
||||
}
|
||||
|
||||
m_prototypes.append(name);
|
||||
|
||||
int line1;
|
||||
int column1;
|
||||
int line2;
|
||||
@@ -175,9 +176,9 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupConte
|
||||
rect.moveTo(reg.boundingRect().topLeft());
|
||||
reg = reg.intersect(rect);
|
||||
|
||||
if (contextWidget()->acceptsType(prototypes)) {
|
||||
if (contextWidget()->acceptsType(m_prototypes)) {
|
||||
m_node = 0;
|
||||
PropertyReader propertyReader(doc, initializer);
|
||||
PropertyReader propertyReader(document, initializer);
|
||||
QTextCursor tc(editor->editor()->document());
|
||||
tc.setPosition(offset);
|
||||
QPoint p1 = editor->editor()->mapToParent(editor->editor()->viewport()->mapToParent(editor->editor()->cursorRect(tc).topLeft()) - QPoint(0, contextWidget()->height() + 10));
|
||||
@@ -188,15 +189,15 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupConte
|
||||
offset = QPoint(400 - reg.boundingRect().width() + 10 ,0);
|
||||
QPoint p3 = editor->editor()->mapToParent(editor->editor()->viewport()->mapToParent(reg.boundingRect().topRight()) + offset);
|
||||
p2.setX(p1.x());
|
||||
contextWidget()->setType(prototypes);
|
||||
contextWidget()->setType(m_prototypes);
|
||||
if (!update)
|
||||
contextWidget()->activate(p3 , p1, p2, QuickToolBarSettings::get().pinContextPane);
|
||||
else
|
||||
contextWidget()->rePosition(p3 , p1, p2, QuickToolBarSettings::get().pinContextPane);
|
||||
contextWidget()->setOptions(QuickToolBarSettings::get().enableContextPane, QuickToolBarSettings::get().pinContextPane);
|
||||
contextWidget()->setPath(doc->path());
|
||||
contextWidget()->setPath(document->path());
|
||||
contextWidget()->setProperties(&propertyReader);
|
||||
m_doc = doc;
|
||||
m_doc = document;
|
||||
m_node = node;
|
||||
} else {
|
||||
contextWidget()->setParent(0);
|
||||
@@ -213,34 +214,27 @@ void QuickToolBar::apply(TextEditor::BaseTextEditorEditable *editor, LookupConte
|
||||
|
||||
}
|
||||
|
||||
bool QuickToolBar::isAvailable(TextEditor::BaseTextEditorEditable *, LookupContext::Ptr lookupContext, AST::Node *node)
|
||||
bool QuickToolBar::isAvailable(TextEditor::BaseTextEditorEditable *, Document::Ptr document, AST::Node *node)
|
||||
{
|
||||
if (lookupContext.isNull())
|
||||
return false;
|
||||
Document::Ptr doc = lookupContext->document();
|
||||
if (doc.isNull())
|
||||
if (document.isNull())
|
||||
return false;
|
||||
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
const Interpreter::ObjectValue *scopeObject = doc->bind()->findQmlObject(node);
|
||||
QString name;
|
||||
|
||||
UiObjectDefinition *objectDefinition = cast<UiObjectDefinition*>(node);
|
||||
UiObjectBinding *objectBinding = cast<UiObjectBinding*>(node);
|
||||
if (objectDefinition) {
|
||||
name = objectDefinition->qualifiedTypeNameId->name->asString();
|
||||
|
||||
} else if (objectBinding) {
|
||||
name = objectBinding->qualifiedTypeNameId->name->asString();
|
||||
}
|
||||
|
||||
QStringList prototypes;
|
||||
|
||||
while (scopeObject) {
|
||||
prototypes.append(scopeObject->className());
|
||||
scopeObject = scopeObject->prototype(lookupContext->context());
|
||||
}
|
||||
|
||||
if (prototypes.contains("PropertyChanges")) {
|
||||
const Interpreter::ObjectValue *targetObject = getPropertyChangesTarget(node, lookupContext);
|
||||
prototypes.clear();
|
||||
while (targetObject) {
|
||||
prototypes.append(targetObject->className());
|
||||
targetObject = targetObject->prototype(lookupContext->context());
|
||||
}
|
||||
}
|
||||
prototypes.append(name);
|
||||
|
||||
if (prototypes.contains("Rectangle") ||
|
||||
prototypes.contains("Image") ||
|
||||
@@ -248,7 +242,9 @@ bool QuickToolBar::isAvailable(TextEditor::BaseTextEditorEditable *, LookupConte
|
||||
prototypes.contains("TextEdit") ||
|
||||
prototypes.contains("TextInput") ||
|
||||
prototypes.contains("PropertyAnimation") ||
|
||||
prototypes.contains("Text"))
|
||||
prototypes.contains("NumberAnimation") ||
|
||||
prototypes.contains("Text") ||
|
||||
prototypes.contains("PropertyChanges"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
@@ -30,8 +30,8 @@ class QuickToolBar : public QmlJS::IContextPane
|
||||
public:
|
||||
QuickToolBar(QObject *parent = 0);
|
||||
~QuickToolBar();
|
||||
void apply(TextEditor::BaseTextEditorEditable *editor, QmlJS::LookupContext::Ptr lookupContext, QmlJS::AST::Node *node, bool update, bool force = 0);
|
||||
bool isAvailable(TextEditor::BaseTextEditorEditable *editor, QmlJS::LookupContext::Ptr lookupContext, QmlJS::AST::Node *node);
|
||||
void apply(TextEditor::BaseTextEditorEditable *editor, QmlJS::Document::Ptr document, QmlJS::LookupContext::Ptr lookupContext, QmlJS::AST::Node *node, bool update, bool force = false);
|
||||
bool isAvailable(TextEditor::BaseTextEditorEditable *editor, QmlJS::Document::Ptr document, QmlJS::AST::Node *node);
|
||||
void setProperty(const QString &propertyName, const QVariant &value);
|
||||
void removeProperty(const QString &propertyName);
|
||||
void setEnabled(bool);
|
||||
@@ -52,6 +52,7 @@ private:
|
||||
TextEditor::BaseTextEditorEditable *m_editor;
|
||||
bool m_blockWriting;
|
||||
QStringList m_propertyOrder;
|
||||
QStringList m_prototypes;
|
||||
};
|
||||
|
||||
} //QmlDesigner
|
||||
|
||||
@@ -186,7 +186,7 @@ Debugger::QmlEngine *InspectorUi::debuggerEngine() const
|
||||
void InspectorUi::showDebuggerTooltip(const QPoint &mousePos, TextEditor::ITextEditor *editor, int cursorPos)
|
||||
{
|
||||
Q_UNUSED(mousePos);
|
||||
if (editor->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
|
||||
if (m_clientProxy && editor->id() == QmlJSEditor::Constants::C_QMLJSEDITOR_ID) {
|
||||
QmlJSEditor::Internal::QmlJSTextEditor *qmlEditor = static_cast<QmlJSEditor::Internal::QmlJSTextEditor*>(editor->widget());
|
||||
|
||||
QTextCursor tc(qmlEditor->document());
|
||||
@@ -201,10 +201,16 @@ void InspectorUi::showDebuggerTooltip(const QPoint &mousePos, TextEditor::ITextE
|
||||
QmlJS::AST::Node *qmlNode = qmlEditor->semanticInfo().nodeUnderCursor(cursorPos);
|
||||
if (!qmlNode)
|
||||
return;
|
||||
QmlJS::AST::Node *node = qmlEditor->semanticInfo().declaringMemberNoProperties(cursorPos);
|
||||
if (!node)
|
||||
return;
|
||||
QDeclarativeDebugObjectReference ref = m_clientProxy->objectReferenceForLocation(node->uiObjectMemberCast()->firstSourceLocation().startLine, node->uiObjectMemberCast()->firstSourceLocation().startColumn);
|
||||
|
||||
QDeclarativeDebugObjectReference ref;
|
||||
if (QmlJS::AST::Node *node
|
||||
= qmlEditor->semanticInfo().declaringMemberNoProperties(cursorPos)) {
|
||||
if (QmlJS::AST::UiObjectMember *objMember = node->uiObjectMemberCast()) {
|
||||
ref = m_clientProxy->objectReferenceForLocation(
|
||||
objMember->firstSourceLocation().startLine,
|
||||
objMember->firstSourceLocation().startColumn);
|
||||
}
|
||||
}
|
||||
|
||||
if (ref.debugId() == -1)
|
||||
return;
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtCore/QXmlStreamReader>
|
||||
#include <QtCore/QScopedPointer>
|
||||
#include <QtGui/QDialogButtonBox>
|
||||
#include <QtGui/QFont>
|
||||
#include <QtGui/QMessageBox>
|
||||
@@ -140,89 +141,96 @@ GettingStartedWelcomePageWidget::~GettingStartedWelcomePageWidget()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
||||
const QString &demosPath,
|
||||
const QString &sourcePath)
|
||||
void GettingStartedWelcomePageWidget::parseXmlFile(QFile *file, QMenuHash &cppSubMenuHash, QMenuHash &qmlSubMenuHash,
|
||||
const QString &examplePath, const QString &sourcePath)
|
||||
{
|
||||
QString demoXml = demosPath + "/qtdemo/xml/examples.xml";
|
||||
if (!QFile::exists(demoXml)) {
|
||||
demoXml = sourcePath + "/demos/qtdemo/xml/examples.xml";
|
||||
if (!QFile::exists(demoXml))
|
||||
return;
|
||||
}
|
||||
|
||||
QFile description(demoXml);
|
||||
if (!description.open(QFile::ReadOnly))
|
||||
return;
|
||||
|
||||
const QString dropDownLabel = tr("Choose an Example...");
|
||||
|
||||
ui->qmlExamplesButton->setEnabled(true);
|
||||
ui->qmlExamplesButton->setText(dropDownLabel);
|
||||
|
||||
QMenu *qmlMenu = new QMenu(ui->qmlExamplesButton);
|
||||
ui->qmlExamplesButton->setMenu(qmlMenu);
|
||||
|
||||
ui->cppExamplesButton->setEnabled(true);
|
||||
ui->cppExamplesButton->setText(dropDownLabel);
|
||||
|
||||
QMenu *cppMenu = new QMenu(ui->cppExamplesButton);
|
||||
ui->cppExamplesButton->setMenu(cppMenu);
|
||||
|
||||
QMenu *subMenu = 0;
|
||||
QMenu *cppSubMenu = 0;
|
||||
QMenu *qmlSubMenu = 0;
|
||||
bool inExamples = false;
|
||||
QString dirName;
|
||||
QXmlStreamReader reader(&description);
|
||||
|
||||
QXmlStreamReader reader(file);
|
||||
|
||||
while (!reader.atEnd()) {
|
||||
switch (reader.readNext()) {
|
||||
case QXmlStreamReader::StartElement:
|
||||
if (reader.name() == QLatin1String("category")) {
|
||||
QString name = reader.attributes().value(QLatin1String("name")).toString();
|
||||
if (name.contains(QLatin1String("tutorial")))
|
||||
if (name.contains(QLatin1String("Tutorial")))
|
||||
break;
|
||||
dirName = reader.attributes().value(QLatin1String("dirname")).toString();
|
||||
subMenu = new QMenu(name);
|
||||
if (!cppSubMenuHash.contains(dirName)) {
|
||||
cppSubMenu = new QMenu(name, this);
|
||||
cppSubMenu->setObjectName(dirName);
|
||||
cppSubMenuHash.insert(dirName, cppSubMenu);
|
||||
} else {
|
||||
cppSubMenu = cppSubMenuHash.value(dirName);
|
||||
}
|
||||
if (!qmlSubMenuHash.contains(dirName)) {
|
||||
qmlSubMenu = new QMenu(name, this);
|
||||
qmlSubMenu->setObjectName(dirName);
|
||||
qmlSubMenuHash.insert(dirName, qmlSubMenu);
|
||||
} else {
|
||||
qmlSubMenu = qmlSubMenuHash.value(dirName);
|
||||
}
|
||||
inExamples = true;
|
||||
}
|
||||
if (inExamples && reader.name() == QLatin1String("example")) {
|
||||
const QChar slash = QLatin1Char('/');
|
||||
const QString name = reader.attributes().value(QLatin1String("name")).toString();
|
||||
const bool isQml = reader.attributes().value(QLatin1String("qml")).toString() == "true";
|
||||
const QString fn = reader.attributes().value(QLatin1String("filename")).toString();
|
||||
const QString localDir = reader.attributes().value(QLatin1String("filename")).toString();
|
||||
const QString extension = isQml ? QLatin1String(".qmlproject") : QLatin1String(".pro");
|
||||
const QString relativeProPath = slash + dirName + slash + fn + slash + fn + extension;
|
||||
const QString fileName = localDir.section(',', -1);
|
||||
const QString relativeProPath = slash + dirName + slash + localDir + slash + fileName + extension;
|
||||
|
||||
QString fileName = examplePath + relativeProPath;
|
||||
if (!QFile::exists(fileName))
|
||||
fileName = sourcePath + QLatin1String("/examples") + relativeProPath;
|
||||
QString finaleFileName = examplePath + relativeProPath;
|
||||
if (!QFile::exists(finaleFileName))
|
||||
finaleFileName = sourcePath + QLatin1String("/examples") + relativeProPath;
|
||||
|
||||
if (!QFile::exists(finaleFileName))
|
||||
break;
|
||||
|
||||
QString dirName1 = dirName;
|
||||
dirName1.replace(slash, QLatin1Char('-'));
|
||||
QString helpPath = QLatin1String("qthelp://com.trolltech.qt/qdoc/") +
|
||||
dirName1 +
|
||||
QLatin1Char('-') + fn + QLatin1String(".html");
|
||||
QLatin1Char('-') + fileName + QLatin1String(".html");
|
||||
|
||||
QAction *exampleAction;
|
||||
if (isQml)
|
||||
exampleAction = qmlMenu->addAction(name);
|
||||
else
|
||||
exampleAction = subMenu->addAction(name);
|
||||
QAction *exampleAction = 0;
|
||||
QAction *beforeAction = 0;
|
||||
bool duplicate = false;
|
||||
QMenu *subMenu;
|
||||
subMenu = isQml ? qmlSubMenu : cppSubMenu;
|
||||
|
||||
connect(exampleAction, SIGNAL(triggered()), SLOT(slotOpenExample()));
|
||||
|
||||
exampleAction->setProperty(ExamplePathPropertyName, fileName);
|
||||
exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
||||
foreach (beforeAction, subMenu->actions()) {
|
||||
int res = beforeAction->text().compare(name, Qt::CaseInsensitive);
|
||||
if (res==0) {
|
||||
duplicate = true;
|
||||
break;
|
||||
} else if (res<0)
|
||||
beforeAction = 0;
|
||||
else if (res>0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!duplicate) {
|
||||
exampleAction = new QAction(name, subMenu);
|
||||
subMenu->insertAction(beforeAction, exampleAction);
|
||||
connect(exampleAction, SIGNAL(triggered()), SLOT(slotOpenExample()));
|
||||
exampleAction->setProperty(ExamplePathPropertyName, finaleFileName);
|
||||
exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case QXmlStreamReader::EndElement:
|
||||
if (reader.name() == QLatin1String("category")) {
|
||||
if (subMenu->actions().isEmpty())
|
||||
delete subMenu;
|
||||
else
|
||||
cppMenu->addMenu(subMenu);
|
||||
if (inExamples && reader.name() == QLatin1String("category")) {
|
||||
if (cppSubMenu->actions().isEmpty())
|
||||
delete cppSubMenuHash.take(dirName);
|
||||
|
||||
if (qmlSubMenu->actions().isEmpty())
|
||||
delete qmlSubMenuHash.take(dirName);
|
||||
|
||||
inExamples = false;
|
||||
}
|
||||
@@ -233,6 +241,67 @@ void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
||||
}
|
||||
}
|
||||
|
||||
bool menuEntryCompare(QMenu* first, QMenu* second)
|
||||
{
|
||||
return (QString::localeAwareCompare(first->title(), second->title()) < 0);
|
||||
}
|
||||
|
||||
void GettingStartedWelcomePageWidget::updateExamples(const QString &examplePath,
|
||||
const QString &demosPath,
|
||||
const QString &sourcePath)
|
||||
{
|
||||
|
||||
QString demoXml = demosPath + "/qtdemo/xml/examples.xml";
|
||||
if (!QFile::exists(demoXml)) {
|
||||
demoXml = sourcePath + "/demos/qtdemo/xml/examples.xml";
|
||||
if (!QFile::exists(demoXml))
|
||||
return;
|
||||
}
|
||||
|
||||
QMenuHash cppSubMenuHash;
|
||||
QMenuHash qmlSubMenuHash;
|
||||
|
||||
const QString dropDownLabel = tr("Choose an Example...");
|
||||
QMenu *cppMenu = new QMenu(ui->cppExamplesButton);
|
||||
ui->cppExamplesButton->setMenu(cppMenu);
|
||||
QMenu *qmlMenu = new QMenu(ui->qmlExamplesButton);
|
||||
|
||||
|
||||
// let Creator's files take precedence
|
||||
QString localQmlExamplesXml =
|
||||
Core::ICore::instance()->resourcePath()+QLatin1String("/examplebrowser/qmlexamples.xml");
|
||||
|
||||
QFile localDescriptions(localQmlExamplesXml);
|
||||
if (localDescriptions.open(QFile::ReadOnly)) {
|
||||
parseXmlFile(&localDescriptions, cppSubMenuHash, qmlSubMenuHash, examplePath, sourcePath);
|
||||
}
|
||||
|
||||
QFile descriptions(demoXml);
|
||||
if (!descriptions.open(QFile::ReadOnly))
|
||||
return;
|
||||
|
||||
ui->cppExamplesButton->setEnabled(true);
|
||||
ui->cppExamplesButton->setText(dropDownLabel);
|
||||
|
||||
parseXmlFile(&descriptions, cppSubMenuHash, qmlSubMenuHash, examplePath, sourcePath);
|
||||
|
||||
QList<QMenu*> cppSubMenus = cppSubMenuHash.values();
|
||||
qSort(cppSubMenus.begin(), cppSubMenus.end(), menuEntryCompare);
|
||||
QList<QMenu*> qmlSubMenus = qmlSubMenuHash.values();
|
||||
qSort(qmlSubMenus.begin(), qmlSubMenus.end(), menuEntryCompare);
|
||||
|
||||
foreach (QMenu *menu, cppSubMenus)
|
||||
cppMenu->addMenu(menu);
|
||||
foreach (QMenu *menu, qmlSubMenus)
|
||||
qmlMenu->addMenu(menu);
|
||||
|
||||
if (!qmlMenu->isEmpty()) {
|
||||
ui->qmlExamplesButton->setMenu(qmlMenu);
|
||||
ui->qmlExamplesButton->setEnabled(true);
|
||||
ui->qmlExamplesButton->setText(dropDownLabel);
|
||||
}
|
||||
}
|
||||
|
||||
namespace {
|
||||
void copyRecursive(const QDir& from, const QDir& to, const QString& dir)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QUrl;
|
||||
class QLabel;
|
||||
class QFile;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
@@ -55,6 +57,8 @@ namespace Ui {
|
||||
class GettingStartedWelcomePageWidget;
|
||||
}
|
||||
|
||||
typedef QHash<QString, QMenu*> QMenuHash;
|
||||
|
||||
class PixmapDownloader : public QNetworkAccessManager {
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -101,6 +105,8 @@ signals:
|
||||
void startRssFetching(const QUrl&);
|
||||
|
||||
private:
|
||||
void parseXmlFile(QFile *file, QMenuHash &cppSubMenuHash, QMenuHash &qmlSubMenuHash,
|
||||
const QString &examplePath, const QString &sourcePath);
|
||||
QStringList tipsOfTheDay();
|
||||
Ui::GettingStartedWelcomePageWidget *ui;
|
||||
int m_currentTip;
|
||||
|
||||
@@ -40,15 +40,6 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="verticalSpacing">
|
||||
<number>12</number>
|
||||
@@ -76,12 +67,12 @@
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>250</width>
|
||||
<width>230</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string/>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_11">
|
||||
<property name="verticalSpacing">
|
||||
@@ -90,7 +81,57 @@
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Utils::WelcomeModeLabel" name="didYouKnowTitleLabel">
|
||||
<property name="text">
|
||||
<string>Did You Know?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
@@ -170,10 +211,10 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QTextBrowser" name="didYouKnowTextBrowser">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -195,69 +236,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Utils::WelcomeModeLabel" name="didYouKnowTitleLabel">
|
||||
<property name="text">
|
||||
<string>Did You Know?</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QFrame" name="demosExamplesFrame_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>500</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="Utils::WelcomeModeLabel" name="demoTitleLabel_4">
|
||||
@@ -324,39 +313,10 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="demoTitleLabel_3">
|
||||
<property name="text">
|
||||
<string>Explore Qt C++ mobile examples:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="mobileExamplesButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Examples Not Installed...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
@@ -408,6 +368,22 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="verticalSpacer_8">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -230,12 +230,11 @@ void MaemoDebugSupport::startDebugging()
|
||||
if (useGdb()) {
|
||||
handleAdapterSetupDone();
|
||||
} else {
|
||||
m_gdbserverOutput.clear();
|
||||
connect(m_runner, SIGNAL(remoteErrorOutput(QByteArray)), this,
|
||||
SLOT(handleRemoteErrorOutput(QByteArray)));
|
||||
connect(m_runner, SIGNAL(remoteOutput(QByteArray)), this,
|
||||
SLOT(handleRemoteOutput(QByteArray)));
|
||||
connect(m_runner, SIGNAL(remoteProcessStarted()), this,
|
||||
SLOT(handleRemoteProcessStarted()));
|
||||
const QString &remoteExe = m_runConfig->remoteExecutableFilePath();
|
||||
const QString cmdPrefix = MaemoGlobal::remoteCommandPrefix(remoteExe);
|
||||
const QString env = environment(m_runConfig);
|
||||
@@ -250,11 +249,6 @@ void MaemoDebugSupport::startDebugging()
|
||||
}
|
||||
}
|
||||
|
||||
void MaemoDebugSupport::handleRemoteProcessStarted()
|
||||
{
|
||||
handleAdapterSetupDone();
|
||||
}
|
||||
|
||||
void MaemoDebugSupport::handleDebuggingFinished()
|
||||
{
|
||||
m_stopped = true;
|
||||
@@ -269,6 +263,13 @@ void MaemoDebugSupport::handleRemoteOutput(const QByteArray &output)
|
||||
void MaemoDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
|
||||
{
|
||||
m_runControl->showMessage(QString::fromUtf8(output), AppOutput);
|
||||
if (!m_adapterStarted && !useGdb() && !m_qmlOnlyDebugging) {
|
||||
m_gdbserverOutput += output;
|
||||
if (m_gdbserverOutput.contains("Listening on port")) {
|
||||
handleAdapterSetupDone();
|
||||
m_gdbserverOutput.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MaemoDebugSupport::handleProgressReport(const QString &progressOutput)
|
||||
|
||||
@@ -75,7 +75,6 @@ private slots:
|
||||
void handleSftpChannelInitialized();
|
||||
void handleSftpChannelInitializationFailed(const QString &error);
|
||||
void handleSftpJobFinished(Core::SftpJobId job, const QString &error);
|
||||
void handleRemoteProcessStarted();
|
||||
void handleDebuggingFinished();
|
||||
void handleRemoteOutput(const QByteArray &output);
|
||||
void handleRemoteErrorOutput(const QByteArray &output);
|
||||
@@ -102,6 +101,7 @@ private:
|
||||
Core::SftpJobId m_uploadJob;
|
||||
bool m_adapterStarted;
|
||||
bool m_stopped;
|
||||
QByteArray m_gdbserverOutput;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -111,6 +111,7 @@ MaemoSettingsWidget::~MaemoSettingsWidget()
|
||||
{
|
||||
if (m_saveSettingsRequested)
|
||||
MaemoDeviceConfigurations::instance().setDevConfigs(m_devConfs);
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
QString MaemoSettingsWidget::searchKeywords() const
|
||||
|
||||
@@ -756,7 +756,6 @@ void S60DeviceDebugRunControl::start()
|
||||
QString settingsPage;
|
||||
if (!Debugger::DebuggerRunControl::checkDebugConfiguration(startParameters().toolChainType,
|
||||
&errorMessage, &settingsCategory, &settingsPage)) {
|
||||
m_debugProgress->reportCanceled();
|
||||
appendMessage(this, errorMessage, true);
|
||||
emit finished();
|
||||
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
<ui version="4.0">
|
||||
<class>Qt4ProjectManager::Internal::TestWizardPage</class>
|
||||
<widget class="QWizardPage" name="Qt4ProjectManager::Internal::TestWizardPage">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>WizardPage</string>
|
||||
</property>
|
||||
@@ -55,6 +47,16 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="Utils::ClassNameValidatingLineEdit" name="testClassLineEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Test slot:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Utils::ClassNameValidatingLineEdit" name="testSlotLineEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="typeLabel">
|
||||
<property name="text">
|
||||
@@ -76,17 +78,17 @@
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="fileLabel">
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="dataCheckBox">
|
||||
<property name="text">
|
||||
<string>File:</string>
|
||||
<string>Use a test data set</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="fileLineEdit">
|
||||
<property name="allowDirectories" stdset="0">
|
||||
<bool>true</bool>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="qApplicationCheckBox">
|
||||
<property name="text">
|
||||
<string>Requires QApplication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -97,27 +99,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="fileLabel">
|
||||
<property name="text">
|
||||
<string>Test slot:</string>
|
||||
<string>File:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Utils::ClassNameValidatingLineEdit" name="testSlotLineEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="qApplicationCheckBox">
|
||||
<property name="text">
|
||||
<string>Requires QApplication</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="dataCheckBox">
|
||||
<property name="text">
|
||||
<string>Use a test data set</string>
|
||||
<item row="6" column="1">
|
||||
<widget class="Utils::FileNameValidatingLineEdit" name="fileLineEdit">
|
||||
<property name="allowDirectories">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -128,12 +120,6 @@
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>194</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -262,7 +262,7 @@ void BaseFileFind::updateComboEntries(QComboBox *combo, bool onTop)
|
||||
void BaseFileFind::openEditor(const Find::SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
TextEditor::BaseTextEditor::openEditorAt(item.path.first(), item.lineNumber, item.textMarkPos,
|
||||
TextEditor::BaseTextEditor::openEditorAt(QDir::fromNativeSeparators(item.path.first()), item.lineNumber, item.textMarkPos,
|
||||
QString(), Core::EditorManager::ModeSwitch);
|
||||
} else {
|
||||
Core::EditorManager::instance()->openEditor(item.text, QString(), Core::EditorManager::ModeSwitch);
|
||||
@@ -318,7 +318,7 @@ QStringList BaseFileFind::replaceAll(const QString &text,
|
||||
QHash<QString, QList<Find::SearchResultItem> > changes;
|
||||
|
||||
foreach (const Find::SearchResultItem &item, items)
|
||||
changes[item.path.first()].append(item);
|
||||
changes[QDir::fromNativeSeparators(item.path.first())].append(item);
|
||||
|
||||
Core::EditorManager *editorManager = Core::EditorManager::instance();
|
||||
|
||||
|
||||
@@ -3171,6 +3171,7 @@ QStringList ProFileEvaluator::absoluteFileValues(
|
||||
QString wildcard = d->m_tmp2.setRawData(absEl.constData() + nameOff + 1,
|
||||
absEl.length() - nameOff - 1);
|
||||
if (wildcard.contains(QLatin1Char('*')) || wildcard.contains(QLatin1Char('?'))) {
|
||||
wildcard.detach(); // Keep m_tmp out of QRegExp's cache
|
||||
QDir theDir(absDir);
|
||||
foreach (const QString &fn, theDir.entryList(QStringList(wildcard)))
|
||||
if (fn != statics.strDot && fn != statics.strDotDot)
|
||||
|
||||
@@ -269,6 +269,7 @@ bool startCreatorAsDebugger(bool asClient, QString *errorMessage)
|
||||
const QString dir = QApplication::applicationDirPath();
|
||||
const QString binary = dir + QLatin1Char('/') + QLatin1String(creatorBinaryC);
|
||||
QStringList args;
|
||||
// Send to running Creator: Unstable with directly linked CDB engine.
|
||||
if (asClient)
|
||||
args << QLatin1String("-client");
|
||||
args << QLatin1String("-debug") << QString::number(argProcessId)
|
||||
@@ -356,8 +357,10 @@ bool chooseDebugger(QString *errorMessage)
|
||||
if (msgBox.clickedButton() == creatorButton) {
|
||||
// Just in case, default to standard. Do not run as client in the unlikely case
|
||||
// Creator crashed
|
||||
// TODO: pass asClient=true for new CDB engine.
|
||||
const bool canRunAsClient = !processName.contains(QLatin1String(creatorBinaryC), Qt::CaseInsensitive);
|
||||
if (startCreatorAsDebugger(canRunAsClient, errorMessage))
|
||||
Q_UNUSED(canRunAsClient)
|
||||
if (startCreatorAsDebugger(false, errorMessage))
|
||||
return true;
|
||||
return startDefaultDebugger(errorMessage);
|
||||
}
|
||||
@@ -478,7 +481,8 @@ int main(int argc, char *argv[])
|
||||
usage(QCoreApplication::applicationFilePath(), errorMessage);
|
||||
break;
|
||||
case ForceCreatorMode:
|
||||
ex = startCreatorAsDebugger(true, &errorMessage) ? 0 : -1;
|
||||
// TODO: pass asClient=true for new CDB engine.
|
||||
ex = startCreatorAsDebugger(false, &errorMessage) ? 0 : -1;
|
||||
break;
|
||||
case ForceDefaultMode:
|
||||
ex = startDefaultDebugger(&errorMessage) ? 0 : -1;
|
||||
|
||||
@@ -52,6 +52,8 @@ private Q_SLOTS:
|
||||
void forStatement();
|
||||
void templateSingleline();
|
||||
void macrosNoSemicolon2();
|
||||
void renamedNamespace();
|
||||
void cpp0xFor();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -1000,6 +1002,38 @@ void tst_CodeFormatter::macrosNoSemicolon2()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::renamedNamespace()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("namespace X = Y;")
|
||||
<< Line("void foo()")
|
||||
<< Line("{")
|
||||
<< Line(" return;")
|
||||
<< Line("}")
|
||||
<< Line("int i;")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::cpp0xFor()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("void foo()")
|
||||
<< Line("{")
|
||||
<< Line(" vector<int> x = setup();")
|
||||
<< Line(" for(int p : x) {")
|
||||
<< Line(" bar(p);")
|
||||
<< Line(" }")
|
||||
<< Line("}")
|
||||
<< Line("void car()")
|
||||
<< Line("{")
|
||||
<< Line(" int i;")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
||||