Merge remote-tracking branch 'origin/2.3'

Conflicts:
	qtcreator.pri
	share/qtcreator/dumper/dumper.py
	share/qtcreator/qml/qmlpuppet/instances/objectnodeinstance.h
	src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
	src/plugins/valgrind/valgrind.pro
	tests/manual/gdbdebugger/simple/simple_gdbtest_app.cpp

Change-Id: Ic2d347012d89d697e6382f156e64f9619da88300
This commit is contained in:
Eike Ziller
2011-07-15 14:29:07 +02:00
271 changed files with 6421 additions and 9989 deletions

56
dist/changes-2.3.0 vendored
View File

@@ -8,8 +8,9 @@ git clone git://gitorious.org/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v2.2.1...origin/2.3
General
* Welcome page redesign allows searching through examples with descriptions
* Restore previous size when unmaximizing output panes
* Redesigned the Welcome page to allow searching through examples with
descriptions
* Fixed Output panes so that they are minimized to their previous size
* Added support for building with the Clang compiler
Editing
@@ -22,9 +23,34 @@ Debugging
* Color memory display highlighting the variables in stack layout
* Correct source location for breakpoints in CDB using code model
(QTCREATORBUG-2317)
* Added support for multiple breakpoints from one location
(covering constructors, destructors, template functions, and so on)
* Added a custom dumper for QXmlAttributes, Eigen::Matrix
* Added the option to set data breakpoints on either an address or expression
* Added a framework to modify strings, vectors, and so on, during debugging
* Added an option to stop on qWarning
* Renamed "Locals and Watchers" as "Locals and Expressions"
* Renamed "Watchpoint" as "Data Breakpoints"
* Made original values of automatically dereferenced pointers accessible
* Improved the "Add Breakpoint" dialog
* Improved the displaying of enums (included numeric value)
* Improved the speed of the QVariant dumper
* Improved the handling of shadowed local variables
* Fixed object expansion in tooltip
* Fixed std::deque dumper (QTCREATORBUG-4936)
* Fixed the handling of watched expressions with unusual characters
* Fixed "Run To Line" on Mac (QTCREATORBUG-4619)
* Fixed output parsing for data breakpoints on Mac (QTCREATORBUG-4797)
* Fixed auto-continue on SIGTRAP (QTCREATORBUG-4968)
* Fixed the dumper for gcc 4.4's std::map
Debugging QML/JS
Analyzing Code
* Redesigned the framework code
* Added support for QML profiling
* Added support for the Valgrind Callgrind tool on Linux and Mac
C++ Support
* Made C++ coding style configurable (QTCREATORBUG-2670, QTCREATORBUG-4310,
QTCREATORBUG-2763, QTCREATORBUG-3623, QTCREATORBUG-567)
@@ -47,6 +73,26 @@ QML/JS Support
* Fixed scanning and indentation of regular expression literals (QTCREATORBUG-4566)
* Fixed indentation of object literals
Qt Quick Designer
* Added tool buttons to the navigator for reordering and reparenting of items
* Added support for import as (QTCREATORBUG-4087)
* Added editing and navigation for inline components
* Added support for models and delegates in the current file (QTCREATORBUG-4528)
* Added support for repeaters (QTCREATORBUG-4852)
* Added context menu for resetting postion and size
* Added context menu for improved selection (QTCREATORBUG-4611)
* Added translation support for text items
* Added context menu for z-order (QTCREATORBUG-2522)
* Fixed z-order in the form editor (QTCREATORBUG-5226)
* Improved usability of the form editor (QTCREATORBUG-4820 QTCREATORBUG-4819)
* Do not enforce clipping of items in the form editor anymore
* Improved property editor for mouse area (QTCREATORBUG-4927)
* Use the qmlpuppet from current Qt if availabe (QTCREATORBUG-4824)
* Added project for qmlpuppet in share of Qt Creator
* Fixed copy and paste bug (QTCREATORBUG-4581)
* Fixed scoping of root item properties (QTCREATORBUG-4574)
* Improved property editor for ListView, GridView and PathView
Help
Platform Specific
@@ -72,6 +118,12 @@ Remote Linux Support
Qt Designer
FakeVim:
* Made FakeVim functionality available for shortcuts in normal text editor
* Added snippet support
* Fixed behaviour of Ctrl keys on Mac
* Fixed searching for expressions containing '|' (QTCREATORBUG-4752)
Version control plugins
* Git: Manage remote repositories
* Git: Improved branch dialog

View File

@@ -13,7 +13,7 @@ include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf)
include(qt-defines.qdocconf)
sources.fileextensions = "qtcreator.qdoc maemodev.qdoc symbiandev.qdoc addressbook-sdk.qdoc qtcreator-faq.qdoc"
sources.fileextensions = "qtcreator.qdoc maemodev.qdoc symbiandev.qdoc addressbook-sdk.qdoc qtcreator-faq.qdoc linuxdev.qdoc"
qhp.projects = QtCreator

View File

@@ -83,5 +83,5 @@ OTHER_FILES = $$HELP_DEP_FILES $$DEV_HELP_DEP_FILES
fixnavi.commands = \
cd $$targetPath($$PWD) && \
perl fixnavi.pl -Dqcmanual -Dqtquick \
qtcreator.qdoc maemodev.qdoc symbiandev.qdoc qtcreator-faq.qdoc
qtcreator.qdoc maemodev.qdoc symbiandev.qdoc qtcreator-faq.qdoc linuxdev.qdoc
QMAKE_EXTRA_TARGETS += fixnavi

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 955 B

After

Width:  |  Height:  |  Size: 920 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

134
doc/linuxdev.qdoc Normal file
View File

@@ -0,0 +1,134 @@
/****************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
/*!
\contentspage index.html
\previouspage creator-developing-maemo.html
\page creator-developing-generic-linux.html
\nextpage creator-developing-symbian.html
\title Connecting Generic Linux Devices
You can connect generic Linux devices to the development PC to build, run,
debug, and analyze applications on them from Qt Creator.
If you have the tool chain for building applications for generic Linux
devices (with no MADDE support) installed on the development PC, you can add
it to Qt Creator.
To be able to run and debug applications on generic Linux devices, you must
create device configurations and select them in the Qt Creator run
settings.
You use a wizard to create the connections. You can edit the settings later
in \gui {Tools > Options... > Linux Devices > Device Configurations}.
\image qtcreator-linux-device-configurations.png "Device Configurations dialog"
You can protect the connections between Qt Creator and a device by using
either a password or an SSH key. If you do not have an SSH key, you can
create it in Qt Creator. For more information, see \l {Generating SSH Keys}.
To configure connections between Qt Creator and generic Linux devices:
\list 1
\o Make sure that your device can be reached via an IP address.
\o Select \gui {Tools > Options... > Qt4 > Add} to add the Qt version
for the generic Linux.
\o Select \gui {Tools > Options... > Tool Chains > Add} to add the tool
chain for building the applications.
\o To deploy applications and run them remotely on devices, specify
parameters for accessing the devices:
\list 1
\o Select \gui {Tools > Options... > Linux Devices > Device
Configurations > Add > Generic Linux Device}.
\image qtcreator-screenshot-devconf-linux.png "Connection Data wizard"
\o In the \gui {The name to identify this configuration} field,
enter a name for the connection.
\o In the \gui {The device's host name or IP address} field,
enter the host name or IP address of the device.
\o In the \gui {The user name to log into the device} field,
enter the user name to log into the device and run the
application as.
\o In the \gui {The authentication type} field, select whether
to use \gui Password or \gui Key authentication, and enter
the user's password or the file that contains the user's
private key.
\o Click \gui {Next} to create the connection.
\endlist
\o To specify build settings:
\list 1
\o Open a project for an application you want to develop for the
device.
\o Select \gui {Projects > Desktop > Build}.
\o Select the Qt version and tool chain for the generic Linux
device.
\endlist
\o To specify run settings:
\list 1
\o Select \gui {Run > Add > Build Tarball and Deploy to Linux Host}
to add a new deploy configuration.
\image qtcreator-run-settings-linux-devices.png "Run settings for generic Linux devices"
\o In the \gui {Device configuration} field, select the device
connection.
\endlist
When you run the project, Qt Creator creates an installation package in
the build directory. The name of the directory is displayed in the
\gui {Create tarball} step.
The \gui {Deploy tarball via SFTP upload using device} step specifies
that Qt Creator uploads the tarball to the device and extracts it.
You can add custom deploy steps and remove the default step if
it is incompatible with your steps.
To only create a tarball and not copy the files to the device,
remove all deploy steps.
\endlist
*/

View File

@@ -29,7 +29,7 @@
\endif
\page creator-developing-maemo.html
\if defined(qcmanual)
\nextpage creator-developing-symbian.html
\nextpage creator-developing-generic-linux.html
\else
\nextpage smartinstaller.html
\endif
@@ -279,7 +279,7 @@
only need to configure a connection to the device.
You use a wizard to create the connections. You can edit the settings later
in \gui {Tools > Options... > Maemo > Maemo Device Configurations}.
in \gui {Tools > Options... > Linux Devices > Device Configurations}.
\image qtcreator-maemo-device-configurations.png "Maemo Device Configurations dialog"
@@ -327,8 +327,8 @@
\note If you experience connection problems due to a USB port issue,
switch to a different port or use WLAN to connect to the device.
\o Select \gui Tools > \gui Options... > \gui Maemo >
\gui{Maemo Device Configurations > Add}, and add a new configuration for a
\o Select \gui {Tools > Options... > Linux Devices > Device
Configurations > Add}, and add a new configuration for a
hardware device.
\image qtcreator-screenshot-devconf.png
@@ -345,6 +345,9 @@
\o In the \gui {The device's host name or IP address} field, enter
the IP address from the connectivity tool on the device.
\o In the \gui {The SSH server port} field, enter the port number to
use for SSH connections.
\o Click \gui Next.
\o Follow the instructions of the wizard to create the connection.
@@ -360,8 +363,9 @@
\list a
\o In Qt Creator, select \gui {Tools > Options... > Maemo >
Maemo Device Configurations > Add} to add a new configuration.
\o In Qt Creator, select \gui {Tools > Options... > Linux
Devices > Device Configurations > Add} to add a new
configuration.
\image qtcreator-maemo-emulator-connection.png
@@ -428,8 +432,8 @@
\o To specify the password, enter the following command:
\c{/usr/lib/mad-developer/devrootsh passwd user}
\o In Qt Creator, Select \gui Tools > \gui Options... > \gui Maemo >
\gui{Maemo Device Configurations}.
\o In Qt Creator, select \gui {Tools > Options... Linux Devices >
Device Configurations}.
\o Specify the username \c user and the password in the device configuration.
@@ -444,7 +448,8 @@
\list 1
\o Select \gui {Tools > Options... > Maemo > Maemo Device Configurations
\o Select \gui {Tools > Options... > Linux Devices > Device
Configurations
> Generate SSH Key...}.
\o Click \gui {Generate SSH Key}.
@@ -465,7 +470,7 @@
You can view processes running on the Maemo or MeeGo Harmattan device and
kill them.
Select \gui {Tools > Options... > Maemo > Maemo Device Configurations >
Select \gui {Tools > Options... > Linux Devices > Device Configurations >
Remote Processes...}.
You can filter the processes by name in the \gui {List of Remote Processes}

View File

@@ -66,6 +66,7 @@
\o \l{Opening a Project}
\o \l{Adding Libraries to Projects}
\o \l{Connecting Maemo and MeeGo Harmattan Devices}
\o \l{Connecting Generic Linux Devices}
\o \l{Connecting Symbian Devices}
\o \l{Managing Sessions}
\endlist
@@ -133,6 +134,7 @@
\o \l{Profiling QML Applications}
\o \l{Detecting Memory Leaks}
\o \l{Profiling Function Execution}
\o \l{Running Valgrind Tools Remotely}
\endlist
\o \l{Deploying Applications to Mobile Devices}
\list
@@ -372,7 +374,8 @@
and profile Qt Quick applications.
You can test applications that are intended for mobile devices in the Qt
Simulator and Maemo Emulator, but you also need to test the applications
Simulator and Maemo or MeeGo Harmattan emulator, but you also need to test
the applications
on real devices.
\section2 Debuggers
@@ -435,11 +438,11 @@
If you change property values or add properties in the code editor, the
changes are updated in the running application when they are saved.
\section3 QML Observer
\section3 QML Inspector
While the application is running, you can use the \gui {QML Observer} view to
While the application is running, you can use the \gui {QML Inspector} view to
explore the object structure, debug animations, and inspect colors. When debugging
complex applications, you can use the observe mode to jump to the position in code
complex applications, you can use the inspection mode to jump to the position in code
where an element is defined.
\section2 Code Analysis Tools
@@ -447,8 +450,8 @@
The memory available on devices is limited and you should use it carefully.
Qt Creator integrates Valgrind code analysis tools for detecting memory
leaks and profiling function execution. These tools are only supported on
Linux and
Mac OS. You must download and install them separately to use them from Qt
Linux and Mac OS, but you can run them remotely from Windows. You must
download and install them separately to use them from Qt
Creator.
The QML Profiler is installed as part of Qt Creator. It allows you
@@ -556,6 +559,8 @@
\o MeeGo Harmattan
\o Generic remote Linux
\o Symbian
\endlist
@@ -565,13 +570,14 @@
\table
\header
\o {1,5} Operating system
\o {5,1} Platform
\o {1,6} Operating system
\o {6,1} Platform
\header
\o Desktop
\o Qt Simulator
\o Maemo 5
\o MeeGo Harmattan
\o Generic Remote Linux
\o Symbian
\row
@@ -581,12 +587,14 @@
\o Yes
\o Yes
\o Yes
\o Yes
\row
\o Linux
\o Yes
\o Yes
\o Yes
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
\row
\o Mac OS X
@@ -594,6 +602,7 @@
\o Yes
\o Yes
\o Yes
\o Yes
\o Yes (by using Remote Compiler for building)
\endtable
*/
@@ -776,7 +785,6 @@
\o \gui{Application Output}
\o \gui{Compile Output}
\o \gui{General Messages}
\o \gui{Analysis}
\o \gui{Version Control}
\endlist
@@ -790,7 +798,7 @@
criteria in the \gui Find field and click the left and right arrows to
search down and up in the pane.
To open the \gui{General Messages}, \gui{Analysis}, and \gui{Version Control}
To open the \gui{General Messages} and \gui{Version Control}
panes, select \gui {Window > Output Panes}.
@@ -1181,14 +1189,15 @@
as tree structure.
\o \gui {Library} pane displays the building blocks that you can use to design
applications: predefined QML elements, your own QML components, and other
applications: predefined QML elements, your own QML components, Qt Quick
components for Symbian or MeeGo that you import to the project, and other
resources.
\o \gui Canvas is the working area where you create QML components and
design applications.
\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.
or QML component. You can change the properties also in the code editor.
\o \gui {State} pane displays the different states of the component. QML
states typically describe user interface configurations, such as the UI
@@ -1207,7 +1216,8 @@
You can select elements in the \gui Navigator to edit their properties
in the \gui Properties pane. Elements can access the properties of their
parent element.
parent element. To select elements on the canvas, right-click an element,
and select another element in the context menu.
Typically, child elements are located within the parent element on the
canvas. However, they do not necessarily have to fit inside the parent element.
@@ -1238,6 +1248,20 @@
\inlineimage qtcreator-splitbar.png
.
\section2 Setting the Stacking Order
The \l{http://doc.qt.nokia.com/4.7/qml-item.html#z-prop}{z property} of an
element determines its position in relation to its sibling elements in the
element hierarchy. By default, elements with a higher stacking value are
drawn on top of siblings with a lower stacking value. Elements with the same
stacking value are drawn in the order they are listed, from the last item
up.
To change the stacking order of an item, right-click it on the canvas and
select \gui {Stack (z)}. You can raise or lower the stack value of an item
or move the item to the front or back of all its siblings. To remove the
\c z property, select \gui Reset.
\section2 Switching Parent Elements
When you drag and drop QML elements to the canvas, Qt Quick Designer
@@ -1250,21 +1274,32 @@
element under the cursor becomes the new parent of the element.
You can change the parent of an element also in the \gui Navigator pane.
Drag and drop the element to another position in the tree.
Drag and drop the element to another position in the tree or use the arrow
buttons to move the element in the tree.
\image qmldesigner-navigator-arrows.png "Navigator arrow buttons"
\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.
components, basic elements, positioner elements, and views.
\omit
Sets of UI components with the MeeGo and Symbian look and feel have been
defined for Qt Quick. They are based on standard QML elements. To view the
UI components in \gui {QML Components}, click
\inlineimage qtcreator-filter.png
and select \gui {MeeGo Components} or \gui {Symbian Components}.
\endomit
UI components in the \gui {Library} pane, add import statements to the .pro
file of your project:
\list
\o \c {import com.nokia.symbian 1.0} for Symbian
\o \c {import com.meego 1.0} for MeeGo
\endlist
The Qt Quick Application wizard adds the import statements automatically
when you select the component set to use for your project.
\image qmldesigner-qml-components.png "QML Components pane"
@@ -1288,6 +1323,11 @@
that you specify explicitly are highlighted with blue color. In addition, property
changes in states are highlighted with blue.
You can use a context-menu to reset some element properties. To reset the
position or size property of an element, right-click the element and select
\gui {Edit > Reset Position} or \gui {Reset Size} in the context menu. To
set the visibility of the component, select \gui {Edit > Visibility}.
For more information on the properties available for an element, press \key {F1}.
\section2 Setting Expressions
@@ -1311,6 +1351,17 @@
For more information on the JavaScript environment provided by QML, see
\l{http://doc.qt.nokia.com/4.7/qdeclarativejavascript.html}{Integrating JavaScript}.
\section2 Marking Text Elements for Translation
To support translators, mark each text element that should be translated.
In the \gui Properties pane, \gui Text field, select \gui tr.
\image qmldesigner-text-property-tr.png "Text properties"
The text string is enclosed in a \c qsTr call.
\image qml-translate.png "Text marked for translation"
\section2 Loading Placeholder Data
Often, QML applications are prototyped with fake data that is later
@@ -1420,7 +1471,8 @@
\section2 Building Transformations on Items
The \gui Advanced pane allows you configure advanced transformations, such as
The \gui Advanced pane allows you to 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.
@@ -3185,6 +3237,7 @@
\o \l{Opening a Project}
\o \l{Adding Libraries to Projects}
\o \l{Connecting Maemo and MeeGo Harmattan Devices}
\o \l{Connecting Generic Linux Devices}
\o \l{Connecting Symbian Devices}
\o \l{Managing Sessions}
\endlist
@@ -4479,6 +4532,42 @@
Debugging also works transparently.
\section1 Running on Generic Linux Devices
\list 1
\o Build and run the application for \l{Running on Qt Simulator}
{Qt Simulator}.
\o Build and run the application for a device:
\list 1
\o Specify a connection to the device. For more information, see
\l{Connecting Generic Linux Devices}.
\o Click the \gui Run button.
\endlist
\endlist
Qt Creator uses the compiler specified in the project build settings
(tool chain) to build the application.
Qt Creator generates an installation package, installs it on the
device, and executes the selected application. The application views are
displayed on the device. Command-line output is visible in the Qt
Creator \gui {Application Output} view.
Choose \gui {Projects > Desktop > Run} to view the settings for deploying
the application on the connected device and creating the installation
package. For more information, see
\l{Specifying Run Settings for Generic Linux Devices}.
Debugging works transparently if GDB server is installed on the device and
it is compatible with the GDB on the host.
\section1 Running on Symbian
\list 1
@@ -4903,6 +4992,24 @@
information, see
\l{Deploying Applications to Maemo or MeeGo Harmattan Devices}.
\section2 Specifying Run Settings for Generic Linux Devices
To run an application on a generic Linux device (without MADDE support),
create and select a device configuration in the Desktop run settings for
your project. You can also pass command line arguments to your application.
\image qtcreator-run-settings-linux-devices.png "Run settings for Generic Linux devices"
In addition, you must create a connection from the development PC to the
device. Click \gui {Manage device configurations} to create connections.
For more information, see \l {Connecting Generic Linux Devices}.
When you run the application on the \gui Desktop target, Qt Creator
generates an installation package in the build directory. The name of the
directory is displayed in the \gui {Create tarball} step. Qt Creator copies
the tarball to devices by using the SSH file transfer protocol (SFTP) and
extracts it.
\section1 Specifying a Custom Executable to Run
If you use CMake or the generic project type in Qt Creator, or want
@@ -5092,7 +5199,7 @@
/*!
\contentspage index.html
\previouspage creator-cache-profiler.html
\previouspage creator-running-valgrind-remotely.html
\page creator-deployment.html
\nextpage creator-deployment-symbian.html
@@ -7804,7 +7911,7 @@
The on-device mode is a special mode available for run configurations
targeting mobile devices. It debugs processes running on mobile
devices using on-device debugging agents, such as CODA on Symbian and
gdbserver on Maemo and MeeGo Harmattan.
gdbserver on Linux-based devices.
To launch the debugger in the on-device mode, open the project, select a
run configuration that targets a mobile device, and click the
@@ -8072,7 +8179,9 @@
By default, the views are locked into place in the workspace. Select
\gui {Window > Views > Locked} to unlock the views. Drag and drop the
views into new positions on the screen. Drag view borders to resize the
views. The size and position of views are saved for future sessions.
views. The size and position of views are saved for future sessions. Select
\gui {Window > Views > Reset to Default Layout} to reset the views to
their original sizes and positions.
\section1 Using the Debugger
@@ -8823,10 +8932,11 @@
The debugging helpers for QML provide you with code completion for custom modules
(\c qmldump) and debugging Qt Quick UI projects (\c qmlobserver).
You have to build the QML Observer once for each Qt version that you want to debug
You have to build the QML Inspector once for each Qt version that you want
to debug
with. Select \gui{Tools > Options... > Qt4 > Qt Versions}.
\note QML Observer requires Qt 4.7.1 or later.
\note QML Inspector requires Qt 4.7.1 or later.
\section1 Enabling Debugging Helpers for Qt's Bootstrapped Applications
@@ -8972,7 +9082,7 @@
\o Select \gui Projects, and then select the \gui QML check box in the
\gui {Run Settings}, to enable QML debugging.
\o Compile the QML Observer debugging helper. For more information, see
\o Compile the QML Inspector debugging helper. For more information, see
\l{Debugging Helpers for QML}.
\endlist
@@ -9048,7 +9158,7 @@
You can see the current value of a property by hovering over it in the code editor.
\section1 Previewing QML Changes at Runtime
\section1 Applying QML Changes at Runtime
If you change property values or add properties in the code editor, the changes
are updated in the running application when you save them. If live preview is not supported
@@ -9060,37 +9170,46 @@
\section1 Inspecting QML at Runtime
While the application is running, you can use the \gui {QML Observer} view to
While the application is running, you can use the \gui {QML Inspector} view to
explore the object structure, debug animations, and inspect colors.
To open the \gui {QML Observer} view, choose \gui {Window > View > QML Observer}.
To open the \gui {QML Inspector} view, choose \gui {Window > View >
QML Inspector}.
The view shows the properties of the currently selected QML element.
\image qml-observer-view.png "QML Observer view"
\image qml-observer-view.png "QML Inspector view"
When you debug complex applications, you can use the observe
mode to jump to the position in code where an element is defined. To switch to
the observe mode, click
\inlineimage qml-observer-bar-observe.png
When you debug complex applications, you can use the inspection
mode to jump to the position in code where an element is defined. You are
switched to the inspection mode, when you click the \gui Select, \gui Zoom,
or \gui {Color Picker} button
on the toolbar.
Click elements in the running application to jump to their definitions in the code.
Double-click elements to browse the element hierarchy. The hierarchy is displayed
as bread crumbs in the \gui {QML Observer} view.
\image qml-observer-buttons.png "QML Inspector toolbar"
To move the application running in \QQV to the front, select the
\gui {Show Application on Top} button.
When the \gui Select tool is enabled, you can click elements in the running
application to jump to their definitions in the code. The properties of the
selected element are displayed in the \gui {QML Inspector} view. The element
hierarchy is displayed as a bread crumb path.
You can also right-click an element in the running application to view the element
hierarchy as a context menu. Select an element to jump to its definition in code.
hierarchy as a context menu.
\image qml-observer-context-menu.png "QML Observer"
\image qml-observer-context-menu.png "QML Inspector"
To zoom in and out of the application, click the \gui Zoom button.
To switch to the zoom mode, click the \gui Zoom button. Click in the
running application to zoom in. Right-click to open a context menu that
contains zoom controls.
To inspect colors, click the \gui {Color Picker} button. You can also click
\inlineimage qml-observer-bar-copy-color.png "Copy Color button"
to copy the color definition to the clipboard.
To switch out of the inspection mode, deselect the \gui Select, \gui Zoom,
and \gui {Color Picker} button.
To move the application running in \QQV to the front, select the
\gui {Show Application on Top} button.
\section1 Debugging Animations
\image qml-observer.png
@@ -9845,7 +9964,12 @@
\endlist
In the code editor, write the code to use the data models.
When you add a Grid View, List View, or Path View element, the
\l{http://doc.qt.nokia.com/4.7/qml-listmodel.html}{ListModel} and the
delegate component that creates an instance for each item in the model are
added automatically. You can edit element properties in the \gui Properties
pane or in the code editor. You can also replace the default model and
delegate with other, more complex models and delegates in the code editor.
\section1 Positioning Items on Screens
@@ -10014,6 +10138,18 @@
Note: GIMP does not support grouping, and therefore, each layer is exported as
an item in GIMP.
You can open the QML file in Qt Creator for editing. If you edit the file in Adobe
Photoshop and export it to the same directory again, any changes you made in Qt
Creator are overwritten. However, you can re-export graphical assets without
recreating the QML code.
If you create vector graphics with other tools that have an Adobe Photoshop export
option, such as Adobe Illustrator, you can export them first to Photoshop
and then
to QML.
\section1 Conversion Rules
The following rules apply to the conversions:
\list
@@ -10034,14 +10170,38 @@
\endlist
You can open the QML file in Qt Creator for editing. If you edit the file in Adobe
Photoshop and export it to the same directory again, any changes you made in Qt
Creator are overwritten. However, you can re-export graphical assets without
recreating the QML code.
\section1 Preparing Files for Conversion
If you create vector graphics with other tools that have an Adobe Photoshop export
option,such as Adobe Illustrator, you can export them first to Photoshop and then
to QML.
To create QML files that are easy to use, prepare the Adobe Photoshop or
GIMP designs for exporting, as follows:
\list
\o To minimize the number of elements, minimize the number of layers or
use top-level layer groups, because each layer or layer group is
exported as a Text or Image element.
\o To make sure that all related elements are exported to the same
element, use top-level layer groups.
\o To determine that some layers are not exported, hide them, and
deselect the \gui {Export hidden} check box during exporting.
\o To make it easier to find the layers and layer groups after
exporting them, use descriptive names for them.
\o To make sure that image dimensions are preserved during export,
create at least one fully filled layer (which can be hidden), such
as a background layer. If the export script does not find a fully
filled layer, it resizes all images to the size of the canvas.
\o To prevent errors during export, make sure that the layers are not
locked. Locked layers cannot be exported.
\o To avoid unexpected results, do not use Blending Mode effects. They
are not exported.
\endlist
\section1 Exporting from Adobe Photoshop to QML
@@ -10329,16 +10489,16 @@
\section1 Starting the Emulator
The \gui {Start Maemo Emulator} button is visible if you have a project
The \gui {Start MeeGo Emulator} button is visible if you have a project
open in Qt Creator for which you have added the Maemo or MeeGo Harmattan
build target. It starts the Maemo or MeeGo Harmattan emulator, depending
on the selected target.
To start the emulator, click
\inlineimage qtcreator-maemo-emulator-button.png "Start Maemo Emulator button"
\inlineimage qtcreator-maemo-emulator-button.png "Start MeeGo Emulator button"
.
Test your application on the Maemo emulator as on a device. For a list of
Test your application on the emulator as on a device. For a list of
keyboard shortcuts that you can use to emulate keys and functions, see
\l {Emulating Device Keys}.
@@ -10355,7 +10515,8 @@
If the emulator crashes, you are asked whether you want to try software
rendering, instead.
To specify the OpenGL mode, select \gui {Tools > Options... > Maemo > Qemu
To specify the OpenGL mode, select \gui {Tools > Options... > Linux Devices
> Maemo Qemu
Settings}.
\section1 Emulating Device Keys
@@ -10453,7 +10614,7 @@
and displays the text \e {Shutting down} in the emulator window title pane.
The emulator closes shortly after this.
You can also select the \gui {Start Maemo Emulator} button to close the
You can also select the \gui {Start MeeGo Emulator} button to close the
emulator. This is a faster way to close the emulator, because it does not
wait for the operating system running on the emulated machine to shut down,
but this also means that it is less safe.
@@ -12060,7 +12221,8 @@
\l{http://valgrind.org/info/tools.html}{Valgrind tool suite} to detect
problems that are related to memory management in applications.
\note Memcheck is supported on Linux and Mac OS.
\note Memcheck is supported locally on Linux and Mac OS. You can run it on
a remote host from Windows.
After you download and install Valgrind tools, you can use Memcheck from Qt
Creator.
@@ -12090,7 +12252,7 @@
While the application is running, Memcheck checks all reads and writes of
memory and intercepts calls that allocate or free memory or create or
delete memory blocks. When you stop Memcheck, it displays the results in
the \gui Analysis output pane. Click a line to view where a memory leak
the \gui Analysis view. Click a line to view where a memory leak
occurred and a stack trace that shows what caused it.
\image analyzer-issues.png "Analysis view"
@@ -12105,16 +12267,17 @@
Stack traces can get quite large and confusing, and therefore, reading them
from the bottom up can help. If the stack trace is not big enough or it is
too big, select \gui {Tools > Options... > Analyzer > Memory Analysis}.
too big, select \gui {Tools > Options... > Analyzer}.
Define the length of the stack trace in the \gui {Backtrace frame count}
field.
\image qtcreator-valgrind-memcheck-options.png "Memory Analysis options"
Memcheck also reports uses of uninitialised values, most commonly with the
message \gui {Conditional jump or move depends on uninitialised value(s).}
To determine the root cause of these errors, the \gui {Track origins of
uninitialized memory} check box is selected by default. This makes Memcheck
run slower, but the extra information you get often saves a lot of time
figuring out where the uninitialised values are coming from.
uninitialized memory} check box is selected by default. You can deselect it
to make Memcheck run faster.
Memcheck detects numerous problems in the system libraries, such as the C
library, which come pre-installed with your OS. As you cannot easily fix
@@ -12129,26 +12292,26 @@
\l{http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress}
{Suppressing Errors} in the Valgrind documentation.
\image qtcreator-valgrind-memcheck-options.png "Memory Analysis options"
*/
/*!
\contentspage index.html
\previouspage creator-analyzer.html
\page creator-cache-profiler.html
\nextpage creator-deployment.html
\nextpage creator-running-valgrind-remotely.html
\title Profiling Function Execution
You can use the Callgrind tool included in the
\l{http://valgrind.org/info/tools.html}{Valgrind tool suite} to detect
problems that are related to cache usage.
problems that are related to executing functions.
After you download and install Valgrind tools, you can use Callgrind from Qt
Creator.
\note Callgrind is supported locally on Linux and Mac OS. You can run it on
a remote host from Windows.
To analyze applications:
\list 1
@@ -12187,12 +12350,12 @@
\section1 Selecting Profiling Options
To specify settings for Callgrind, select \gui {Tools > Options... >
Analyzer > Profiling}.
To specify settings for Valgrind, select \gui {Tools > Options... >
Analyzer}. The \gui {Profiling Options} group contains Callgrind options.
\image qtcreator-valgrind-callgrind-options.png "Profiling options"
\image qtcreator-valgrind-callgrind-options.png "Valgrind options"
In the \gui {Result view: Show events with inclusive costs higher than}
In the \gui {Result view: Minimum event cost}
field, limit the amount of results the profiler gives you to increase
profiler performance.
@@ -12336,24 +12499,35 @@
In addition, Qt Creator integrates Valgrind code analysis tools for
detecting memory leaks and profiling function execution. These tools are
only
supported on Linux and Mac OS. You have to download and install them
supported locally only on Linux and Mac OS. You can run them on a remote
host from Windows. You have to download and install them
separately to use them from Qt Creator.
You can use the code analysis tools in the \gui Analyze mode or from the
\gui {Debug > Start Analyzer} menu. In \gui Analyze mode, you can switch
You can use the code analysis tools in the \gui Analyze mode. To switch to
\gui Analyze mode, select \gui Analyze in the mode selector, or select the
\gui {Analyze} menu and then select a tool. When you are in the
\gui Analyze mode, you can switch
between tools by selecting them in the menu on the toolbar.
\image qtcreator-analyze-menu "Analyze mode menu"
To run the Valgrind tools on a remote device over SSH, select \gui {Debug >
Start Analyzer > Start Remote}.
By default, the views in the \gui Analyze mode are locked into place in the
workspace. Select \gui {Window > Views > Locked} to unlock the views. Drag
and drop the views into new positions on the screen. Drag view borders to
resize the views. The size and position of views are saved for future
sessions. Select \gui {Window > Views > Reset to Default Layout} to reset
the views to their original sizes and positions.
To stop the currently running analyzer, select \gui {Debug > Start Analyzer
To run the Valgrind tools on a remote host over SSH, select \gui {Analyze
> Valgrind Analyze Memory (Remote)} or \gui {Valgrind Function Profile
(Remote)}.
To stop the currently running analyzer, select \gui {Analyze
> Stop}.
To select options for the Valgrind tools, select \gui {Tools > Options... >
Analyzer}.
Analyzer}. You can override the general settings for each project in the
\gui {Run Settings} for the project.
The following sections describe how to use the code analysis tools:
@@ -12369,6 +12543,9 @@
\o \l{Profiling Function Execution} describes how to use the Valgrind Callgrind
tool to find cache misses in the code.
\o \l{Running Valgrind Tools Remotely} describes how to run the
Valgrind tools on a remote host.
\endlist
*/
@@ -12386,18 +12563,28 @@
\list 1
\o To be able to profile an application, you must set up QML debugging
for the project. For more information, see
\l{Setting Up QML Debugging}.
\o In the \gui Projects mode, select Qt 4.7.4 in the \gui {Qt version}
field.
\o Select \gui Analyze to open the \gui Analyze mode.
\note To profile applications on devices, you must install Qt 4.7.4
or later libraries on them.
\o Select \gui {Analyze > QML Profiler} to profile the current
application.
\image qtcreator-qml-performance-monitor-toolbar.png "QML Profiler toolbar"
\o Select the
\inlineimage qtcreator-analyze-start-button.png "Start button"
button to start the application from the QML Profiler.
\note: If data collection does not start automatically, select the
\note If data collection does not start automatically, select the
\inlineimage qtcreator-analyzer-button.png "Analyzer button"
.
button.
\endlist
@@ -12410,8 +12597,6 @@
button. Data collection takes time, and therefore, there might be a delay
before the data is displayed.
\image qtcreator-qml-performance-monitor-toolbar.png "QML Profiler toolbar"
Do not use application commands to exit the application, because data is
sent to the QML Profiler when you select the \gui Stop button.
The application continues to run for some seconds, after which it is stopped
@@ -12422,23 +12607,6 @@
application is launched. Data collection starts when you select the button
again.
To monitor applications running on devices:
\list 1
\o On the command line, enter the following command to launch the Qt
Quick application with parameters:
\c {<application> -qmljsdebugger=port:33456}
The port number is specified in the run settings of the project in
the \gui {Debug port} field.
\o Select \gui {Debug > Start Analyzer > Attach...} to attach the QML
Profiler to the running application.
\endlist
\section1 Analyzing Collected Data
The \gui Timeline view displays graphical representations of:
@@ -12462,8 +12630,16 @@
\image qtcreator-qml-performance-monitor.png "QML Profiler"
The outline summarizes the period for which data was collected. Drag the
range bar or click the outline to move on the outline. Drag the borders of
the range bar to zoom in and out.
zoom range or click the outline to move on the outline. You can also move
between events by clicking the \gui Previous and \gui Next buttons.
Click the zoom buttons or drag the zoom handles to zoom in and out.
You can define an event range to view the frame rate of events and to
compare it with the frame rate of similar events. Click on the timeline to
specify the beginning of the event range. Drag the cursor to define the end
of the range. The length of the range indicates the frame rate of the event.
You can drag the timeline below the event range to compare events.
Additional information is displayed on the rows above the outline.
Each row in the timeline describes a type of QML events that were recorded.
@@ -12481,19 +12657,19 @@
The time bar at the top of the \gui Timeline view displays the time in
seconds. To see the time in milliseconds, move the mouse on the time bar.
\section1 Viewing Bindings
\section1 Viewing Events
The \gui Bindings view displays the number of times each binding is called
and the time the calls take. This allows you to examine which bindings you
The \gui Events view displays the number of times each binding is called
and the time the calls take. This allows you to examine which events you
need to optimize. A high number of calls might indicate that a binding is
called unnecessarily. Click on a binding to move to it in the source code
in the code editor.
\image qtcreator-analyzer-bindings.png "Bindings view"
\image qtcreator-analyzer-bindings.png "Events view"
\section1 Viewing Calling and Called Bindings
\section1 Viewing Calling and Called Events
The \gui Callees and \gui Callers views show dependencies between bindings.
The \gui Callees and \gui Callers views show dependencies between events.
They allow you to examine the internal functions of the application.
The \gui Callees view summarizes the QML events that a binding triggers.
@@ -12520,7 +12696,7 @@
environment variable QML_DISABLE_OPTIMIZER to 1. To set the environment
variable for the current project in the project settings:
\list
\list 1
\o Select \gui {Projects > Run}.
@@ -12531,3 +12707,35 @@
\endlist
*/
/*!
\contentspage index.html
\previouspage creator-cache-profiler.html
\page creator-running-valgrind-remotely.html
\nextpage creator-deployment.html
\title Running Valgrind Tools Remotely
Qt Creator integrates Valgrind code analysis tools for detecting memory
leaks and profiling function execution. These tools are supported locally
only on Linux and Mac OS, but you can run them on a remote host from
Windows.
To run the Valgrind tools on a remote host over SSH:
\list 1
\o Select \gui {Analyze > Valgrind Analyze Memory (Remote)} or
\gui {Valgrind Function Profile (Remote)}.
\image qtcreator-valgrind-remote-settings.png "Start Debugger dialog"
\o In the \gui Remote group, specify the connection to the remote host.
\o In the \gui Target group, specify the application to run and analyze
on the remote host.
\endlist
*/

View File

@@ -22,7 +22,7 @@
/*!
\contentspage index.html
\if defined(qcmanual)
\previouspage creator-developing-maemo.html
\previouspage creator-developing-generic-linux.html
\else
\previouspage sdk-gs.html
\endif

View File

@@ -1,10 +1,11 @@
include(qtcreator.pri)
#version check qt
contains(QT_VERSION, ^4\\.[0-6]\\..*) {
!minQtVersion(4, 7, 4) {
message("Cannot build Qt Creator with Qt version $${QT_VERSION}.")
error("Use at least Qt 4.7.")
error("Use at least Qt 4.7.4.")
}
include(qtcreator.pri)
include(doc/doc.pri)
TEMPLATE = subdirs

View File

@@ -107,7 +107,9 @@ typeInfoCache = {}
def lookupType(typestring):
type = typeCache.get(typestring)
#warn("LOOKUP 1: %s -> %s" % (typestring, type))
if type is None:
if not type is None:
return type
ts = typestring
while True:
#WARN("ts: '%s'" % ts)
@@ -131,6 +133,14 @@ def lookupType(typestring):
ts = ts[:-8]
else:
break
if ts.endswith('*'):
type = lookupType(ts[0:-1])
if not type is None:
type = type.pointer()
typeCache[typestring] = type
return type
try:
#warn("LOOKING UP '%s'" % ts)
type = gdb.lookup_type(ts)
@@ -146,19 +156,9 @@ def lookupType(typestring):
except:
#warn("LOOKING UP '%s' FAILED" % ts)
pass
#warn(" RESULT: '%s'" % type)
#if not type is None:
# warn(" FIELDS: '%s'" % type.fields())
typeCache[typestring] = type
if type is None and typestring.endswith('*'):
type = lookupType(typestring[0:-1])
if not type is None:
type = type.pointer()
typeCache[typestring] = type
if type is None:
# could be gdb.lookup_type("char[3]") generating
# This could still be None as gdb.lookup_type("char[3]") generates
# "RuntimeError: No type named char[3]"
pass
return type
def cleanAddress(addr):
@@ -167,7 +167,8 @@ def cleanAddress(addr):
# We cannot use str(addr) as it yields rubbish for char pointers
# that might trigger Unicode encoding errors.
#return addr.cast(lookupType("void").pointer())
return hex(long(addr))
# We do not use "hex(...)" as it (sometimes?) adds a "L" suffix.
return "0x%x" % long(addr)
def extractTemplateArgument(type, position):
level = 0
@@ -291,7 +292,7 @@ class SubItem:
if len(type) > 0 and type != self.d.currentChildType:
self.d.put('type="%s",' % type) # str(type.unqualified()) ?
if not type in typeInfoCache:
if not type in typeInfoCache and type != " ": # FIXME: Move to lookupType
typeObj = lookupType(type)
if not typeObj is None:
typeInfoCache[type] = TypeInfo(typeObj)
@@ -1081,7 +1082,7 @@ class Dumper:
try:
list = eval(exp)
self.putValue("")
self.putType(" ")
self.putNoType()
self.putNumChild(len(list))
# This is a list of expressions to evaluate
with Children(self, len(list)):
@@ -1092,7 +1093,7 @@ class Dumper:
except RuntimeError, error:
warn("EVAL: ERROR CAUGHT %s" % error)
self.putValue("<syntax error>")
self.putType(" ")
self.putNoType()
self.putNumChild(0)
with Children(self, 0):
pass
@@ -1104,7 +1105,7 @@ class Dumper:
handled = False
if len(exp) == 0: # The <Edit> case
self.putValue(" ")
self.putType(" ")
self.putNoType()
self.putNumChild(0)
else:
try:
@@ -1147,6 +1148,11 @@ class Dumper:
self.currentType = type
self.currentTypePriority = priority
def putNoType(self):
# FIXME: replace with something that does not need special handling
# in SubItem.__exit__().
self.putBetterType(" ")
def putBetterType(self, type, priority = 0):
self.currentType = type
self.currentTypePriority = self.currentTypePriority + 1
@@ -1364,26 +1370,25 @@ class Dumper:
return
if value.type.code == gdb.TYPE_CODE_ARRAY:
baseptr = value.cast(realtype.pointer())
if format == 0 or format == 1 or format == 2:
# Explicityly requested Latin1 or UTF-8 formatting.
f = [Hex2EncodedLatin1, Hex2EncodedUtf8, Hex2EncodedLocal8Bit][format]
targettype = realtype.target()
self.putAddress(value.address)
self.putType(realtype)
self.putValue(encodeCharArray(value, 100), f)
self.putNumChild(1)
if format == 0:
# Explicitly requested Latin1 formatting.
self.putValue(encodeCharArray(value, 100), Hex2EncodedLatin1)
elif format == 1:
# Explicitly requested UTF-8 formatting.
self.putValue(encodeCharArray(value, 100), Hex2EncodedUtf8)
elif format == 2:
# Explicitly requested Local 8-bit formatting.
self.putValue(encodeCharArray(value, 100), Hex2EncodedLocal8Bit)
else:
self.putType(realtype)
self.putAddress(value.address)
self.putValue("%s" % baseptr)
self.putNumChild(1)
self.putValue("@0x%x" % long(value.cast(targettype.pointer())))
if self.isExpanded(item):
charptr = lookupType("unsigned char").pointer()
addr1 = (baseptr+1).cast(charptr)
addr0 = baseptr.cast(charptr)
self.put('addrbase="%s",' % cleanAddress(addr0))
self.put('addrstep="%s",' % (addr1 - addr0))
with Children(self, 1, realtype.target()):
self.put('addrbase="0x%x",' % long(value.cast(targettype.pointer())))
self.put('addrstep="%s",' % targettype.sizeof)
with Children(self, 1, targettype):
child = Item(value, item.iname, None, item.name)
self.putFields(child)
return

View File

@@ -509,7 +509,7 @@ def qdump__QImage(d, item):
with Children(d):
with SubItem(d):
d.putName("data")
d.putType(" ");
d.putNoType()
d.putNumChild(0)
d.putValue("size: %s bytes" % nbytes);
format = d.itemFormat(item)
@@ -669,9 +669,6 @@ def extractCString(table, offset):
def qdump__QObject(d, item):
#warn("OBJECT: %s " % item.value)
try:
privateTypeName = str(item.value.type) + "Private"
privateType = lookupType(privateTypeName)
if privateType is None:
privateTypeName = d.ns + "QObjectPrivate"
privateType = lookupType(privateTypeName)
staticMetaObject = item.value["staticMetaObject"]
@@ -724,7 +721,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("data")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
iname = item.iname + ".data"
if d.isExpandedIName(iname):
@@ -764,7 +761,7 @@ def qdump__QObject(d, item):
propertyCount = staticPropertyCount + dynamicPropertyCount
d.putName("properties")
d.putType(" ")
d.putNoType()
d.putItemCount(propertyCount)
d.putNumChild(propertyCount)
@@ -877,7 +874,7 @@ def qdump__QObject(d, item):
# Connections.
with SubItem(d):
d.putName("connections")
d.putType(" ")
d.putNoType()
connections = d_ptr["connectionLists"]
connectionListCount = 0
if not isNull(connections):
@@ -909,7 +906,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("signals")
d.putItemCount(signalCount)
d.putType(" ")
d.putNoType()
d.putNumChild(signalCount)
if signalCount:
# FIXME: empty type does not work for childtype
@@ -923,7 +920,7 @@ def qdump__QObject(d, item):
d.putField("iname", "%s.signals.%d"
% (item.iname, signal))
d.putName("signal %d" % signal)
d.putType(" ")
d.putNoType()
d.putValue(extractCString(metaStringData, offset))
d.putNumChild(0) # FIXME: List the connections here.
@@ -932,7 +929,7 @@ def qdump__QObject(d, item):
slotCount = metaData[4] - signalCount
d.putName("slots")
d.putItemCount(slotCount)
d.putType(" ")
d.putNoType()
d.putNumChild(slotCount)
if slotCount:
#d.putField("childtype", ".")
@@ -944,14 +941,14 @@ def qdump__QObject(d, item):
offset = metaData[14 + 5 * (signalCount + slot)]
d.putField("iname", "%s.slots.%d" % (item.iname, slot))
d.putName("slot %d" % slot)
d.putType(" ")
d.putNoType()
d.putValue(extractCString(metaStringData, offset))
d.putNumChild(0) # FIXME: List the connections here.
# Active connection
with SubItem(d):
d.putName("currentSender")
d.putType(" ")
d.putNoType()
sender = d_ptr["currentSender"]
d.putValue(cleanAddress(sender))
if isNull(sender):
@@ -967,7 +964,7 @@ def qdump__QObject(d, item):
with SubItem(d):
d.putName("signal")
d.putValue(sender["signal"])
d.putType(" ");
d.putNoType()
d.putNumChild(0)
# QObject
@@ -2203,7 +2200,7 @@ def qdump__QTJSC__JSValue(d, item):
with SubItem(d):
d.putName("tag")
d.putValue(jstagAsString(long(tag)))
d.putType(" ")
d.putNoType()
d.putNumChild(0)
d.putIntItem("payload", long(payload))
@@ -2438,7 +2435,7 @@ if False:
d.putField("iname", iname)
d.putName("tree")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
if d.isExpandedIName(iname):
with Children(d):
@@ -2449,7 +2446,7 @@ if False:
d.putField("iname", iname)
d.putName("data")
d.putValue(" ")
d.putType(" ")
d.putNoType()
d.putNumChild(1)
if d.isExpandedIName(iname):
with Children(d):
@@ -2507,7 +2504,7 @@ if False:
else:
d.putName("type")
d.putValue(item.value["type"])
d.putType(" ")
d.putNoType()
@@ -2515,5 +2512,5 @@ if False:
def qdump__bug5106__A5106(d, item):
d.putName("a")
d.putValue("This is the value: %s" % item.value["m_a"])
d.putType(" ")
d.putNoType()
d.putNumChild(0)

View File

@@ -3144,6 +3144,57 @@ Module {
Property { name: "target"; type: "QSGItem"; isPointer: true }
Property { name: "anchors"; type: "QSGAnchorSet"; isReadonly: true; isPointer: true }
}
Component {
name: "QSGAnchorSet"
prototype: "QObject"
Property { name: "left"; type: "QDeclarativeScriptString" }
Property { name: "right"; type: "QDeclarativeScriptString" }
Property { name: "horizontalCenter"; type: "QDeclarativeScriptString" }
Property { name: "top"; type: "QDeclarativeScriptString" }
Property { name: "bottom"; type: "QDeclarativeScriptString" }
Property { name: "verticalCenter"; type: "QDeclarativeScriptString" }
Property { name: "baseline"; type: "QDeclarativeScriptString" }
}
Component {
name: "QSGAnchors"
prototype: "QObject"
Property { name: "left"; type: "QSGAnchorLine" }
Property { name: "right"; type: "QSGAnchorLine" }
Property { name: "horizontalCenter"; type: "QSGAnchorLine" }
Property { name: "top"; type: "QSGAnchorLine" }
Property { name: "bottom"; type: "QSGAnchorLine" }
Property { name: "verticalCenter"; type: "QSGAnchorLine" }
Property { name: "baseline"; type: "QSGAnchorLine" }
Property { name: "margins"; type: "qreal" }
Property { name: "leftMargin"; type: "qreal" }
Property { name: "rightMargin"; type: "qreal" }
Property { name: "horizontalCenterOffset"; type: "qreal" }
Property { name: "topMargin"; type: "qreal" }
Property { name: "bottomMargin"; type: "qreal" }
Property { name: "verticalCenterOffset"; type: "qreal" }
Property { name: "baselineOffset"; type: "qreal" }
Property { name: "fill"; type: "QSGItem"; isPointer: true }
Property { name: "centerIn"; type: "QSGItem"; isPointer: true }
Property { name: "mirrored"; type: "bool"; isReadonly: true }
Signal { name: "leftChanged" }
Signal { name: "rightChanged" }
Signal { name: "topChanged" }
Signal { name: "bottomChanged" }
Signal { name: "verticalCenterChanged" }
Signal { name: "horizontalCenterChanged" }
Signal { name: "baselineChanged" }
Signal { name: "fillChanged" }
Signal { name: "centerInChanged" }
Signal { name: "leftMarginChanged" }
Signal { name: "rightMarginChanged" }
Signal { name: "topMarginChanged" }
Signal { name: "bottomMarginChanged" }
Signal { name: "marginsChanged" }
Signal { name: "verticalCenterOffsetChanged" }
Signal { name: "horizontalCenterOffsetChanged" }
Signal { name: "baselineOffsetChanged" }
Signal { name: "mirroredChanged" }
}
Component {
name: "QSGAngledDirection"
prototype: "QSGStochasticDirection"
@@ -3483,6 +3534,30 @@ Module {
}
Method { name: "returnToBounds" }
}
Component {
name: "QSGFlickableVisibleArea"
prototype: "QObject"
Property { name: "xPosition"; type: "qreal"; isReadonly: true }
Property { name: "yPosition"; type: "qreal"; isReadonly: true }
Property { name: "widthRatio"; type: "qreal"; isReadonly: true }
Property { name: "heightRatio"; type: "qreal"; isReadonly: true }
Signal {
name: "xPositionChanged"
Parameter { name: "xPosition"; type: "qreal" }
}
Signal {
name: "yPositionChanged"
Parameter { name: "yPosition"; type: "qreal" }
}
Signal {
name: "widthRatioChanged"
Parameter { name: "widthRatio"; type: "qreal" }
}
Signal {
name: "heightRatioChanged"
Parameter { name: "heightRatio"; type: "qreal" }
}
}
Component {
name: "QSGFlipable"
defaultProperty: "data"
@@ -5119,6 +5194,14 @@ Module {
Signal { name: "currentItemChanged" }
Signal { name: "pathChanged" }
}
Component {
name: "QSGPen"
prototype: "QObject"
Property { name: "width"; type: "qreal" }
Property { name: "color"; type: "QColor" }
Property { name: "aligned"; type: "bool" }
Signal { name: "penChanged" }
}
Component {
name: "QSGPinch"
prototype: "QObject"
@@ -5375,6 +5458,15 @@ Module {
Signal { name: "zScaleChanged" }
Signal { name: "scaleChanged" }
}
Component {
name: "QSGScaleGrid"
prototype: "QObject"
Property { name: "left"; type: "int" }
Property { name: "top"; type: "int" }
Property { name: "right"; type: "int" }
Property { name: "bottom"; type: "int" }
Signal { name: "borderChanged" }
}
Component {
name: "QSGShaderEffectItem"
defaultProperty: "data"
@@ -6273,6 +6365,7 @@ Module {
}
Method { name: "parentModelIndex"; type: "QVariant" }
}
Component { name: "QSGVisualDataModelParts"; prototype: "QObject" }
Component {
name: "QSGVisualItemModel"
defaultProperty: "children"

View File

@@ -141,7 +141,7 @@ QByteArray convertToId(const QByteArray &cppName)
return cppToId.value(cppName, cppName);
}
QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode, QDeclarativeEngine *engine)
QSet<const QMetaObject *> collectReachableMetaObjects(const QList<QDeclarativeType *> &skip = QList<QDeclarativeType *>())
{
QSet<const QMetaObject *> metas;
metas.insert(FriendlyQObject::qtMeta());
@@ -189,7 +189,9 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode,
// find even more QMetaObjects by instantiating QML types and running
// over the instances
foreach (const QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) {
foreach (QDeclarativeType *ty, QDeclarativeMetaType::qmlTypes()) {
if (skip.contains(ty))
continue;
if (ty->isExtendedType())
continue;
if (!ty->isCreatable())
@@ -202,21 +204,14 @@ QSet<const QMetaObject *> collectReachableMetaObjects(const QString &importCode,
if (tyName.isEmpty())
continue;
QByteArray code = importCode.toUtf8();
code += tyName;
code += " {}\n";
QDeclarativeComponent c(engine);
c.setData(code, QUrl::fromLocalFile(pluginImportPath + "/typeinstance.qml"));
inObjectInstantiation = tyName;
QObject *object = c.create();
QObject *object = ty->create();
inObjectInstantiation.clear();
if (object)
collectReachableMetaObjects(object, &metas);
else
qWarning() << "Could not create" << tyName << ":" << c.errorString();
qWarning() << "Could not create" << tyName;
}
return metas;
@@ -542,8 +537,8 @@ int main(int argc, char *argv[])
}
// find all QMetaObjects reachable from the builtin module
QByteArray importCode("import QtQuick 1.0\n");
QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects(importCode, engine);
QSet<const QMetaObject *> defaultReachable = collectReachableMetaObjects();
QList<QDeclarativeType *> defaultTypes = QDeclarativeMetaType::qmlTypes();
// this will hold the meta objects we want to dump information of
QSet<const QMetaObject *> metas;
@@ -551,6 +546,20 @@ int main(int argc, char *argv[])
if (action == Builtins) {
metas = defaultReachable;
} else {
// find a valid QtQuick import
QByteArray importCode;
QDeclarativeType *qtObjectType = QDeclarativeMetaType::qmlType(&QObject::staticMetaObject);
if (!qtObjectType) {
qWarning() << "Could not find QtObject type";
importCode = QByteArray("import QtQuick 1.0\n");
} else {
QByteArray module = qtObjectType->qmlTypeName();
module = module.mid(0, module.lastIndexOf('/'));
importCode = QString("import %1 %2.%3\n").arg(module,
QString::number(qtObjectType->majorVersion()),
QString::number(qtObjectType->minorVersion())).toUtf8();
}
// find all QMetaObjects reachable when the specified module is imported
if (action != Path) {
importCode += QString("import %0 %1\n").arg(pluginImportUri, pluginImportVersion).toAscii();
@@ -575,7 +584,7 @@ int main(int argc, char *argv[])
}
}
QSet<const QMetaObject *> candidates = collectReachableMetaObjects(importCode, engine);
QSet<const QMetaObject *> candidates = collectReachableMetaObjects(defaultTypes);
candidates.subtract(defaultReachable);
// Also eliminate meta objects with the same classname.

View File

@@ -30,32 +30,58 @@
**
**************************************************************************/
#ifndef ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H
#define ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H
#include <QtGui/QWidget>
namespace Valgrind {
#include "anchorchangesnodeinstance.h"
namespace QmlDesigner {
namespace Internal {
namespace Ui {
class CallgrindConfigWidget;
AnchorChangesNodeInstance::AnchorChangesNodeInstance(QObject *object) :
ObjectNodeInstance(object)
{
}
class AbstractCallgrindSettings;
class CallgrindConfigWidget : public QWidget
AnchorChangesNodeInstance::Pointer AnchorChangesNodeInstance::create(QObject *object)
{
public:
CallgrindConfigWidget(AbstractCallgrindSettings *settings, QWidget *parent);
virtual ~CallgrindConfigWidget();
Q_ASSERT(object);
private:
Ui::CallgrindConfigWidget *m_ui;
AbstractCallgrindSettings *m_settings;
};
Pointer instance(new AnchorChangesNodeInstance(object));
return instance;
}
void AnchorChangesNodeInstance::setPropertyVariant(const QString &/*name*/, const QVariant &/*value*/)
{
}
void AnchorChangesNodeInstance::setPropertyBinding(const QString &/*name*/, const QString &/*expression*/)
{
}
QVariant AnchorChangesNodeInstance::property(const QString &/*name*/) const
{
return QVariant();
}
void AnchorChangesNodeInstance::resetProperty(const QString &/*name*/)
{
}
void AnchorChangesNodeInstance::reparent(const ServerNodeInstance &/*oldParentInstance*/,
const QString &/*oldParentProperty*/,
const ServerNodeInstance &/*newParentInstance*/,
const QString &/*newParentProperty*/)
{
}
QObject *AnchorChangesNodeInstance::changesObject() const
{
return object();
}
} // namespace Internal
} // namespace Valgrind
#endif // ANALYZER_INTERNAL_CALLGRINDCONFIGWIDGET_H
} // namespace QmlDesigner

View File

@@ -1,11 +1,9 @@
/**************************************************************************
**
** This file is part of Qt Creator Instrumentation Tools
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Author: Milian Wolff, KDAB (milian.wolff@kdab.com)
**
** Contact: Nokia Corporation (info@qt.nokia.com)
**
**
@@ -32,49 +30,49 @@
**
**************************************************************************/
#ifndef ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
#define ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
#include <QtGui/QWidget>
#ifndef QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H
#define QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H
#include "objectnodeinstance.h"
#include <QPair>
#include <QWeakPointer>
QT_BEGIN_NAMESPACE
class QStandardItemModel;
class QDeclarativeProperty;
QT_END_NAMESPACE
namespace Valgrind {
namespace QmlDesigner {
namespace Internal {
namespace Ui {
class MemcheckConfigWidget;
}
class AbstractMemcheckSettings;
class MemcheckConfigWidget : public QWidget
class AnchorChangesNodeInstance : public ObjectNodeInstance
{
Q_OBJECT
public:
MemcheckConfigWidget(AbstractMemcheckSettings *settings, QWidget *parent);
virtual ~MemcheckConfigWidget();
typedef QSharedPointer<AnchorChangesNodeInstance> Pointer;
typedef QWeakPointer<AnchorChangesNodeInstance> WeakPointer;
void setSuppressions(const QStringList &files);
QStringList suppressions() const;
static Pointer create(QObject *objectToBeWrapped);
public Q_SLOTS:
void slotAddSuppression();
void slotRemoveSuppression();
void slotSuppressionsRemoved(const QStringList &files);
void slotSuppressionsAdded(const QStringList &files);
void slotSuppressionSelectionChanged();
virtual void setPropertyVariant(const QString &name, const QVariant &value);
virtual void setPropertyBinding(const QString &name, const QString &expression);
virtual QVariant property(const QString &name) const;
virtual void resetProperty(const QString &name);
private:
AbstractMemcheckSettings *m_settings;
QStandardItemModel *m_model;
Ui::MemcheckConfigWidget *m_ui;
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
void reparent(const ServerNodeInstance &oldParentInstance,
const QString &oldParentProperty,
const ServerNodeInstance &newParentInstance,
const QString &newParentProperty);
protected:
AnchorChangesNodeInstance(QObject *object);
QObject *changesObject() const;
};
} // namespace Internal
} // namespace Valgrind
} // namespace QmlDesigner
#endif // ANALYZER_INTERNAL_MEMCHECKCONFIGWIDGET_H
#endif // QMLDESIGNER_ANCHORCHANGESNODEINSTANCE_H

View File

@@ -51,7 +51,7 @@ BehaviorNodeInstance::Pointer BehaviorNodeInstance::create(QObject *object)
Pointer instance(new BehaviorNodeInstance(behavior));
instance->populateResetValueHash();
instance->populateResetHashes();
behavior->setEnabled(false);

View File

@@ -60,7 +60,7 @@ ComponentNodeInstance::Pointer ComponentNodeInstance::create(QObject *object)
Pointer instance(new ComponentNodeInstance(component));
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}

View File

@@ -16,7 +16,7 @@ HEADERS += $$PWD/qmlpropertychangesnodeinstance.h
HEADERS += $$PWD/qmlstatenodeinstance.h
HEADERS += $$PWD/qmltransitionnodeinstance.h
HEADERS += $$PWD/servernodeinstance.h
HEADERS += $$PWD/anchorchangesnodeinstance.h
SOURCES += $$PWD/behaviornodeinstance.cpp
SOURCES += $$PWD/dummycontextobject.cpp
@@ -32,3 +32,4 @@ SOURCES += $$PWD/qmlpropertychangesnodeinstance.cpp
SOURCES += $$PWD/qmlstatenodeinstance.cpp
SOURCES += $$PWD/qmltransitionnodeinstance.cpp
SOURCES += $$PWD/servernodeinstance.cpp
SOURCES += $$PWD/anchorchangesnodeinstance.cpp

View File

@@ -390,6 +390,9 @@ void ObjectNodeInstance::setPropertyVariant(const QString &name, const QVariant
nodeInstanceServer()->removeFilePropertyFromFileSystemWatcher(object(), name, path);
}
if (hasValidResetBinding(name)) {
QDeclarativePropertyPrivate::setBinding(property, 0, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
}
bool isWritten = property.write(value);
@@ -417,7 +420,7 @@ void ObjectNodeInstance::setPropertyBinding(const QString &name, const QString &
binding->setTarget(property);
binding->setNotifyOnValueChanged(true);
QDeclarativeAbstractBinding *oldBinding = QDeclarativePropertyPrivate::setBinding(property, binding);
if (oldBinding)
if (oldBinding && !hasValidResetBinding(name))
oldBinding->destroy();
binding->update();
if (binding->hasError())
@@ -512,12 +515,17 @@ void ObjectNodeInstance::doResetProperty(const QString &propertyName)
QDeclarativeAbstractBinding *binding = QDeclarativePropertyPrivate::binding(property);
if (binding) {
if (binding && !(hasValidResetBinding(propertyName) && resetBinding(propertyName) == binding)) {
binding->setEnabled(false, 0);
binding->destroy();
}
if (property.isResettable()) {
if (hasValidResetBinding(propertyName)) {
QDeclarativeAbstractBinding *binding = resetBinding(propertyName);
QDeclarativePropertyPrivate::setBinding(property, binding, QDeclarativePropertyPrivate::DontRemoveBinding);
binding->update();
} else if (property.isResettable()) {
property.reset();
} else if (property.propertyTypeCategory() == QDeclarativeProperty::List) {
QDeclarativeListReference list = qvariant_cast<QDeclarativeListReference>(property.read());
@@ -639,7 +647,7 @@ ObjectNodeInstance::Pointer ObjectNodeInstance::create(QObject *object)
{
Pointer instance(new ObjectNodeInstance(object));
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}
@@ -769,24 +777,32 @@ QObject *ObjectNodeInstance::createComponentWrap(const QString &nodeSource, cons
return object;
}
//The component might also be shipped with Creator.
//To avoid trouble with import "." we use the component shipped with Creator.
static inline QString fixComponentPathForIncompatibleQt(const QString &componentPath)
{
QString result = componentPath;
const QLatin1String importString("import");
const QLatin1String importString("/imports/");
if (componentPath.contains(importString)) {
int index = componentPath.indexOf(importString) + 7;
int index = componentPath.indexOf(importString) + 8;
const QString relativeImportPath = componentPath.right(componentPath.length() - index);
QString fixedComponentPath = QLibraryInfo::location(QLibraryInfo::ImportsPath) + relativeImportPath;
fixedComponentPath.replace(QLatin1Char('\\'), QLatin1Char('/'));
if (QFileInfo(fixedComponentPath).exists())
return fixedComponentPath;
QString fixedPath = QFileInfo(fixedComponentPath).path();
if (fixedPath.endsWith(QLatin1String(".1.0"))) {
//plugin directories might contain the version number
fixedPath.chop(4);
fixedPath += QLatin1Char('/') + QFileInfo(componentPath).fileName();
if (QFileInfo(fixedPath).exists())
return fixedPath;
}
}
return result;
}
QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QDeclarativeContext *context)
@@ -951,22 +967,42 @@ QStringList propertyNameForWritableProperties(QObject *object, const QString &ba
return propertyNameList;
}
void ObjectNodeInstance::populateResetValueHash()
void ObjectNodeInstance::populateResetHashes()
{
QStringList propertyNameList = propertyNameForWritableProperties(object());
foreach(const QString &propertyName, propertyNameList) {
QDeclarativeProperty property(object(), propertyName, QDeclarativeEngine::contextForObject(object()));
if (property.isWritable())
QDeclarativeAbstractBinding::Pointer binding = QDeclarativeAbstractBinding::getPointer(QDeclarativePropertyPrivate::binding(property));
if (binding) {
m_resetBindingHash.insert(propertyName, binding);
} else if (property.isWritable()) {
m_resetValueHash.insert(propertyName, property.read());
}
}
}
QDeclarativeAbstractBinding *ObjectNodeInstance::resetBinding(const QString &propertyName) const
{
return m_resetBindingHash.value(propertyName).data();
}
bool ObjectNodeInstance::hasValidResetBinding(const QString &propertyName) const
{
return m_resetBindingHash.contains(propertyName) && m_resetBindingHash.value(propertyName).data();
}
QVariant ObjectNodeInstance::resetValue(const QString &propertyName) const
{
return m_resetValueHash.value(propertyName);
}
void ObjectNodeInstance::setResetValue(const QString &propertyName, const QVariant &value)
{
m_resetValueHash.insert(propertyName, value);
}
void ObjectNodeInstance::paint(QPainter * /*painter*/)
{
}

View File

@@ -46,6 +46,7 @@ class QGraphicsItem;
class QDeclarativeContext;
class QDeclarativeEngine;
class QDeclarativeProperty;
class QDeclarativeAbstractBinding;
QT_END_NAMESPACE
namespace QmlDesigner {
@@ -147,8 +148,11 @@ public:
virtual void activateState();
virtual void deactivateState();
void populateResetValueHash();
void populateResetHashes();
bool hasValidResetBinding(const QString &propertyName) const;
QDeclarativeAbstractBinding *resetBinding(const QString &propertyName) const;
QVariant resetValue(const QString &propertyName) const;
void setResetValue(const QString &propertyName, const QVariant &value);
QObject *object() const;
@@ -185,6 +189,7 @@ protected:
private:
QHash<QString, QVariant> m_resetValueHash;
QHash<QString, QWeakPointer<QDeclarativeAbstractBinding> > m_resetBindingHash;
QHash<QString, ServerNodeInstance> m_modelAbstractPropertyHash;
mutable QHash<QString, bool> m_hasBindingHash;
qint32 m_instanceId;

View File

@@ -46,134 +46,6 @@
namespace QmlDesigner {
namespace Internal {
//QmlPropertyChangesObject::QmlPropertyChangesObject() :
// QDeclarativeStateOperation(),
// m_restoreEntryValues(true),
// m_isExplicit(false)
//{
//}
//QDeclarativeStateOperation::ActionList QmlPropertyChangesObject::actions()
//{
// QMutableListIterator<QDeclarativeAction> actionIterator(m_qmlActionList);
// while (actionIterator.hasNext()) {
// QDeclarativeAction &action = actionIterator.next();
// action.fromBinding = QDeclarativePropertyPrivate::binding(action.property);
// action.fromValue = action.property.read();
// if (m_expressionHash.contains(action.specifiedProperty)) {
// if(m_expressionHash[action.specifiedProperty].second.isNull()) {
// if (targetObject()) {
// QDeclarativeBinding *binding = new QDeclarativeBinding(m_expressionHash[action.specifiedProperty].first, targetObject(), QDeclarativeEngine::contextForObject(targetObject()), this);
// binding->setTarget(action.property);
// binding->setNotifyOnValueChanged(true);
// action.toBinding = binding;
// action.toValue = binding->evaluate();
// m_expressionHash.insert(action.specifiedProperty, ExpressionPair(m_expressionHash[action.specifiedProperty].first, binding));
// } else {
// action.toBinding = 0;
// }
// } else {
// action.toBinding = m_expressionHash[action.specifiedProperty].second.data();
// action.toValue = m_expressionHash[action.specifiedProperty].second->evaluate();
// }
// } else {
// action.toBinding = 0;
// }
// }
// return m_qmlActionList;
//}
//QObject *QmlPropertyChangesObject::targetObject() const
//{
// return m_targetObject.data();
//}
//void QmlPropertyChangesObject::setTargetObject(QObject *object)
//{
// if (m_targetObject.data() == object)
// return;
// QMutableListIterator<QDeclarativeAction> actionIterator(m_qmlActionList);
// while (actionIterator.hasNext()) {
// QDeclarativeAction &qmlAction = actionIterator.next();
// if (m_expressionHash.contains(qmlAction.specifiedProperty) && m_expressionHash[qmlAction.specifiedProperty].second) {
// if (isActive()) {
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, 0, QDeclarativePropertyPrivate::DontRemoveBinding| QDeclarativePropertyPrivate::BypassInterceptor);
// qmlAction.property.write(qmlAction.fromValue);
// m_expressionHash[qmlAction.specifiedProperty].second.data()->destroy();
// }
// qmlAction.toBinding = 0;
// }
// if (isActive() && targetObject()) {
// updateRevertValueAndBinding(qmlAction.specifiedProperty);
// }
// }
// m_targetObject = object;
// actionIterator.toFront();
// while (actionIterator.hasNext()) {
// QDeclarativeAction &qmlAction = actionIterator.next();
// qmlAction.specifiedObject = object;
// qmlAction.property = createMetaProperty(qmlAction.specifiedProperty);
// qmlAction.fromValue = qmlAction.property.read();
// qmlAction.fromBinding = QDeclarativePropertyPrivate::binding(qmlAction.property);
// if (m_expressionHash.contains(qmlAction.specifiedProperty) && targetObject()) {
// QDeclarativeBinding *binding = new QDeclarativeBinding(m_expressionHash[qmlAction.specifiedProperty].first ,targetObject(), QDeclarativeEngine::contextForObject(targetObject()));
// binding->setTarget(qmlAction.property);
// binding->setNotifyOnValueChanged(true);
// qmlAction.toBinding = binding;
// m_expressionHash.insert(qmlAction.specifiedProperty, ExpressionPair(m_expressionHash[qmlAction.specifiedProperty].first, binding));
// if (isActive()) {
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, qmlAction.toBinding, QDeclarativePropertyPrivate::DontRemoveBinding| QDeclarativePropertyPrivate::BypassInterceptor);
// }
// }
// if (isActive() && targetObject()) {
// updateRevertValueAndBinding(qmlAction.specifiedProperty);
// }
// }
//}
//bool QmlPropertyChangesObject::restoreEntryValues() const
//{
// return m_restoreEntryValues;
//}
//void QmlPropertyChangesObject::setRestoreEntryValues(bool restore)
//{
// m_restoreEntryValues = restore;
//}
//bool QmlPropertyChangesObject::isExplicit() const
//{
// return m_isExplicit;
//}
//void QmlPropertyChangesObject::setIsExplicit(bool isExplicit)
//{
// m_isExplicit = isExplicit;
//}
//QDeclarativeProperty QmlPropertyChangesObject::createMetaProperty(const QString &property)
//{
// QDeclarativeProperty prop(m_targetObject.data(), property, QDeclarativeEngine::contextForObject(m_targetObject.data()));
// if (!prop.isValid()) {
// qWarning() << "Cannot assign to non-existent property" << property;
// return QDeclarativeProperty();
// } else if (!prop.isWritable()) {
// qWarning() << "Cannot assign to read-only property" << property;
// return QDeclarativeProperty();
// }
// return prop;
//}
QmlPropertyChangesNodeInstance::QmlPropertyChangesNodeInstance(QDeclarativePropertyChanges *propertyChangesObject) :
ObjectNodeInstance(propertyChangesObject)
{
@@ -187,7 +59,7 @@ QmlPropertyChangesNodeInstance::Pointer QmlPropertyChangesNodeInstance::create(Q
Pointer instance(new QmlPropertyChangesNodeInstance(propertyChange));
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}
@@ -239,409 +111,11 @@ void QmlPropertyChangesNodeInstance::reparent(const ServerNodeInstance &oldParen
changesObject()->attachToState();
}
//QDeclarativeState *QmlPropertyChangesObject::state() const
//{
// if (!parent())
// return 0;
// Q_ASSERT(qobject_cast<QDeclarativeState*>(parent()));
// return static_cast<QDeclarativeState*>(parent());
//}
//QDeclarativeStateGroup *QmlPropertyChangesObject::stateGroup() const
//{
// if (!state())
// return 0;
// return state()->stateGroup();
//}
//QDeclarativeStatePrivate *QmlPropertyChangesObject::statePrivate() const
//{
// if (!parent() || QObjectPrivate::get(parent())->wasDeleted)
// return 0;
// Q_ASSERT(qobject_cast<QDeclarativeState*>(parent()));
// return static_cast<QDeclarativeStatePrivate*>(QObjectPrivate::get(parent()));
//}
QDeclarativePropertyChanges *QmlPropertyChangesNodeInstance::changesObject() const
{
Q_ASSERT(qobject_cast<QDeclarativePropertyChanges*>(object()));
return static_cast<QDeclarativePropertyChanges*>(object());
}
//QDeclarativeAction QmlPropertyChangesObject::createQDeclarativeAction(const QString &propertyName)
//{
// QDeclarativeProperty qmlMetaProperty = createMetaProperty(propertyName);
// QDeclarativeAction qmlAction;
// qmlAction.restore = true;
// qmlAction.property = qmlMetaProperty;
// qmlAction.fromValue = qmlMetaProperty.read();
// qmlAction.fromBinding = QDeclarativePropertyPrivate::binding(qmlMetaProperty);
// qmlAction.specifiedObject = m_targetObject.data();
// qmlAction.specifiedProperty = propertyName;
// qmlAction.event = 0;
// return qmlAction;
//}
//bool QmlPropertyChangesObject::hasActionForProperty(const QString &propertyName) const
//{
// for(ActionList::iterator actionIterator = m_qmlActionList.begin();
// actionIterator != m_qmlActionList.end();
// ++actionIterator) {
// QDeclarativeAction &qmlAction = *actionIterator;
// if (qmlAction.specifiedProperty == propertyName) {
// return true;
// }
// }
// return false;
//}
//QDeclarativeAction &QmlPropertyChangesObject::qmlActionForProperty(const QString &propertyName) const
//{
// for(ActionList::iterator actionIterator = m_qmlActionList.begin();
// actionIterator != m_qmlActionList.end();
// ++actionIterator) {
// QDeclarativeAction &qmlAction = *actionIterator;
// if (qmlAction.specifiedProperty == propertyName)
// return qmlAction;
// }
// Q_ASSERT(false);
// return m_qmlActionList[0];
//}
//void QmlPropertyChangesObject::removeActionForProperty(const QString &propertyName)
//{
// QMutableListIterator<QDeclarativeAction> actionIterator(m_qmlActionList);
// while (actionIterator.hasNext()) {
// QDeclarativeAction &qmlAction = actionIterator.next();
// if (qmlAction.specifiedProperty == propertyName)
// actionIterator.remove();
// }
// if (statePrivate()) {
// QMutableListIterator<QDeclarativeSimpleAction> simpleActionIterator(statePrivate()->revertList);
// while (simpleActionIterator.hasNext()) {
// QDeclarativeSimpleAction &qmlSimpleAction = simpleActionIterator.next();
// if (qmlSimpleAction.specifiedProperty == propertyName && qmlSimpleAction.specifiedObject == targetObject()) {
// simpleActionIterator.remove();
// }
// }
// }
//}
//bool QmlPropertyChangesObject::isActive() const
//{
// if (state() && stateGroup())
// return state()->name() == stateGroup()->state();
// return false;
//}
//QmlPropertyChangesObject::~QmlPropertyChangesObject()
//{
// removeFromStateRevertList();
//}
//void QmlPropertyChangesObject::removeFromStateRevertList()
//{
// if (statePrivate()) {
// QMutableListIterator<QDeclarativeSimpleAction> simpleActionIterator(statePrivate()->revertList);
// while(simpleActionIterator.hasNext()) {
// QDeclarativeSimpleAction &simpleAction = simpleActionIterator.next();
// if (simpleAction.specifiedObject == targetObject()) {
// if (simpleAction.property.isValid()) {
// if (simpleAction.binding) {
// QDeclarativePropertyPrivate::setBinding(simpleAction.property, simpleAction.binding);
// } else if (simpleAction.value.isValid()) {
// QDeclarativePropertyPrivate::setBinding(simpleAction.property, 0);
// simpleAction.property.write(simpleAction.value);
// }
// }
// simpleActionIterator.remove();
// }
// }
// }
//}
//void QmlPropertyChangesObject::addToStateRevertList()
//{
// if (isActive() && statePrivate()) {
// QListIterator<QDeclarativeAction> actionIterator(m_qmlActionList);
// while (actionIterator.hasNext()) {
// const QDeclarativeAction &qmlAction = actionIterator.next();
// QDeclarativeSimpleAction simpleAction(qmlAction);
// simpleAction.binding = qmlAction.fromBinding;
// simpleAction.value = qmlAction.fromValue;
// statePrivate()->revertList.append(simpleAction);
// if (qmlAction.toBinding)
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, qmlAction.toBinding);
// else
// qmlAction.property.write(qmlAction.toValue);
// }
// }
//}
//void QmlPropertyChangesObject::updateRevertValueAndBinding(const QString &name)
//{
// if (isActive() && statePrivate()) {
// typedef QList<QDeclarativeSimpleAction> SimpleActionList;
// if (!statePrivate()->revertList.isEmpty()) {
// for(SimpleActionList::iterator actionIterator = statePrivate()->revertList.begin();
// actionIterator != statePrivate()->revertList.end();
// ++actionIterator) {
// //simple action defines values and bindings to revert current state
// QDeclarativeSimpleAction &simpleAction = *actionIterator;
// if (simpleAction.specifiedObject == targetObject()
// && simpleAction.specifiedProperty == name) {
// const QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// simpleAction.value = qmlAction.fromValue;
// simpleAction.binding = qmlAction.fromBinding;
// simpleAction.specifiedObject = qmlAction.specifiedObject;
// simpleAction.specifiedProperty = qmlAction.specifiedProperty;
// simpleAction.property = qmlAction.property;
// return; //return since we just had to update exisisting simple action
// }
// }
// }
// //simple action does not exist, yet
// const QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// QDeclarativeSimpleAction simpleAction(qmlAction);
// simpleAction.binding = qmlAction.fromBinding;
// simpleAction.value = qmlAction.fromValue;
// statePrivate()->revertList.append(simpleAction);
// }
//}
//void QmlPropertyChangesObject::setVariantValue(const QString &name, const QVariant & value)
//{
// if (!hasActionForProperty(name)) {
// m_qmlActionList.append(createQDeclarativeAction(name));
// }
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (qmlAction.fromBinding)
// qmlAction.fromBinding->setEnabled(false, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
// qmlAction.toValue = value;
//}
//void QmlPropertyChangesObject::setExpression(const QString &name, const QString &expression)
//{
// if (!hasActionForProperty(name)) {
// m_qmlActionList.append(createQDeclarativeAction(name));
// }
// QDeclarativeContext *context = QDeclarativeEngine::contextForObject(targetObject());
// QDeclarativeBinding *binding = 0;
// QDeclarativeProperty metaProperty(targetObject(), name, context);
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (m_expressionHash.contains(name) && m_expressionHash[name].second) {
// if (QDeclarativePropertyPrivate::binding(metaProperty) == m_expressionHash[name].second.data())
// QDeclarativePropertyPrivate::setBinding(metaProperty, 0, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
// m_expressionHash.take(name).second->destroy();
// qmlAction.toBinding = 0;
// }
// if (metaProperty.isValid() && metaProperty.isProperty()) {
// binding = new QDeclarativeBinding(expression, targetObject(), context, this);
// binding->setTarget(metaProperty);
// binding->setNotifyOnValueChanged(true);
// qmlAction.toBinding = binding;
// m_expressionHash.insert(name, ExpressionPair(expression, binding));
// } else {
// m_expressionHash.insert(name, ExpressionPair(expression, static_cast<QDeclarativeBinding*>(0)));
// }
// updateRevertValueAndBinding(name);
// if (isActive() && binding)
// QDeclarativePropertyPrivate::setBinding(metaProperty, binding, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
//}
//void QmlPropertyChangesObject::removeVariantValue(const QString &name)
//{
// if (hasActionForProperty(name)) {
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (hasExpression(name)) {
// qmlAction.toValue = QVariant();
// updateRevertValueAndBinding(name);
// } else {
// if (qmlAction.fromBinding)
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, qmlAction.fromBinding);
// else
// qmlAction.property.write(qmlAction.fromValue);
// removeActionForProperty(name);
// }
// }
//}
//void QmlPropertyChangesObject::removeExpression(const QString &name)
//{
// if (hasActionForProperty(name)) {
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (hasVariantValue(name)) {
// ExpressionPair expr = m_expressionHash.take(name);
// if (expr.second)
// expr.second.data()->destroy();
// qmlAction.toBinding = 0;
// updateRevertValueAndBinding(name);
// qmlAction.property.write(qmlAction.toValue);
// } else {
// if (qmlAction.fromBinding)
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, qmlAction.fromBinding);
// else
// qmlAction.property.write(qmlAction.fromValue);
// removeActionForProperty(name);
// }
// }
//}
//void QmlPropertyChangesObject::resetProperty(const QString &name)
//{
// if (statePrivate()) {
// QMutableListIterator<QDeclarativeSimpleAction> simpleActionIterator(statePrivate()->revertList);
// while (simpleActionIterator.hasNext()) {
// QDeclarativeSimpleAction &qmlSimpleAction = simpleActionIterator.next();
// if (qmlSimpleAction.specifiedProperty == name && qmlSimpleAction.specifiedObject == targetObject()) {
// if (qmlSimpleAction.binding) {
// qDebug() << qmlSimpleAction.binding->expression();
// QDeclarativePropertyPrivate::setBinding(qmlSimpleAction.property, qmlSimpleAction.binding);
// } else {
// QDeclarativePropertyPrivate::setBinding(qmlSimpleAction.property, 0);
// qmlSimpleAction.property.write(qmlSimpleAction.value);
// }
// }
// }
// }
// if (m_expressionHash.contains(name)) {
// if (m_expressionHash[name].second) {
// QDeclarativeProperty metaProperty(targetObject(), name, QDeclarativeEngine::contextForObject(targetObject()));
// if (metaProperty.isValid() && QDeclarativePropertyPrivate::binding(metaProperty) == m_expressionHash[name].second.data())
// QDeclarativePropertyPrivate::setBinding(metaProperty, 0, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
// m_expressionHash[name].second.data()->destroy();
// }
// m_expressionHash.remove(name);
// }
// if (hasActionForProperty(name)) {
// removeActionForProperty(name);
// }
//}
//QVariant QmlPropertyChangesObject::variantValue(const QString &name) const
//{
// if (hasActionForProperty(name)) {
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// return qmlAction.toValue;
// }
// return QVariant();
//}
//QString QmlPropertyChangesObject::expression(const QString &name) const
//{
// if (hasActionForProperty(name)) {
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (qmlAction.toBinding)
// return qmlAction.toBinding->expression();
// }
// return QString();
//}
//bool QmlPropertyChangesObject::hasVariantValue(const QString &name) const
//{
// if (hasActionForProperty(name))
// return qmlActionForProperty(name).toValue.isValid();
// return false;
//}
//bool QmlPropertyChangesObject::hasExpression(const QString &name) const
//{
// return m_expressionHash.contains(name);
//}
//bool QmlPropertyChangesObject::updateStateVariant(const QString &name, const QVariant &value)
//{
// if (hasActionForProperty(name)) {
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (qmlAction.fromValue.isValid()) {
// qmlAction.fromValue = value;
// updateRevertValueAndBinding(name);
// return true;
// }
// }
// return false;
//}
//bool QmlPropertyChangesObject::updateStateBinding(const QString &name, const QString &expression)
//{
// if (hasActionForProperty(name)) {
// QDeclarativeContext *context = QDeclarativeEngine::contextForObject(targetObject());
// QDeclarativeProperty metaProperty(targetObject(), name, context);
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (qmlAction.fromBinding) {
// if (QDeclarativePropertyPrivate::binding(qmlAction.property) == qmlAction.fromBinding)
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, 0);
// qmlAction.fromBinding->destroy();
// }
// QDeclarativeBinding *binding = new QDeclarativeBinding(expression, targetObject(), context, this);
// binding->setTarget(metaProperty);
// binding->setNotifyOnValueChanged(true);
// qmlAction.fromBinding = binding;
// if (m_expressionHash.contains(name))
// QDeclarativePropertyPrivate::setBinding(qmlAction.property, binding);
// updateRevertValueAndBinding(name);
// return true;
// }
// return false;
//}
//bool QmlPropertyChangesObject::resetStateProperty(const QString &name, const QVariant &resetValue)
//{
// if (hasActionForProperty(name)) {
// QDeclarativeContext *context = QDeclarativeEngine::contextForObject(targetObject());
// QDeclarativeProperty metaProperty(targetObject(), name, context);
// QDeclarativeAction &qmlAction = qmlActionForProperty(name);
// if (m_expressionHash.contains(name) && m_expressionHash[name].second) {
// m_expressionHash[name].second.data()->destroy();
// qmlAction.toBinding = 0;
// }
// qmlAction.fromValue = resetValue;
// updateRevertValueAndBinding(name);
// removeActionForProperty(name);
// return true;
// }
// return false;
//}
} // namespace Internal
} // namespace QmlDesigner

View File

@@ -50,77 +50,6 @@ namespace Internal {
class QmlPropertyChangesNodeInstance;
// Original QmlPropertyChanges class requires a custom parser
// work around this by writing a replacement class
//class QmlPropertyChangesObject : public QDeclarativeStateOperation
//{
// Q_OBJECT
// Q_PROPERTY(QObject *target READ targetObject WRITE setTargetObject)
// Q_PROPERTY(bool restoreEntryValues READ restoreEntryValues WRITE setRestoreEntryValues)
// Q_PROPERTY(bool explicit READ isExplicit WRITE setIsExplicit)
// typedef QPair<QString, QWeakPointer<QDeclarativeBinding> > ExpressionPair;
//public:
// ~QmlPropertyChangesObject();
// QObject *targetObject() const;
// void setTargetObject(QObject *object);
// bool restoreEntryValues() const;
// void setRestoreEntryValues(bool restore);
// bool isExplicit() const;
// void setIsExplicit(bool isExplicit);
// virtual ActionList actions();
// void setVariantValue(const QString &name, const QVariant & value);
// void setExpression(const QString &name, const QString &expression);
// void removeVariantValue(const QString &name);
// void removeExpression(const QString &name);
// void resetProperty(const QString &name);
// QVariant variantValue(const QString &name) const;
// QString expression(const QString &name) const;
// bool hasVariantValue(const QString &name) const;
// bool hasExpression(const QString &name) const;
// QmlPropertyChangesObject();
// bool updateStateVariant(const QString &propertyName, const QVariant &value);
// bool updateStateBinding(const QString &propertyName, const QString &expression);
// bool resetStateProperty(const QString &propertyName, const QVariant &resetValue);
// QDeclarativeState *state() const;
// void updateRevertValueAndBinding(const QString &name);
// void removeFromStateRevertList();
// void addToStateRevertList();
//private: // functions
// bool isActive() const;
// QDeclarativeStatePrivate *statePrivate() const;
// QDeclarativeStateGroup *stateGroup() const;
// QDeclarativeProperty createMetaProperty(const QString &property);
// QDeclarativeAction &qmlActionForProperty(const QString &propertyName) const;
// bool hasActionForProperty(const QString &propertyName) const;
// void removeActionForProperty(const QString &propertyName);
// QDeclarativeAction createQDeclarativeAction(const QString &propertyName);
//private: // variables
// QWeakPointer<QObject> m_targetObject;
// bool m_restoreEntryValues;
// bool m_isExplicit;
// mutable ActionList m_qmlActionList;
// QHash<QString, ExpressionPair> m_expressionHash;
//};
class QmlPropertyChangesNodeInstance : public ObjectNodeInstance
{
public:

View File

@@ -60,7 +60,7 @@ QmlStateNodeInstance::Pointer
Pointer instance(new QmlStateNodeInstance(stateObject));
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}

View File

@@ -49,7 +49,7 @@ QmlTransitionNodeInstance::Pointer QmlTransitionNodeInstance::create(QObject *ob
Pointer instance(new QmlTransitionNodeInstance(transition));
instance->populateResetValueHash();
instance->populateResetHashes();
transition->setToState("invalidState");
transition->setFromState("invalidState");

View File

@@ -38,6 +38,7 @@
#include "qmlpropertychangesnodeinstance.h"
#include "behaviornodeinstance.h"
#include "qmlstatenodeinstance.h"
#include "anchorchangesnodeinstance.h"
#if QT_VERSION >= 0x050000
#include "sgitemnodeinstance.h"
@@ -185,6 +186,8 @@ Internal::ObjectNodeInstance::Pointer ServerNodeInstance::createInstance(QObject
#endif
else if (isSubclassOf(objectToBeWrapped, "QDeclarativeComponent"))
instance = Internal::ComponentNodeInstance::create(objectToBeWrapped);
else if (objectToBeWrapped->inherits("QDeclarativeAnchorChanges"))
instance = Internal::AnchorChangesNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QDeclarativePropertyChanges"))
instance = Internal::QmlPropertyChangesNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QDeclarativeState"))

View File

@@ -45,6 +45,7 @@ GraphicsObjectNodeInstance::GraphicsObjectNodeInstance(QGraphicsObject *graphics
: ObjectNodeInstance(graphicsObject),
m_isMovable(true)
{
QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification = 1;
}
QGraphicsObject *GraphicsObjectNodeInstance::graphicsObject() const
@@ -179,6 +180,11 @@ QObject *GraphicsObjectNodeInstance::parent() const
return graphicsObject()->parentItem()->toGraphicsObject();
}
static inline bool isRectangleSane(const QRectF &rect)
{
return rect.isValid() && (rect.width() < 10000) && (rect.height() < 10000);
}
QRectF GraphicsObjectNodeInstance::boundingRectWithStepChilds(QGraphicsItem *parentItem) const
{
QRectF boundingRect = parentItem->boundingRect();
@@ -187,6 +193,7 @@ QRectF GraphicsObjectNodeInstance::boundingRectWithStepChilds(QGraphicsItem *par
QGraphicsObject *childObject = childItem->toGraphicsObject();
if (!(childObject && nodeInstanceServer()->hasInstanceForObject(childObject))) {
QRectF transformedRect = childItem->mapRectToParent(boundingRectWithStepChilds(childItem));
if (isRectangleSane(transformedRect))
boundingRect = boundingRect.united(transformedRect);
}
}

View File

@@ -80,7 +80,7 @@ PositionerNodeInstance::Pointer PositionerNodeInstance::create(QObject *object)
static_cast<QDeclarativeParserStatus*>(positioner)->classBegin();
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}

View File

@@ -92,7 +92,7 @@ QmlGraphicsItemNodeInstance::Pointer QmlGraphicsItemNodeInstance::create(QObject
static_cast<QDeclarativeParserStatus*>(qmlGraphicsItem)->classBegin();
instance->populateResetValueHash();
instance->populateResetHashes();
return instance;
}
@@ -207,13 +207,26 @@ void QmlGraphicsItemNodeInstance::refresh()
repositioning(qmlGraphicsItem());
}
void QmlGraphicsItemNodeInstance::recursiveDoComponentComplete(QDeclarativeItem *declarativeItem)
{
if (declarativeItem) {
if (QDeclarativeItemPrivate::get(declarativeItem)->componentComplete)
return;
static_cast<QDeclarativeParserStatus*>(declarativeItem)->componentComplete();
foreach (QGraphicsItem *childItem, declarativeItem->childItems()) {
QGraphicsObject *childGraphicsObject = childItem->toGraphicsObject();
QDeclarativeItem *childDeclarativeItem = qobject_cast<QDeclarativeItem*>(childGraphicsObject);
if (childDeclarativeItem && !nodeInstanceServer()->hasInstanceForObject(childDeclarativeItem))
recursiveDoComponentComplete(childDeclarativeItem);
}
}
}
void QmlGraphicsItemNodeInstance::doComponentComplete()
{
if (qmlGraphicsItem()) {
if (static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(qmlGraphicsItem()))->componentComplete)
return;
static_cast<QDeclarativeParserStatus*>(qmlGraphicsItem())->componentComplete();
QGraphicsItemPrivate::get(qmlGraphicsItem())->sendParentChangeNotification = 1;
recursiveDoComponentComplete(qmlGraphicsItem());
}
graphicsObject()->update();
@@ -241,6 +254,26 @@ int QmlGraphicsItemNodeInstance::penWidth() const
return GraphicsObjectNodeInstance::penWidth();
}
void QmlGraphicsItemNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance)
{
GraphicsObjectNodeInstance::initialize(objectNodeInstance);
if (objectNodeInstance->instanceId() == 0 && objectNodeInstance->isQmlGraphicsItem()) { // is root item
objectNodeInstance.staticCast<QmlGraphicsItemNodeInstance>()->setVisible(true);
objectNodeInstance->setResetValue("visible", true);
}
}
void QmlGraphicsItemNodeInstance::setVisible(bool isVisible)
{
qmlGraphicsItem()->setVisible(isVisible);
}
bool QmlGraphicsItemNodeInstance::isVisible() const
{
return qmlGraphicsItem()->isVisible();
}
void QmlGraphicsItemNodeInstance::resetProperty(const QString &name)
{
if (name == "height") {
@@ -301,7 +334,10 @@ void QmlGraphicsItemNodeInstance::reparent(const ObjectNodeInstance::Pointer &ol
setMovable(true);
}
bool componentComplete = QDeclarativeItemPrivate::get(qmlGraphicsItem())->componentComplete;
QDeclarativeItemPrivate::get(qmlGraphicsItem())->componentComplete = 1;
GraphicsObjectNodeInstance::reparent(oldParentInstance, oldParentProperty, newParentInstance, newParentProperty);
QDeclarativeItemPrivate::get(qmlGraphicsItem())->componentComplete = componentComplete;
if (newParentInstance && newParentInstance->isPositioner()) {
setInPositioner(true);

View File

@@ -75,6 +75,10 @@ public:
bool isResizable() const;
void setResizable(bool resizeable);
void setVisible(bool isVisible);
bool isVisible() const;
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance);
QList<ServerNodeInstance> stateInstances() const;
@@ -85,6 +89,7 @@ protected:
void resetHorizontal();
void resetVertical();
void refresh();
void recursiveDoComponentComplete(QDeclarativeItem *declarativeItem);
private: //variables
bool m_hasHeight;

View File

@@ -164,14 +164,14 @@ void Qt4InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
if (!informationChangedInstanceSet.isEmpty())
nodeInstanceClient()->informationChanged(createAllInformationChangedCommand(informationChangedInstanceSet.toList()));
if (!propertyChangedList.isEmpty())
nodeInstanceClient()->valuesChanged(createValuesChangedCommand(propertyChangedList));
if (!m_parentChangedSet.isEmpty()) {
sendChildrenChangedCommand(m_parentChangedSet.toList());
m_parentChangedSet.clear();
}
if (!propertyChangedList.isEmpty())
nodeInstanceClient()->valuesChanged(createValuesChangedCommand(propertyChangedList));
if (adjustSceneRect) {
QRectF boundingRect = rootNodeInstance().boundingRect();
if (boundingRect.isValid()) {

View File

@@ -187,5 +187,13 @@ void Qt4RenderNodeInstanceServer::completeComponent(const CompleteComponentComma
nodeInstanceClient()->pixmapChanged(createPixmapChangedCommand(instanceList));
}
void Qt4RenderNodeInstanceServer::changeState(const ChangeStateCommand &command)
{
Qt4NodeInstanceServer::changeState(command);
foreach (QGraphicsItem *item, declarativeView()->items()) {
item->update();
QGraphicsItemPrivate::get(item)->notifyBoundingRectChanged = 1;
}
}
} // namespace QmlDesigner

View File

@@ -46,6 +46,7 @@ public:
void createScene(const CreateSceneCommand &command);
void clearScene(const ClearSceneCommand &command);
void completeComponent(const CompleteComponentCommand &command);
void changeState(const ChangeStateCommand &command);
protected:
void collectItemChangesAndSendChangeCommands();

View File

@@ -34,6 +34,9 @@
#include <QApplication>
#include <QStringList>
#ifdef QT_SIMULATOR
#include <QtGui/private/qsimulatorconnection_p.h>
#endif
#include <qt4nodeinstanceclientproxy.h>
@@ -47,6 +50,10 @@
int main(int argc, char *argv[])
{
#ifdef QT_SIMULATOR
QtSimulatorPrivate::SimulatorConnection::createStubInstance();
#endif
QApplication application(argc, argv);
if (application.arguments().count() != 4)

View File

@@ -17,7 +17,7 @@ RESOURCES += $$PWD/../qmlpuppet.qrc
OTHER_FILES += Info.plist.in
macx {
info.input = Info.plist.in
info.input = $$PWD/Info.plist.in
info.output = $$DESTDIR/$${TARGET}.app/Contents/Info.plist
QMAKE_SUBSTITUTES += info
} else {

View File

@@ -176,6 +176,7 @@ QExtGroupBox {
spacing: 6
LineEdit {
inputMask: "\\#HHHHHH"
visible: gradientEditing == false
backendValue: colorGroupBox.backendColor
baseStateFlag: isBaseState

View File

@@ -46,6 +46,7 @@ QWidget { //This is a special doubleSpinBox that does color coding for states
property alias text: label.text
property bool alignRight: true
property bool enabled: true
property alias decimals: box.decimals
minimumHeight: 22;

View File

@@ -52,6 +52,7 @@ QWidget {
id: label
text: caption
toolTip: caption
visible: caption != ""
}
SpinBox {

View File

@@ -43,9 +43,8 @@ GroupBox {
property bool isInBaseState: isBaseState
property variant targetLabelWidth: 90 - 20 - 26
property int leftMarginMargin: 16
property variant targetLabelWidth: 60
property int leftMarginMargin: 16 + 10 + 10
layout: VerticalLayout {
Label {
text: qsTr("Anchors")
@@ -91,17 +90,20 @@ GroupBox {
selectedItemNode: anchorBackend.topTarget
onSelectedItemNodeChanged: { anchorBackend.topTarget = selectedItemNode; }
}
}
}
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
id:topbox
slider: false
caption: qsTr("Margin")
caption: ""
backendValue: backendValues.anchors_topMargin
baseStateFlag: isInBaseState;
maximumValue: 999
@@ -149,9 +151,13 @@ GroupBox {
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
slider: false
caption: qsTr("Margin")
caption: ""
backendValue: backendValues.anchors_bottomMargin
baseStateFlag: isInBaseState;
maximumValue: 999
@@ -198,9 +204,13 @@ GroupBox {
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
slider: false
caption: qsTr("Margin")
caption: ""
backendValue: backendValues.anchors_leftMargin
baseStateFlag: isInBaseState;
maximumValue: 999
@@ -247,9 +257,13 @@ GroupBox {
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
slider: false
caption: qsTr("Margin")
caption: ""
backendValue: backendValues.anchors_rightMargin
baseStateFlag: isInBaseState;
maximumValue: 999
@@ -296,9 +310,13 @@ GroupBox {
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
slider: false
caption: qsTr("Margin")
caption: ""
baseStateFlag: isInBaseState;
backendValue: backendValues.anchors_horizontalCenterOffset
maximumValue: 999
@@ -345,9 +363,13 @@ GroupBox {
QWidget {
layout : HorizontalLayout {
leftMargin: leftMarginMargin
Label {
text: qsTr("Margin")
fixedWidth: targetLabelWidth
}
IntEditor {
slider: false
caption: qsTr("Margin")
caption: ""
backendValue: backendValues.anchors_verticalCenterOffset
baseStateFlag: isInBaseState;
maximumValue: 999

View File

@@ -42,6 +42,7 @@ QWidget {
property alias text: lineEditWidget.text
property alias readOnly: lineEditWidget.readOnly
property alias translation: trCheckbox.visible
property alias inputMask: lineEditWidget.inputMask
minimumHeight: 24;

View File

@@ -56,39 +56,6 @@ QWidget {
minimumValue: 0;
maximumValue: 1000;
}
IntEditor {
backendValue: backendValues.cellHeight
caption: qsTr("Cell height")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 200;
}
IntEditor {
backendValue: backendValues.cellWidth
caption: qsTr("Cell width")
baseStateFlag: isBaseState;
step: 1;
minimumValue: 0;
maximumValue: 1000;
}
QWidget {
layout: HorizontalLayout {
Label {
text: qsTr("Flow")
}
ComboBox {
baseStateFlag: isBaseState
items : { ["LeftToRight", "TopToBottom"] }
currentText: backendValues.flow.value;
onItemsChanged: {
currentText = backendValues.flow.value;
}
backendValue: backendValues.flow
}
}
} //QWidget
IntEditor {
backendValue: backendValues.keyNavigationWraps
caption: qsTr("Navigation wraps")
@@ -127,11 +94,11 @@ QWidget {
ComboBox {
baseStateFlag: isBaseState
items : { ["Horizontal", "Vertical"] }
currentText: backendValues.snapMode.value;
currentText: backendValues.orientation.value;
onItemsChanged: {
currentText = backendValues.snapMode.value;
currentText = backendValues.orientation.value;
}
backendValue: backendValues.snapMode
backendValue: backendValues.orientation
}
}
} //QWidget
@@ -144,7 +111,7 @@ QWidget {
ComboBox {
baseStateFlag: isBaseState
items : { ["NoSnap", "SnapToRow", "SnapOneRow"] }
items : { ["NoSnap", "SnapToItem", "SnapOneItem"] }
currentText: backendValues.snapMode.value;
onItemsChanged: {
currentText = backendValues.snapMode.value;

View File

@@ -87,6 +87,7 @@ GroupBox {
DoubleSpinBox {
text: ""
decimals: 2
id: opacitySpinBox;
backendValue: backendValues.opacity
property variant backendValueValue: backendValues.opacity.value;

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>Featured</title>
<link>http://qt.nokia.com/</link>
<description>Offline content of featured articles</description>
<lastBuildDate>Fri, 17 Sep 2010 10:30:00 GMT</lastBuildDate>
<language>en-us</language>
<item>
<title>How to create a Qt Quick application</title>
<category>Tutorial</category>
<link>qthelp://com.nokia.qtcreator/doc/creator-qml-application.html</link>
<guid>qthelp://com.nokia.qtcreator/doc/creator-qml-application.html</guid>
<pubDate>Mon, 12 Sep 2005 18:37:00 GMT</pubDate>
<description><![CDATA[ This tutorial describes how to use the Qt Creator to implement the states and transitions example application. ]]></description>
<image>
<link>images/qtquick.png</link>
</image>
</item>
</channel>
</rss>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -183,7 +183,7 @@ void Html5ApplicationViewer::setOrientation(ScreenOrientation orientation)
void Html5ApplicationViewer::showExpanded()
{
#ifdef Q_OS_SYMBIAN
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();

View File

@@ -59,7 +59,7 @@ void MainWindow::setOrientation(ScreenOrientation orientation)
void MainWindow::showExpanded()
{
#ifdef Q_OS_SYMBIAN
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();

View File

@@ -146,7 +146,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
void QmlApplicationViewer::showExpanded()
{
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN)
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();

View File

@@ -55,11 +55,12 @@ symbian {
desktopfile.path = /usr/share/applications/hildon
icon.files = $${TARGET}64.png
icon.path = /usr/share/icons/hicolor/64x64/apps
} else {
} else:!isEmpty(MEEGO_VERSION_MAJOR) {
desktopfile.files = $${TARGET}_harmattan.desktop
desktopfile.path = /usr/share/applications
icon.files = $${TARGET}80.png
icon.path = /usr/share/icons/hicolor/80x80/apps
} else { # Assumed to be a Desktop Unix
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
@@ -98,13 +99,18 @@ symbian {
export($$itempath)
INSTALLS += $$item
}
target.path = $${installPrefix}/bin
!isEmpty(desktopfile.path) {
export(icon.files)
export(icon.path)
export(desktopfile.files)
export(desktopfile.path)
INSTALLS += icon desktopfile
}
target.path = $${installPrefix}/bin
export(target.path)
INSTALLS += desktopfile icon target
INSTALLS += target
}
export (ICON)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
import QtQuick 1.0
import "../"

View File

@@ -1,43 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
**************************************************************************/
//![code]
#include "qdeclarativefolderlistmodel.h"

View File

@@ -1,43 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
**************************************************************************/
#ifndef QDECLARATIVEFOLDERLISTMODEL_H
#define QDECLARATIVEFOLDERLISTMODEL_H

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
/*!
\class QRangeModel

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
#ifndef QRANGEMODEL_H
#define QRANGEMODEL_H

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
#ifndef QRANGEMODEL_P_H
#define QRANGEMODEL_P_H

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
#include "qtmenu.h"
#include "qdebug.h"

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
#ifndef QTMLMENU_H
#define QTMLMENU_H

View File

@@ -1,28 +1,34 @@
/****************************************************************************
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (info@qt.nokia.com)
**
** This file is part of the Qt Components project on Qt Labs.
**
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions contained
** in the Technology Preview License Agreement accompanying this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this file.
** Please review the following information to ensure the GNU Lesser General
** Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** Other Usage
**
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
** If you have questions regarding the use of this file, please contact
** Nokia at info@qt.nokia.com.
**
****************************************************************************/
**************************************************************************/
#ifndef QWHEELAREA_H
#define QWHEELAREA_H

View File

@@ -36,21 +36,33 @@ import components 1.0 as Components
Item {
id: root
property int margin: 10
Components.ScrollArea {
id: scrollArea
anchors.fill: parent
frame: false
Item {
height: Math.max(recentSessions.height, recentProjects.height)
width: root.width-20
height: Math.max(recentSessions.height + manageSessionsButton.height + margin,
recentProjects.height)
width: root.width
Widgets.RecentSessions {
id: recentSessions
width: parent.width / 2
width: parent.width / 3 - margin
}
Widgets.Button {
id: manageSessionsButton
anchors.top: recentSessions.bottom
anchors.topMargin: margin
anchors.left: recentSessions.left
text: qsTr("Manage Sessions...")
onClicked: projectWelcomePage.manageSessions()
}
Widgets.RecentProjects {
id: recentProjects
x: parent.width / 2
width: parent.width / 2
x: parent.width / 3 + margin
width: parent.width - x
}
}
}

View File

@@ -404,10 +404,12 @@
<tags>example,recentfiles,mainwindows</tags>
</example>
<example imageUrl="qthelp://com.trolltech.qt/qdoc/images/qml-dialcontrol-example.png" difficulty="?" docUrl="qthelp://com.trolltech.qt/qdoc/declarative-ui-components-dialcontrol.html" projectPath="declarative/ui-components/dialcontrol/dialcontrol.qmlproject" name="Dial">
<fileToOpen>declarative/ui-components/dialcontrol/dialcontrol.qml</fileToOpen>
<description><![CDATA[This example shows how to create a dial-type control. It combines <tt>Image</tt> elements with <tt>Rotation</tt> transforms and <tt>SpringAnimation</tt> behaviors to produce an interactive speedometer-type dial.]]></description>
<tags>example,dialcontrol,declarative,ui-components,qml,qt quick,image,rotation,springanimation</tags>
</example>
<example imageUrl="qthelp://com.trolltech.qt/qdoc/images/qml-flipable-example.png" difficulty="?" docUrl="qthelp://com.trolltech.qt/qdoc/declarative-ui-components-flipable.html" projectPath="declarative/ui-components/flipable/flipable.qmlproject" name="Flipable">
<fileToOpen>declarative/ui-components/flipable/flipable.qml</fileToOpen>
<description><![CDATA[This example shows how to use the <tt>Flipable</tt> element.]]></description>
<tags>example,flipable,declarative,ui-components,qml,qt quick,flipable</tags>
</example>

View File

@@ -8,6 +8,7 @@ OTHER_FILES = develop.qml \
newssupport.qml \
welcomescreen.qml \
widgets/Button.qml \
widgets/CheckBox.qml \
widgets/Feedback.qml \
widgets/RatingBar.qml \
widgets/ExampleBrowser.qml \

View File

@@ -33,75 +33,86 @@
import QtQuick 1.0
import "widgets"
Image {
Rectangle {
id: root
source: "qrc:welcome/images/welcomebg.png"
smooth: true
color: "#F2F2F2"
// work around the fact that we can't use
// a property alias to welcomeMode.activePlugin
property int current: 0
onCurrentChanged: welcomeMode.activePlugin = current
Component.onCompleted: current = welcomeMode.activePlugin
BorderImage {
id: inner_background
Image {
id: header;
source: "qrc:welcome/images/center_frame_header.png";
anchors.verticalCenter: parent.verticalCenter;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.topMargin: 2
}
anchors.top: root.top
source: "qrc:welcome/images/background_center_frame_v2.png"
width: parent.width
height: 60
border.right: 2
border.left: 2
border.top: 2
border.bottom: 10
}
LinksBar {
id: navigationAndDevLinks
property alias current: root.current
anchors.top: inner_background.bottom
Item {
anchors.top: parent.top
anchors.left: parent.left
anchors.bottomMargin: 4
anchors.topMargin: -2
width: parent.width
model: tabs.model
tabBarWidth: width
}
BorderImage {
id: news
opacity: 0.7
source: "qrc:welcome/images/rc_combined.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
anchors.top: navigationAndDevLinks.bottom
anchors.right: parent.right
anchors.bottom: feedback.top
anchors.margins: 10
Item {
id: news
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.margins: 5
anchors.rightMargin: 5
width: 270
Rectangle {
anchors.fill: parent
border.color: "#36295B7F"
border.width: 1
color: "#B3FFFFFF"
}
FeaturedAndNewsListing {
anchors.fill: parent
anchors.margins: 4
anchors.margins: 8
}
}
Image {
id: tabFrame
source: "qrc:welcome/images/welcomebg.png"
smooth: true
Rectangle {
anchors.fill: parent
border.color: "#36295B7F"
border.width: 1
color: "#20FFFFFF"
}
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: news.right
anchors.right: parent.right
anchors.leftMargin: 5
LinksBar {
id: linksBar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
property alias current: root.current
model: tabs.model
}
Rectangle {
anchors.fill: linksBar
anchors.bottomMargin: 1
opacity: 1
border.color: "#4D295B7F"
border.width: 1
color: "#00000000"
}
TabWidget {
id: tabs
property int current: root.current
model: pagesModel
anchors.top: navigationAndDevLinks.bottom
anchors.bottom: feedback.top
anchors.left: news.right
anchors.top: linksBar.bottom
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 0
anchors.margins: 4
anchors.margins: 10
}
}
}
Feedback {

View File

@@ -31,47 +31,50 @@
**************************************************************************/
import Qt 4.7
import "../components/custom" as Custom
BorderImage {
property string text
property string image
property int iconSize : innerImg.sourceSize.height
signal clicked;
id: root
source: "qrc:/welcome/images/btn_26.png"
height: innerImg.height + 16
Custom.Button {
id: button
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
width: Math.max(100, labelItem.contentsWidth+20)
height: 32
background: BorderImage {
source: {
if (pressed)
return "qrc:/welcome/images/btn_26_pressed.png"
else
if (containsMouse)
return "qrc:/welcome/images/btn_26_hover.png"
else
return "qrc:/welcome/images/btn_26.png"
}
border { left: 5; right: 5; top: 5; bottom: 5 }
}
label: Item {
property int contentsWidth : row.width
Row {
id: row
spacing: 4
anchors.centerIn: parent
property int contentsWidth : row.width
Image {
id: innerImg
height: root.iconSize
width: root.iconSize
anchors.verticalCenter: label.verticalCenter
anchors.right: label.left
anchors.rightMargin: 4
visible: root.image != ""
source: root.image
id: image
source: iconSource
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.Stretch //mm Image should shrink if button is too small, depends on QTBUG-14957
}
Text {
id: label;
anchors.left: innerImg.right
anchors.right: parent.right
text: root.text
id:text
color: textColor
anchors.verticalCenter: parent.verticalCenter
text: button.text
horizontalAlignment: Text.Center
}
}
}
MouseArea { id: mouseArea; anchors.fill: parent; hoverEnabled: true; onClicked: root.clicked() }
states: [
State {
id: pressedState; when: mouseArea.pressed;
PropertyChanges { target: root; source: "qrc:/welcome/images/btn_26_pressed.png" }
},
State {
id: hoverState; when: mouseArea.containsMouse
PropertyChanges { target: root; source: "qrc:/welcome/images/btn_26_hover.png" }
}
]
Keys.onSpacePressed:clicked()
}

View File

@@ -0,0 +1,39 @@
import QtQuick 1.0
import "../components/custom" as Custom
Custom.CheckBox{
id:checkbox
property string text
property string hint
height:20
width: Math.max(110, backgroundItem.rowWidth)
background: Item {
property int rowWidth: row.width
Row {
id: row
anchors.verticalCenter: parent.verticalCenter
spacing: 4
BorderImage {
source: "qrc:welcome/images/lineedit.png";
width: 16;
height: 16;
border.left: 4;
border.right: 4;
border.top: 4;
border.bottom: 4
Image {
source: "qrc:welcome/images/checked.png";
width: 10; height: 10
anchors.centerIn: parent
visible: checkbox.checked
}
}
Text {
text: checkbox.text
}
}
Keys.onSpacePressed:checked = !checked
}
}

View File

@@ -40,7 +40,7 @@ Item {
width: parent.width
height: lineEdit.height
Components.TextField {
LineEdit {
Behavior on width { NumberAnimation{} }
placeholderText: !checkBox.checked ? qsTr("Search in Tutorials") : qsTr("Search in Tutorials, Examples and Demos")
focus: true
@@ -49,7 +49,7 @@ Item {
onTextChanged: examplesModel.filterRegExp = RegExp('.*'+text, "im")
}
Components.CheckBox {
CheckBox {
id: checkBox
text: qsTr("Show Examples and Demos")
checked: false
@@ -60,7 +60,7 @@ Item {
onCheckedChanged: examplesModel.showTutorialsOnly = !checked;
}
Components.Button {
Button {
id: tagFilterButton
property string tag
Behavior on width { NumberAnimation{} }
@@ -78,7 +78,7 @@ Item {
}
Components.ScrollArea {
id: scrollArea
anchors.topMargin: lineEditRoot.height
anchors.topMargin: lineEditRoot.height+12
anchors.fill: parent
clip: true
frame: false
@@ -86,7 +86,10 @@ Item {
Repeater {
id: repeater
model: examplesModel
delegate: ExampleDelegate { width: scrollArea.width-20 }
delegate: ExampleDelegate {
width: scrollArea.width-20;
property int count: repeater.count
}
}
}
}

View File

@@ -31,12 +31,16 @@
**************************************************************************/
import QtQuick 1.0
import components 1.0 as Components
Rectangle {
id: root
height: 110
height: 130
color: "#00ffffff"
radius: 6
clip: true
Components.QStyleItem { id: styleItem; cursor: "pointinghandcursor"; anchors.fill: parent }
Text {
id: title
@@ -46,8 +50,7 @@ Rectangle {
anchors.topMargin: 10
text: model.name
font.bold: true
font.pixelSize: 16;
font.pixelSize: 16
}
RatingBar { id: rating; anchors.top: parent.top; anchors.topMargin: 10; anchors.right: parent.right; anchors.rightMargin: 10; rating: model.difficulty; visible: model.difficulty !== 0 }
@@ -66,20 +69,44 @@ Rectangle {
source: model.imageUrl !== "" ? "image://helpimage/" + encodeURI(model.imageUrl) : ""
}
Text {
Item {
id: description
clip: true
anchors.left: image.right
anchors.leftMargin: 10
anchors.right: parent.right
anchors.rightMargin: 10
anchors.leftMargin: image.hideImage ? 0 : 10
anchors.top: rating.bottom
anchors.topMargin: 6
anchors.bottom: bottomRow.top
anchors.bottomMargin: 6
clip: true
Text {
clip: true
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
wrapMode: Text.WordWrap
text: model.description
}
Text { id: labelText; anchors.top: description.bottom; anchors.topMargin: 10; anchors.left: image.right; text: "Tags: "; font.bold: true; }
Row { id: tagLine; anchors.top: description.bottom; anchors.topMargin: 10; anchors.left: labelText.right; Text { text: model.tags.join(", "); color: "grey" } }
}
Row {
id: bottomRow
anchors.left: image.right;
anchors.leftMargin: image.hideImage ? 0 : 10
anchors.topMargin: 10
anchors.bottomMargin: 10
anchors.bottom: parent.bottom
spacing: 4
Text { text: qsTr("Tags:"); font.bold: true; }
Text { text: model.tags.join(", "); color: "grey" }
}
Rectangle {
visible: count-1 !== index
height: 1
anchors {left: parent.left; bottom: parent.bottom; right: parent.right }
color: "darkgrey"
}
MouseArea {
id: mouseArea
@@ -95,7 +122,7 @@ Rectangle {
onExited: parent.state = ""
}
states: [ State { name: "hover"; PropertyChanges { target: root; color: "#eeeeeeee" } } ]
states: [ State { name: "hover"; PropertyChanges { target: root; color: "#5effffff" } } ]
transitions:
Transition {

View File

@@ -40,43 +40,20 @@ BorderImage {
border.left: 2
border.right: 2
Rectangle { color: "black"; width: parent.width; height: 1; anchors.top: parent.top; anchors.left: parent.left }
Rectangle { color: "#4D295B7F"; width: parent.width; height: 1; anchors.top: parent.top; anchors.left: parent.left }
Components.QStyleItem { id: styleItem; visible: false }
// whitelist
property bool _hasDesktopTheme: welcomeMode.platform() === "linux"
Components.Button {
id: openProjectButton
text: qsTr("Open Project...")
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-open" : ""
onClicked: welcomeMode.openProject();
height: 32
anchors.left: parent.left
anchors.margins: 5
anchors.verticalCenter: parent.verticalCenter
}
Components.Button {
id: createProjectButton
text: qsTr("Create Project...")
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : ""
onClicked: welcomeMode.newProject();
height: 32
anchors.left: openProjectButton.right
anchors.margins: 5
anchors.verticalCenter: parent.verticalCenter
}
Components.Button {
Button {
id: feedbackButton
text: qsTr("Feedback")
iconSource: "qrc:welcome/images/feedback_arrow.png"
height: 32
anchors.verticalCenter: parent.verticalCenter
anchors.right: feedbackText.left
anchors.left: parent.left
anchors.margins: 5
onClicked: welcomeMode.sendFeedback()
}
@@ -84,9 +61,32 @@ BorderImage {
Text {
id: feedbackText
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.leftMargin: 10
anchors.margins: 5
anchors.leftMargin: 10
anchors.left: feedbackButton.right
text: qsTr("Help us make Qt Creator even better")
}
Button {
id: openProjectButton
text: qsTr("Open Project...")
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-open" : ""
onClicked: welcomeMode.openProject();
anchors.right: createProjectButton.left
anchors.margins: 5
height: 32
anchors.verticalCenter: parent.verticalCenter
}
Button {
id: createProjectButton
text: qsTr("Create Project...")
iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : ""
onClicked: welcomeMode.newProject();
height: 32
anchors.margins: 5
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}

View File

@@ -59,6 +59,7 @@ Item {
anchors.right: parent.right
Repeater {
width: parent.width
model: root.model
delegate: root.delegate
}

View File

@@ -31,32 +31,21 @@
**************************************************************************/
import QtQuick 1.0
import "../components/custom" as Custom
FocusScope {
Custom.TextField {
id: root
signal textChanged
property alias text : input.text
height:input.font.pixelSize*1.8
BorderImage {
leftMargin: 6
rightMargin: 6
topMargin: 6
bottomMargin: 6
background: BorderImage {
anchors.fill: parent
source: "img/lineedit.png"
source: "qrc:welcome/images/lineedit.png"
border.left: 5; border.top: 5
border.right: 5; border.bottom: 5
TextInput {
id: input
property string defaultText
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.right: parent.right
anchors.leftMargin: 4
anchors.rightMargin: 4
color: "grey"
text: defaultText
font.pointSize: 12
clip: true
onActiveFocusChanged: activeFocus ? state = 'active' : state = ''
onTextChanged: if (text != defaultText) root.textChanged();
states: [ State { name: "active"; PropertyChanges { target: input; color: "black"; text: "" } } ]
}
}
}

View File

@@ -31,32 +31,24 @@
**************************************************************************/
import QtQuick 1.0
import components 1.0 as Components
Row {
id: tabBar
height: 25
property alias model: tabs.model
property int tabBarWidth
property int tabWidth: Math.floor(tabBar.width/tabs.count)
Repeater {
id: tabs
height: tabBar.height
model: parent.model
delegate:
Item {
width: tabBarWidth / tabs.count
delegate: Item {
Components.QStyleItem { id: styleItem; cursor: "pointinghandcursor"; anchors.fill: parent }
height: tabBar.height
Rectangle {
width: parent.width; height: 1
anchors { bottom: parent.bottom; bottomMargin: 1 }
color: "#acb2c2"
}
BorderImage {
width: index === 1 ? tabWidth : (tabWidth + tabBar.width % tabs.count + 1)
Image {
id: tabBackground
anchors.fill: parent
border { top: 1; bottom: 1}
source: "qrc:welcome/images/tab_inactive.png"
}
Text {
@@ -65,7 +57,7 @@ Row {
anchors.fill: parent
text: model.modelData.title
elide: Text.ElideRight
color: "white"
color: "black"
}
MouseArea {
id: mouseArea
@@ -77,7 +69,7 @@ Row {
State {
id: activeState; when: tabBar.current == index
PropertyChanges { target: tabBackground; source:"qrc:welcome/images/tab_active.png" }
PropertyChanges { target: text; color: "black" }
PropertyChanges { target: text; color: "white" }
},
State {
id: hoverState; when: mouseArea.containsMouse

View File

@@ -41,7 +41,7 @@ Item {
property alias itemCount: repeater.count
Timer {
id: timer
id: nextItemTimer
repeat: true
interval: 30*1000
onTriggered: repeater.incrementIndex()
@@ -63,7 +63,7 @@ Item {
}
function handleModelUpdate() {
timer.stop();
nextItemTimer.stop();
currentItem = 0;
for (var i = 0; i < count; ++i) {
if (i != currentItem)
@@ -71,7 +71,7 @@ Item {
else
repeater.itemAt(i).active = true;
}
timer.start();
nextItemTimer.start();
}
function handleModelChanged() {
@@ -95,7 +95,7 @@ Item {
id: delegateItem
opacity: 0
height: root.height
width: 270
width: root.width
Column {
spacing: 10
width: parent.width
@@ -145,12 +145,18 @@ Item {
cursor: "pointinghandcursor";
anchors.fill: column
}
Timer {
id: toolTipTimer
interval: 500
onTriggered: styleItem.showToolTip(link)
}
MouseArea {
anchors.fill: column;
onClicked: Qt.openUrlExternally(link);
hoverEnabled: true;
onEntered: timer.stop()
onExited: timer.restart()
onEntered: { nextItemTimer.stop(); toolTipTimer.start(); }
onExited: { nextItemTimer.restart(); toolTipTimer.stop(); }
id: mouseArea
}

View File

@@ -36,6 +36,6 @@ Row {
property int rating : 2
property int totalRating: 3
Repeater { id: rep1; model: rating; Image { source: "img/face-star.png"; width: 22 } }
Repeater { id: rep2; model: totalRating-rating; Image { source: "img/draw-star.png"; width: 22 } }
Repeater { id: rep1; model: rating; Image { source: "qrc:welcome/images/face-star.png"; width: 22 } }
Repeater { id: rep2; model: totalRating-rating; Image { source: "qrc:welcome/images/draw-star.png"; width: 22 } }
}

View File

@@ -51,7 +51,7 @@ HeaderItemView {
id: nameText
text: displayName
font.bold: true
width: parent.width
anchors.right: parent.right
anchors.top: parent.top
anchors.left: arrowImage.right
anchors.leftMargin: 10
@@ -61,7 +61,7 @@ HeaderItemView {
text: prettyFilePath
elide: Text.ElideMiddle
color: "grey"
width: parent.width
anchors.right: parent.right
anchors.top: nameText.bottom
anchors.left: arrowImage.right
anchors.leftMargin: 10

View File

@@ -44,8 +44,10 @@ HeaderItemView {
function fullSessionName()
{
var newSessionName = sessionName
if (model.currentSession)
newSessionName = qsTr("%1 (current session)").arg(newSessionName);
if (model.lastSession && sessionList.isDefaultVirgin())
newSessionName = qsTr("%1 (last session)").arg(sessionName);
else if (model.activeSession && !sessionList.isDefaultVirgin())
newSessionName = qsTr("%1 (current session)").arg(sessionName);
return newSessionName;
}
@@ -60,7 +62,6 @@ HeaderItemView {
Components.QStyleItem { id: styleItem; cursor: "pointinghandcursor"; anchors.fill: parent }
id: fileNameText
text: parent.fullSessionName()
font.italic: model.defaultSession
elide: Text.ElideMiddle
anchors.left: arrowImage.right
anchors.verticalCenter: parent.verticalCenter

Some files were not shown because too many files have changed in this diff Show More