Merge remote branch 'origin/2.0'
Conflicts: doc/qtcreator.qdoc src/plugins/debugger/debuggermanager.cpp src/plugins/texteditor/basetexteditor.cpp
28
doc/examples/batteryindicator/BatteryIndicator.pro
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#-------------------------------------------------
|
||||||
|
#
|
||||||
|
# Project created by QtCreator 2010-05-26T16:46:58
|
||||||
|
#
|
||||||
|
#-------------------------------------------------
|
||||||
|
|
||||||
|
QT += core gui
|
||||||
|
|
||||||
|
TARGET = BatteryIndicator
|
||||||
|
TEMPLATE = app
|
||||||
|
|
||||||
|
|
||||||
|
SOURCES += main.cpp\
|
||||||
|
batteryindicator.cpp
|
||||||
|
|
||||||
|
HEADERS += batteryindicator.h
|
||||||
|
|
||||||
|
FORMS += batteryindicator.ui
|
||||||
|
|
||||||
|
CONFIG += mobility
|
||||||
|
MOBILITY = systeminfo
|
||||||
|
|
||||||
|
symbian {
|
||||||
|
TARGET.UID3 = 0xecbd72d7
|
||||||
|
# TARGET.CAPABILITY +=
|
||||||
|
TARGET.EPOCSTACKSIZE = 0x14000
|
||||||
|
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
|
||||||
|
}
|
||||||
30
doc/examples/batteryindicator/batteryindicator.cpp
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#include "batteryindicator.h"
|
||||||
|
#include "ui_batteryindicator.h"
|
||||||
|
|
||||||
|
//! [2]
|
||||||
|
BatteryIndicator::BatteryIndicator(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::BatteryIndicator),
|
||||||
|
deviceInfo(NULL)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
setupGeneral();
|
||||||
|
}
|
||||||
|
//! [2]
|
||||||
|
|
||||||
|
BatteryIndicator::~BatteryIndicator()
|
||||||
|
{
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! [1]
|
||||||
|
void BatteryIndicator::setupGeneral()
|
||||||
|
{
|
||||||
|
deviceInfo = new QSystemDeviceInfo(this);
|
||||||
|
|
||||||
|
ui->batteryLevelBar->setValue(deviceInfo->batteryLevel());
|
||||||
|
|
||||||
|
connect(deviceInfo, SIGNAL(batteryLevelChanged(int)),
|
||||||
|
ui->batteryLevelBar, SLOT(setValue(int)));
|
||||||
|
}
|
||||||
|
//! [1]
|
||||||
35
doc/examples/batteryindicator/batteryindicator.h
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#ifndef BATTERYINDICATOR_H
|
||||||
|
#define BATTERYINDICATOR_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
//! [1]
|
||||||
|
#include <QSystemInfo>
|
||||||
|
//! [1]
|
||||||
|
|
||||||
|
//! [2]
|
||||||
|
QTM_USE_NAMESPACE
|
||||||
|
//! [2]
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class BatteryIndicator;
|
||||||
|
}
|
||||||
|
|
||||||
|
class BatteryIndicator : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit BatteryIndicator(QWidget *parent = 0);
|
||||||
|
~BatteryIndicator();
|
||||||
|
|
||||||
|
//! [3]
|
||||||
|
private:
|
||||||
|
Ui::BatteryIndicator *ui;
|
||||||
|
void setupGeneral();
|
||||||
|
|
||||||
|
QSystemDeviceInfo *deviceInfo;
|
||||||
|
//! [3]
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // BATTERYINDICATOR_H
|
||||||
33
doc/examples/batteryindicator/batteryindicator.ui
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>BatteryIndicator</class>
|
||||||
|
<widget class="QDialog" name="BatteryIndicator">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>480</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>BatteryIndicator</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QProgressBar" name="batteryLevelBar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>118</width>
|
||||||
|
<height>23</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>24</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
15
doc/examples/batteryindicator/main.cpp
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include <QtGui/QApplication>
|
||||||
|
#include "batteryindicator.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
BatteryIndicator w;
|
||||||
|
#if defined(Q_WS_S60)
|
||||||
|
w.showMaximized();
|
||||||
|
#else
|
||||||
|
w.show();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return a.exec();
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 190 KiB After Width: | Height: | Size: 170 KiB |
BIN
doc/images/qt-simulator.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 11 KiB |
BIN
doc/images/qtcreator-batteryindicator-screenshot.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 147 KiB |
BIN
doc/images/qtcreator-gs-build-example-open.png
Normal file
|
After Width: | Height: | Size: 109 KiB |
BIN
doc/images/qtcreator-gs-build-example-select-qs.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
doc/images/qtcreator-gs-build-example-targets.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 147 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 29 KiB |
BIN
doc/images/qtcreator-maemo-deb-package.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
BIN
doc/images/qtcreator-mobile-class-info.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
doc/images/qtcreator-mobile-intro-and-location.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
doc/images/qtcreator-mobile-project-contents.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
doc/images/qtcreator-mobile-project-qt-versions.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
doc/images/qtcreator-mobile-project-summary.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
doc/images/qtcreator-mobile-project-widgets.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
doc/images/qtcreator-mobile-simulated.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
doc/images/qtcreator-new-mobile-project.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 619 B |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 24 KiB |
BIN
doc/images/qtcreator-symbian-run-settings.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
@@ -46,7 +46,9 @@
|
|||||||
\o \l{Quick Tour}
|
\o \l{Quick Tour}
|
||||||
\o \l{Getting Started}
|
\o \l{Getting Started}
|
||||||
\list
|
\list
|
||||||
|
\o \l{Building and Running an Example Application}
|
||||||
\o \l{Creating a Qt C++ Application}
|
\o \l{Creating a Qt C++ Application}
|
||||||
|
\o \l{Creating a Mobile Application with Nokia Qt SDK}
|
||||||
\o \l{Creating a Qt Quick Application}
|
\o \l{Creating a Qt Quick Application}
|
||||||
\endlist
|
\endlist
|
||||||
\o \l{Using the Editor}
|
\o \l{Using the Editor}
|
||||||
@@ -138,7 +140,7 @@
|
|||||||
phones, media players, set-top boxes, and netbooks.
|
phones, media players, set-top boxes, and netbooks.
|
||||||
|
|
||||||
\QMLD allows you to easily develop animations by using a declarative programming
|
\QMLD allows you to easily develop animations by using a declarative programming
|
||||||
language called \l {http://qt.nokia.com/doc/4.7-snapshot/declarativeui.html}{QML}.
|
language called \l {http://doc.qt.nokia.com/4.7-snapshot/declarativeui.html}{QML}.
|
||||||
In QML, a user interface is specified as a tree of objects with properties.
|
In QML, a user interface is specified as a tree of objects with properties.
|
||||||
|
|
||||||
You use a visual editor to create items, screens, and applications, as well as define changes
|
You use a visual editor to create items, screens, and applications, as well as define changes
|
||||||
@@ -573,7 +575,7 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
For more information on \QD, see
|
For more information on \QD, see
|
||||||
\l{http://doc.trolltech.com/designer-manual.html}{Qt Designer Manual}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/designer-manual.html}{Qt Designer Manual}.
|
||||||
|
|
||||||
\section1 Using Qt Quick Designer
|
\section1 Using Qt Quick Designer
|
||||||
|
|
||||||
@@ -1846,7 +1848,7 @@
|
|||||||
To add an external library:
|
To add an external library:
|
||||||
\list 1
|
\list 1
|
||||||
\o Open your project file (.pro) using the \gui Projects pane.
|
\o Open your project file (.pro) using the \gui Projects pane.
|
||||||
\o Follow the instructions at \l{http://doc.trolltech.com/latest/qmake-project-files.html#declaring-other-libraries}
|
\o Follow the instructions at \l{http://doc.qt.nokia.com/4.7-snapshot/qmake-project-files.html#declaring-other-libraries}
|
||||||
{Declaring other Libraries}.
|
{Declaring other Libraries}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -1875,7 +1877,7 @@
|
|||||||
\section1 Setting Up a Project
|
\section1 Setting Up a Project
|
||||||
|
|
||||||
To view and modify the settings for currently open projects, switch to the
|
To view and modify the settings for currently open projects, switch to the
|
||||||
\gui Projects mode by pressing \key Ctrl+4.
|
\gui Projects mode by pressing \key Ctrl+5.
|
||||||
|
|
||||||
\image qtcreator-projectpane.png
|
\image qtcreator-projectpane.png
|
||||||
|
|
||||||
@@ -1944,9 +1946,7 @@
|
|||||||
|
|
||||||
\o Build and run the application for \l{Using the Maemo Emulator}{Maemo Emulator}.
|
\o Build and run the application for \l{Using the Maemo Emulator}{Maemo Emulator}.
|
||||||
|
|
||||||
\note The Maemo emulator support requires the Nokia Nokia N900 PR1.2 update.
|
\o Alternatively, you can build and run the application for a device:
|
||||||
|
|
||||||
\o If no problems are found, build and run the application for a device:
|
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
@@ -1972,6 +1972,22 @@
|
|||||||
|
|
||||||
Debugging also works transparently.
|
Debugging also works transparently.
|
||||||
|
|
||||||
|
\section2 Creating Installation Packages
|
||||||
|
|
||||||
|
When you build the application for the \gui{Maemo} target, Qt
|
||||||
|
Creator automatically generates a debian installation package
|
||||||
|
in the project folder. You can deliver the installation package to
|
||||||
|
users for installation on Maemo devices.
|
||||||
|
|
||||||
|
You can add other files to the installation package in the
|
||||||
|
\gui {Create package} step in the build configuration. Add files
|
||||||
|
to the \gui {Package contents} field. In \gui {Local File Path},
|
||||||
|
specify the location of the file on the development PC. In
|
||||||
|
\gui {Remote File Path}, specify the folder to install the file on
|
||||||
|
the device.
|
||||||
|
|
||||||
|
\image qtcreator-maemo-deb-package.png "Create installation package"
|
||||||
|
|
||||||
|
|
||||||
\section1 Building for Symbian
|
\section1 Building for Symbian
|
||||||
|
|
||||||
@@ -1999,14 +2015,12 @@
|
|||||||
\l{Setting Up Development Environment for Symbian}.
|
\l{Setting Up Development Environment for Symbian}.
|
||||||
|
|
||||||
\o Connect the device to the development PC through a USB cable.
|
\o Connect the device to the development PC through a USB cable.
|
||||||
Qt Creator shows the current connection state
|
The target selector displays a green check mark when a
|
||||||
of a device in its main toolbar, showing a red cross when no device is
|
device is connected.
|
||||||
connected, or a green check mark when a device is connected.
|
|
||||||
|
|
||||||
\image qtcreator-qt4-symbian-device-notconnected.png
|
|
||||||
\image qtcreator-qt4-symbian-device-connected.png
|
\image qtcreator-qt4-symbian-device-connected.png
|
||||||
|
|
||||||
The tool tip of the target button shows more details about the actual
|
The tool tip of the target selector shows more details about the actual
|
||||||
device that will be used when you run your application.
|
device that will be used when you run your application.
|
||||||
|
|
||||||
\o Start the \gui{App TRK} application on your device.
|
\o Start the \gui{App TRK} application on your device.
|
||||||
@@ -2262,11 +2276,58 @@
|
|||||||
\section1 Specifying Run Settings for qmake Projects
|
\section1 Specifying Run Settings for qmake Projects
|
||||||
|
|
||||||
The run configurations for qmake projects derive their executable from the parsed .pro
|
The run configurations for qmake projects derive their executable from the parsed .pro
|
||||||
files. You can also create custom executable run configurations where you
|
files.
|
||||||
can set the executable to be run.
|
|
||||||
|
\section2 Specifying Run Settings for Desktop Targets
|
||||||
|
|
||||||
|
You can specify command line arguments to be passed to the executable
|
||||||
|
and the working directory to use. The working directory defaults to
|
||||||
|
the directory of the build result.
|
||||||
|
|
||||||
|
For console applications, check the \gui{Run in Terminal} check box.
|
||||||
|
If you need to run with special environment variables set up, you
|
||||||
|
also do it in the run configuration settings.
|
||||||
|
|
||||||
\image qtcreator-pprunsettings.png
|
\image qtcreator-pprunsettings.png
|
||||||
|
|
||||||
|
You can also create custom executable run configurations where you
|
||||||
|
can set the executable to be run. For more information, see
|
||||||
|
\l{Specifying a Custom Executable to Run}.
|
||||||
|
|
||||||
|
\section2 Specifying Run Settings for Symbian Devices
|
||||||
|
|
||||||
|
Qt Creator automatically detects Symbian devices that are connected to
|
||||||
|
the development PC with an USB cable.
|
||||||
|
If only one device is detected, the application is deployed
|
||||||
|
and run on it. If multiple devices are connected to the PC,
|
||||||
|
make sure that the correct device is selected in the
|
||||||
|
\gui {Symbian Device} run settings for your project.
|
||||||
|
|
||||||
|
You can also pass command line arguments to your application on the device.
|
||||||
|
Press the \gui{Device info button} to get more information about the selected
|
||||||
|
device, such as the CPU type and the running TRK version.
|
||||||
|
|
||||||
|
\image qtcreator-symbian-run-settings.png "Run settings for Symbian devices"
|
||||||
|
|
||||||
|
\section2 Specifying Run Settings for Maemo Devices
|
||||||
|
|
||||||
|
To run an application on a Maemo device, create and select
|
||||||
|
a device configuration in the Maemo run settings for your project.
|
||||||
|
You can also pass command line arguments to your application.
|
||||||
|
|
||||||
|
\image qtcreator-screenshot-run-settings.png "Run settings for Maemo devices"
|
||||||
|
|
||||||
|
\section1 Specifying a Custom Executable to Run
|
||||||
|
|
||||||
|
If you use cmake or the generic project type in Qt Creator, or want
|
||||||
|
to run a custom desktop executable, create a \gui {Custom Executable}
|
||||||
|
run configuration for your project.
|
||||||
|
|
||||||
|
Specify the executable to run, command line arguments, working directory,
|
||||||
|
and environment variables to use.
|
||||||
|
|
||||||
|
\image qmldesigner-run-custom-exe.png "Run settings for custom executables"
|
||||||
|
|
||||||
\section1 Specifying Run Settings for Qt Quick Projects
|
\section1 Specifying Run Settings for Qt Quick Projects
|
||||||
|
|
||||||
Select run settings in the \gui {Run configuration} field. The settings
|
Select run settings in the \gui {Run configuration} field. The settings
|
||||||
@@ -2292,11 +2353,6 @@
|
|||||||
|
|
||||||
\image qmldesigner-run-settings.png "Run settings for Qt Quick projects"
|
\image qmldesigner-run-settings.png "Run settings for Qt Quick projects"
|
||||||
|
|
||||||
To set the executable to run, select \gui {Custom Executable} in the
|
|
||||||
\gui {Run configuration} field.
|
|
||||||
|
|
||||||
\image qmldesigner-run-custom-exe.png "Run settings for custom executables"
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -2348,15 +2404,18 @@
|
|||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\previouspage creator-quick-tour.html
|
\previouspage creator-quick-tour.html
|
||||||
\page creator-getting-started.html
|
\page creator-getting-started.html
|
||||||
\nextpage creator-writing-program.html
|
\nextpage creator-build-example-application.html
|
||||||
|
|
||||||
\title Getting Started
|
\title Getting Started
|
||||||
|
|
||||||
This section contains examples that illustrate how to use Qt Creator and the
|
This section contains examples that illustrate how to use Qt Creator and the
|
||||||
integrated design tools, \QD and \QMLD, to create simple applications:
|
integrated design tools, \QD and \QMLD, to create, build, and run simple
|
||||||
|
applications:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
\o \l{Building and Running an Example Application}
|
||||||
\o \l{Creating a Qt C++ Application}
|
\o \l{Creating a Qt C++ Application}
|
||||||
|
\o \l{Creating a Mobile Application with Nokia Qt SDK}
|
||||||
\o \l{Creating a Qt Quick Application}
|
\o \l{Creating a Qt Quick Application}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -2366,14 +2425,322 @@
|
|||||||
/*!
|
/*!
|
||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\previouspage creator-writing-program.html
|
\previouspage creator-writing-program.html
|
||||||
|
\page creator-mobile-example.html
|
||||||
|
\nextpage creator-qml-application.html
|
||||||
|
|
||||||
|
\title Creating a Mobile Application with Nokia Qt SDK
|
||||||
|
|
||||||
|
\note To complete this tutorial, you must install Nokia Qt SDK.
|
||||||
|
The installation program installs and configures the necessary tool chains
|
||||||
|
for mobile application development.
|
||||||
|
|
||||||
|
This tutorial describes how to use Qt Creator to create a small Qt
|
||||||
|
application, Battery Indicator, that uses the System Information
|
||||||
|
Mobility API to fetch battery information from the device.
|
||||||
|
|
||||||
|
\image qtcreator-batteryindicator-screenshot.png
|
||||||
|
|
||||||
|
\section1 Creating the Battery Indicator Project
|
||||||
|
|
||||||
|
\note Create the project with the \gui{Help} mode active so that you can follow
|
||||||
|
these instructions while you work.
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o Select \gui{File > New File or Project > Qt Application Project > Mobile Qt
|
||||||
|
Application > Choose}.
|
||||||
|
|
||||||
|
\image qtcreator-new-mobile-project.png "New File or Project dialog"
|
||||||
|
|
||||||
|
The \gui{Introduction and Project Location} dialog opens.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-intro-and-location.png "Introduction and Project Location dialog"
|
||||||
|
|
||||||
|
\o In the \gui{Name} field, type \bold {BatteryIndicator}.
|
||||||
|
|
||||||
|
\o In the \gui {Create in} field, enter the path for the project files. For example,
|
||||||
|
\c {C:\Qt\examples}, and then click \gui{Next}.
|
||||||
|
|
||||||
|
The \gui{Select Required Qt Versions} dialog opens.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-project-qt-versions.png "Select Required Qt Versions dialog"
|
||||||
|
|
||||||
|
\o Select \gui Maemo, \gui {Qt Simulator}, and \gui {Symbian Device} targets,
|
||||||
|
and click \gui{Next}.
|
||||||
|
|
||||||
|
\note Targets are listed if you installed the appropriate development
|
||||||
|
environment, for example, as part of the Nokia Qt SDK.
|
||||||
|
|
||||||
|
The \gui{Class Information} dialog opens.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-class-info.png "Class Information dialog"
|
||||||
|
|
||||||
|
\o In the \gui{Class Name} field, type \bold {BatteryIndicator} as the class name.
|
||||||
|
|
||||||
|
\o In the \gui{Base Class} list, select \bold {QDialog} as the base class type.
|
||||||
|
|
||||||
|
\note The \gui{Header File}, \gui{Source File} and \gui{Form File} fields are
|
||||||
|
automatically updated to match the name of the class.
|
||||||
|
|
||||||
|
\o Click \gui{Next}.
|
||||||
|
|
||||||
|
The \gui{Project Management} dialog opens.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-project-summary.png "Project Management dialog"
|
||||||
|
|
||||||
|
\o Review the project settings, and click \gui{Finish} to create the project.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
The BatteryIndicator project now contains the following files:
|
||||||
|
|
||||||
|
\list
|
||||||
|
|
||||||
|
\o batteryindicator.h
|
||||||
|
\o batteryindicator.cpp
|
||||||
|
\o main.cpp
|
||||||
|
\o batteryindicator.ui
|
||||||
|
\o BatteryIndicator.pro
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\image qtcreator-mobile-project-contents.png "Project contents"
|
||||||
|
|
||||||
|
The files come with the necessary boiler plate code that you must
|
||||||
|
modify, as described in the following sections. You do not need
|
||||||
|
to change the main.cpp file.
|
||||||
|
|
||||||
|
\section1 Declaring the Qt Mobility API
|
||||||
|
|
||||||
|
The \gui New wizard automatically adds information to the .pro file
|
||||||
|
that you need when you use the Qt Mobility APIs or develop applications
|
||||||
|
for Symbian devices. You must modify the information to declare the
|
||||||
|
Qt Mobility APIs that you use.
|
||||||
|
|
||||||
|
This example uses the System Info API, so you must declare it, as
|
||||||
|
illustrated by the following code snippet:
|
||||||
|
|
||||||
|
\code
|
||||||
|
|
||||||
|
CONFIG += mobility
|
||||||
|
MOBILITY = systeminfo
|
||||||
|
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
Each Mobility API has its corresponding value that you have to add
|
||||||
|
as a value of MOBILITY to use the API. For a list of the APIs and the
|
||||||
|
corresponding values that you can assign to MOBILITY, see the
|
||||||
|
\l {http://doc.qt.nokia.com/qtmobility-1.0/quickstart.html}{Quickstart Example}.
|
||||||
|
|
||||||
|
The following code snippet shows information that is needed for
|
||||||
|
applications developed for Symbian device. Qt Creator generated
|
||||||
|
the UID for testing the application on a device. You only need
|
||||||
|
to change the UID and capabilities if you deliver the application
|
||||||
|
for public use and need to have it Symbian Signed.
|
||||||
|
|
||||||
|
\code
|
||||||
|
|
||||||
|
symbian {
|
||||||
|
TARGET.UID3 = 0xecbd72d7
|
||||||
|
# TARGET.CAPABILITY +=
|
||||||
|
TARGET.EPOCSTACKSIZE = 0x14000
|
||||||
|
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
|
||||||
|
}
|
||||||
|
|
||||||
|
\endcode
|
||||||
|
|
||||||
|
\section1 Designing the User Interface
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o In the \gui{Editor} mode, double-click the batteryindicator.ui
|
||||||
|
file in the \gui{Projects} view to launch the integrated \QD.
|
||||||
|
|
||||||
|
\o Drag and drop a \gui{Progress Bar} (\l{http://doc.qt.nokia.com/4.7-snapshot/qprogressbar.html}{QProgressBar})
|
||||||
|
widget to the form.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-project-widgets.png "Adding widgets to the UI"
|
||||||
|
|
||||||
|
\o In the \gui Properties pane, change the \gui objectName to
|
||||||
|
\bold batteryLevelBar.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Completing the Header File
|
||||||
|
|
||||||
|
The batteryindicator.h file contains some of the necessary #includes, a
|
||||||
|
constructor, a destructor, and the \c{Ui} object. You must include
|
||||||
|
the System Info header file, add a shortcut to the mobility name
|
||||||
|
space, and add a private function to update the battery level value in
|
||||||
|
the indicator when the battery power level changes.
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o In the \gui{Projects} view, double-click the \c{batteryindicator.h} file
|
||||||
|
to open it for editing.
|
||||||
|
|
||||||
|
\o Include the System Info header file, as illustrated by the following
|
||||||
|
code snippet:
|
||||||
|
|
||||||
|
\snippet examples/batteryindicator/batteryindicator.h 1
|
||||||
|
|
||||||
|
\o Add a shortcut to the mobility name space, as illustrated by the
|
||||||
|
following code snippet:
|
||||||
|
|
||||||
|
\snippet examples/batteryindicator/batteryindicator.h 2
|
||||||
|
|
||||||
|
\o Declare a private function in the \c{private} section, after the
|
||||||
|
\c{Ui::BatteryIndicator} function, as illustrated by the following code
|
||||||
|
snippet:
|
||||||
|
|
||||||
|
\snippet examples/batteryindicator/batteryindicator.h 3
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Completing the Source File
|
||||||
|
|
||||||
|
Now that the header file is complete, move on to the source file,
|
||||||
|
batteryindicator.cpp.
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o In the \gui{Projects} view, double-click the batteryindicator.cpp file
|
||||||
|
to open it for editing.
|
||||||
|
|
||||||
|
\o Create a QSystemDeviceInfo object and set its value. Then connect the signal
|
||||||
|
that indicates that battery level changed to the \c setValue
|
||||||
|
slot of the progress bar. This is illustrated by the following code snippet:
|
||||||
|
|
||||||
|
\snippet examples/batteryindicator/batteryindicator.cpp 1
|
||||||
|
|
||||||
|
\o Use the constructor to set initial values and make sure that the
|
||||||
|
created object is in a defined state, as illustrated by the following
|
||||||
|
code snippet:
|
||||||
|
|
||||||
|
\snippet examples/batteryindicator/batteryindicator.cpp 2
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Compiling and Running Your Program
|
||||||
|
|
||||||
|
Now that you have all the necessary code, select \gui {Qt Simulator}
|
||||||
|
as the target and click the
|
||||||
|
\inlineimage qtcreator-run.png
|
||||||
|
button to build your program and run it in the Qt Simulator.
|
||||||
|
|
||||||
|
In Qt Simulator, run the runOutOfBattery.qs example script
|
||||||
|
to see the value change in the Battery Indicator application.
|
||||||
|
Select \gui {Scripting > examples > runOutOfBattery.qs > Run}.
|
||||||
|
|
||||||
|
\image qtcreator-mobile-simulated.png "Mobile example in Qt Simulator"
|
||||||
|
|
||||||
|
\section1 Testing on a Symbian Device
|
||||||
|
|
||||||
|
You also need to test the application on real devices. Before you can
|
||||||
|
start testing on Symbian devices, you must connect them to the development
|
||||||
|
PC by using an USB cable and install the necessary software on them.
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o Install Qt 4.6.2 libraries, the Qt mobile libraries, and the TRK
|
||||||
|
debugging application on the device. For more information,
|
||||||
|
see \l{Setting Up Development Environment for Symbian}.
|
||||||
|
|
||||||
|
\o Start TRK on the device.
|
||||||
|
|
||||||
|
\o Click the \gui {Target Selector} and select \gui {Symbian Device}.
|
||||||
|
|
||||||
|
\o Click \gui Run to build the application for the Symbian device.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Testing on the Maemo Emulator
|
||||||
|
|
||||||
|
The Maemo emulator emulates the Nokia N900 device environment. You can test
|
||||||
|
applications in conditions practically identical to running the application
|
||||||
|
on a Nokia N900 device with the software update release 1.2 (V10.2010.19-1).
|
||||||
|
|
||||||
|
For more information, see \l{Using the Maemo Emulator}.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\contentspage index.html
|
||||||
|
\previouspage creator-getting-started.html
|
||||||
|
\page creator-build-example-application.html
|
||||||
|
\nextpage creator-writing-program.html
|
||||||
|
|
||||||
|
\title Building and Running an Example Application
|
||||||
|
|
||||||
|
You can test that your installation is successful by opening an existing
|
||||||
|
example application project.
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o On the \gui Welcome page, select \gui {Choose an example... >
|
||||||
|
Animation Framework > Animated Tiles}.
|
||||||
|
|
||||||
|
\image qtcreator-gs-build-example-open.png "Selecting an example"
|
||||||
|
|
||||||
|
\o Select targets for the project. Select at least Qt Simulator
|
||||||
|
and one of the mobile targets, Maemo or Symbian Device, depending on
|
||||||
|
the device you develop for.
|
||||||
|
|
||||||
|
\image qtcreator-gs-build-example-targets.png "Selecting targets"
|
||||||
|
|
||||||
|
\note You can add targets later in the \gui Projects mode.
|
||||||
|
|
||||||
|
\o To test the application in Qt Simulator, click the \gui {Target
|
||||||
|
Selector} and select \gui {Qt Simulator}.
|
||||||
|
|
||||||
|
\image {qtcreator-gs-build-example-select-qs.png} "Selecting Qt Simulator as target"
|
||||||
|
|
||||||
|
\o Click
|
||||||
|
\inlineimage{qtcreator-run.png}
|
||||||
|
to build the application for Qt Simulator.
|
||||||
|
|
||||||
|
\o To see the compilation progress, press \key{Alt+4} to open the
|
||||||
|
\gui Compile Output pane.
|
||||||
|
|
||||||
|
The gui Build progress bar on the toolbar turns green when the project
|
||||||
|
is successfully built. The application opens in Qt Simulator.
|
||||||
|
|
||||||
|
\image {qt-simulator.png} "Qt Simulator"
|
||||||
|
|
||||||
|
\o Change the settings in the
|
||||||
|
\gui View pane, for example, to toggle the orientation by clicking
|
||||||
|
\gui {Rotate Device}, or choose from the various Symbian and Maemo
|
||||||
|
configurations by clicking \gui {Device}. You can also simulate various
|
||||||
|
mobile functions and create your own scripts.
|
||||||
|
|
||||||
|
\o To test the application on a Symbian device install Qt 4.6.2
|
||||||
|
and the TRK debugging application on the device. For more information,
|
||||||
|
see \l{Setting Up Development Environment for Symbian}.
|
||||||
|
|
||||||
|
\o Click the \gui {Target Selector} and select \gui {Symbian Device}.
|
||||||
|
|
||||||
|
\o Click \gui Run to build the application for the Symbian device.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\contentspage index.html
|
||||||
|
\previouspage creator-mobile-example.html
|
||||||
\page creator-qml-application.html
|
\page creator-qml-application.html
|
||||||
\nextpage creator-editor-using.html
|
\nextpage creator-editor-using.html
|
||||||
|
|
||||||
\title Creating a Qt Quick Application
|
\title Creating a Qt Quick Application
|
||||||
|
|
||||||
\note This tutorial assumes that you are familiar with the \l {http://qt.nokia.com/doc/4.7-snapshot/declarativeui.html}
|
\note This tutorial assumes that you are familiar with the \l {http://doc.qt.nokia.com/4.7-snapshot/declarativeui.html}
|
||||||
{QML declarative language}.
|
{QML declarative language}.
|
||||||
|
|
||||||
|
\note The Qt Quick specific features and the QDeclarative help are based on a
|
||||||
|
preview version of the QtDeclarative package. Update Qt Creator when Qt 4.7 is
|
||||||
|
released.
|
||||||
|
|
||||||
This tutorial describes how to use Qt Creator to create a small animated
|
This tutorial describes how to use Qt Creator to create a small animated
|
||||||
Qt Quick application, Hello World.
|
Qt Quick application, Hello World.
|
||||||
|
|
||||||
@@ -2386,7 +2753,7 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\o Select \gui{File > New File or Project > Qt Quick Project > Qt QML Application > OK}.
|
\o Select \gui{File > New File or Project > Qt Quick Project > Qt QML Application > Choose}.
|
||||||
|
|
||||||
\image qmldesigner-new-project.png "New File or Project dialog"
|
\image qmldesigner-new-project.png "New File or Project dialog"
|
||||||
|
|
||||||
@@ -2553,9 +2920,9 @@
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\contentspage index.html
|
\contentspage index.html
|
||||||
\previouspage creator-getting-started.html
|
\previouspage creator-build-example-application.html
|
||||||
\page creator-writing-program.html
|
\page creator-writing-program.html
|
||||||
\nextpage creator-qml-application.html
|
\nextpage creator-mobile-example.html
|
||||||
|
|
||||||
\title Creating a Qt C++ Application
|
\title Creating a Qt C++ Application
|
||||||
|
|
||||||
@@ -2565,7 +2932,7 @@
|
|||||||
|
|
||||||
This tutorial describes how to use Qt Creator
|
This tutorial describes how to use Qt Creator
|
||||||
to create a small Qt application, Text Finder. It is a simplified version of the
|
to create a small Qt application, Text Finder. It is a simplified version of the
|
||||||
QtUiTools \l{http://doc.trolltech.com/uitools-textfinder.html}{Text Finder}
|
QtUiTools \l{http://doc.qt.nokia.com/4.7-snapshot/uitools-textfinder.html}{Text Finder}
|
||||||
example.
|
example.
|
||||||
|
|
||||||
\image qtcreator-textfinder-screenshot.png
|
\image qtcreator-textfinder-screenshot.png
|
||||||
@@ -2584,7 +2951,7 @@
|
|||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\o Select \gui{File > New File or Project > Qt Application Project > Qt Gui
|
\o Select \gui{File > New File or Project > Qt Application Project > Qt Gui
|
||||||
Application > OK}.
|
Application > Choose}.
|
||||||
|
|
||||||
\image qtcreator-new-project.png "New File or Project dialog"
|
\image qtcreator-new-project.png "New File or Project dialog"
|
||||||
|
|
||||||
@@ -2661,9 +3028,9 @@
|
|||||||
\o Drag and drop the following widgets to the form:
|
\o Drag and drop the following widgets to the form:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\o \gui{Label} (\l{http://doc.trolltech.com/qlabel.html}{QLabel})
|
\o \gui{Label} (\l{http://doc.qt.nokia.com/4.7-snapshot/qlabel.html}{QLabel})
|
||||||
\o \gui{Line Edit} (\l{http://doc.trolltech.com/qlineedit.html}{QLineEdit})
|
\o \gui{Line Edit} (\l{http://doc.qt.nokia.com/4.7-snapshot/qlineedit.html}{QLineEdit})
|
||||||
\o \gui{Push Button} (\l{http://doc.trolltech.com/qpushbutton.html}{QPushButton})
|
\o \gui{Push Button} (\l{http://doc.qt.nokia.com/4.7-snapshot/qpushbutton.html}{QPushButton})
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -2679,15 +3046,15 @@
|
|||||||
|
|
||||||
\o Press \key {Ctrl+A} to select the widgets and click \gui{Lay out Horizontally}
|
\o Press \key {Ctrl+A} to select the widgets and click \gui{Lay out Horizontally}
|
||||||
(or press \gui{Ctrl+H}) to apply a horizontal layout
|
(or press \gui{Ctrl+H}) to apply a horizontal layout
|
||||||
(\l{http://doc.trolltech.com/qhboxlayout.html}{QHBoxLayout}).
|
(\l{http://doc.qt.nokia.com/4.7-snapshot/qhboxlayout.html}{QHBoxLayout}).
|
||||||
|
|
||||||
\image qtcreator-texfinder-ui-horizontal-layout.png "Applying horizontal layout"
|
\image qtcreator-texfinder-ui-horizontal-layout.png "Applying horizontal layout"
|
||||||
|
|
||||||
\o Drag and drop a \gui{Text Edit} widget (\l{http://doc.trolltech.com/qtextedit.html}{QTextEdit})
|
\o Drag and drop a \gui{Text Edit} widget (\l{http://doc.qt.nokia.com/4.7-snapshot/qtextedit.html}{QTextEdit})
|
||||||
to the form.
|
to the form.
|
||||||
|
|
||||||
\o Select the screen area and click \gui{Lay out Vertically} (or press \gui{Ctr+V})
|
\o Select the screen area and click \gui{Lay out Vertically} (or press \gui{Ctr+V})
|
||||||
to apply a vertical layout (\l{http://doc.trolltech.com/qvboxlayout.html}{QVBoxLayout}).
|
to apply a vertical layout (\l{http://doc.qt.nokia.com/4.7-snapshot/qvboxlayout.html}{QVBoxLayout}).
|
||||||
|
|
||||||
\image qtcreator-textfinder-ui.png "Text Finder UI"
|
\image qtcreator-textfinder-ui.png "Text Finder UI"
|
||||||
|
|
||||||
@@ -2715,7 +3082,7 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
For more information about designing forms with \QD, see the
|
For more information about designing forms with \QD, see the
|
||||||
\l{http://doc.trolltech.com/designer-manual.html}{Qt Designer Manual}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/designer-manual.html}{Qt Designer Manual}.
|
||||||
|
|
||||||
\section2 Completing the Header File
|
\section2 Completing the Header File
|
||||||
|
|
||||||
@@ -2723,7 +3090,7 @@
|
|||||||
constructor, a destructor, and the \c{Ui} object. You need to add a private
|
constructor, a destructor, and the \c{Ui} object. You need to add a private
|
||||||
function, \c{loadTextFile()}, to read and display the
|
function, \c{loadTextFile()}, to read and display the
|
||||||
contents of the input text file in the
|
contents of the input text file in the
|
||||||
\l{http://doc.trolltech.com/qtextedit.html}{QTextEdit}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qtextedit.html}{QTextEdit}.
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
@@ -2749,22 +3116,22 @@
|
|||||||
to open it for editing.
|
to open it for editing.
|
||||||
|
|
||||||
\o Add code to load a text file using
|
\o Add code to load a text file using
|
||||||
\l{http://doc.trolltech.com/qfile.html}{QFile}, read it with
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qfile.html}{QFile}, read it with
|
||||||
\l{http://doc.trolltech.com/qtextstream.html}{QTextStream}, and
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qtextstream.html}{QTextStream}, and
|
||||||
then display it on \c{textEdit} with
|
then display it on \c{textEdit} with
|
||||||
\l{http://doc.trolltech.com/qtextedit.html#plainText-prop}{setPlainText()}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qtextedit.html#plainText-prop}{setPlainText()}.
|
||||||
This is illustrated by the following code snippet:
|
This is illustrated by the following code snippet:
|
||||||
|
|
||||||
\snippet examples/textfinder/textfinder.cpp 0
|
\snippet examples/textfinder/textfinder.cpp 0
|
||||||
|
|
||||||
\o To use \l{http://doc.trolltech.com/qfile.html}{QFile} and
|
\o To use \l{http://doc.qt.nokia.com/4.7-snapshot/qfile.html}{QFile} and
|
||||||
\l{http://doc.trolltech.com/qtextstream.html}{QTextStream}, add the
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qtextstream.html}{QTextStream}, add the
|
||||||
following #includes to textfinder.cpp:
|
following #includes to textfinder.cpp:
|
||||||
|
|
||||||
\snippet examples/textfinder/textfinder.cpp 1
|
\snippet examples/textfinder/textfinder.cpp 1
|
||||||
|
|
||||||
\o For the \c{on_findButton_clicked()} slot, add code to extract the search string and
|
\o For the \c{on_findButton_clicked()} slot, add code to extract the search string and
|
||||||
use the \l{http://doc.trolltech.com/qtextedit.html#find}{find()} function
|
use the \l{http://doc.qt.nokia.com/4.7-snapshot/qtextedit.html#find}{find()} function
|
||||||
to look for the search string within the text file. This is illustrated by
|
to look for the search string within the text file. This is illustrated by
|
||||||
the following code snippet:
|
the following code snippet:
|
||||||
|
|
||||||
@@ -2793,7 +3160,7 @@
|
|||||||
|
|
||||||
To add a resource file:
|
To add a resource file:
|
||||||
\list 1
|
\list 1
|
||||||
\o Select \gui{File > New File or Project > Qt > Qt Resource File > OK}.
|
\o Select \gui{File > New File or Project > Qt > Qt Resource File > Choose}.
|
||||||
\image qtcreator-add-resource-wizard.png "New File or Project dialog"
|
\image qtcreator-add-resource-wizard.png "New File or Project dialog"
|
||||||
|
|
||||||
The \gui {Choose the Location} dialog opens.
|
The \gui {Choose the Location} dialog opens.
|
||||||
@@ -3220,7 +3587,7 @@
|
|||||||
\key Space. The prefix is usually a single character.
|
\key Space. The prefix is usually a single character.
|
||||||
|
|
||||||
For example, to locate symbols matching
|
For example, to locate symbols matching
|
||||||
\l{http://doc.trolltech.com/qdatastream.html}{QDataStream:}
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qdatastream.html}{QDataStream:}
|
||||||
\list 1
|
\list 1
|
||||||
\o Activate the locator.
|
\o Activate the locator.
|
||||||
\o Enter \tt{\bold{: QDataStream}} (: (colon) followed by a
|
\o Enter \tt{\bold{: QDataStream}} (: (colon) followed by a
|
||||||
@@ -4223,7 +4590,7 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\o Click in between the line number and the window border on the line
|
\o Click in between the line number and the window border on the line
|
||||||
where we invoke \l{http://doc.trolltech.com/qtextedit.html#plainText-prop}{setPlainText()}
|
where we invoke \l{http://doc.qt.nokia.com/4.7-snapshot/qtextedit.html#plainText-prop}{setPlainText()}
|
||||||
to set a breakpoint.
|
to set a breakpoint.
|
||||||
|
|
||||||
\image qtcreator-setting-breakpoint1.png
|
\image qtcreator-setting-breakpoint1.png
|
||||||
@@ -4797,9 +5164,13 @@
|
|||||||
|
|
||||||
You can either create Qt Quick projects from scratch or import them to
|
You can either create Qt Quick projects from scratch or import them to
|
||||||
Qt Creator. For example, you can import and run the
|
Qt Creator. For example, you can import and run the
|
||||||
\l {http://qt.nokia.com/doc/4.7-snapshot/qdeclarativeexamples.html} {QML examples and demos}
|
\l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeexamples.html} {QML examples and demos}
|
||||||
to learn how to use various aspects of QML.
|
to learn how to use various aspects of QML.
|
||||||
|
|
||||||
|
\note The Qt Quick specific features and the QDeclarative help are based on a
|
||||||
|
preview version of the QtDeclarative package. Update Qt Creator when Qt 4.7 is
|
||||||
|
released.
|
||||||
|
|
||||||
You can use the code editor (\gui Edit mode) or the visual editor
|
You can use the code editor (\gui Edit mode) or the visual editor
|
||||||
(\gui Design mode) to develop Qt Quick applications.
|
(\gui Design mode) to develop Qt Quick applications.
|
||||||
|
|
||||||
@@ -4829,7 +5200,7 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The \c import statement in the beginning of the .qml file specifies the
|
The \c import statement in the beginning of the .qml file specifies the
|
||||||
\l {http://qt.nokia.com/doc/4.7-snapshot/qdeclarativemodules.html} {Qt modules}
|
\l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodules.html} {Qt modules}
|
||||||
to import to \QMLD. Each Qt module contains a set of default elements.
|
to import to \QMLD. Each Qt module contains a set of default elements.
|
||||||
Specify a version to get the features you want.
|
Specify a version to get the features you want.
|
||||||
|
|
||||||
@@ -4855,22 +5226,22 @@
|
|||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-borderimage.html}{Border Image}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-borderimage.html}{Border Image}
|
||||||
uses an image as a border or background.
|
uses an image as a border or background.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-image.html}{Image}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-image.html}{Image}
|
||||||
adds a bitmap to the scene. You can stretch and tile images.
|
adds a bitmap to the scene. You can stretch and tile images.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-item.html}{Item}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-item.html}{Item}
|
||||||
is the most basic of all visual items in QML. Even though it has no visual appearance,
|
is the most basic of all visual items in QML. Even though it has no visual appearance,
|
||||||
it defines all the properties that are common across visual items, such as the x and
|
it defines all the properties that are common across visual items, such as the x and
|
||||||
y position, width and height, anchoring, and key handling.
|
y position, width and height, anchoring, and key handling.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-rectangle.html}{Rectangle}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-rectangle.html}{Rectangle}
|
||||||
adds a rectangle that is painted with a solid fill color and an optional border.
|
adds a rectangle that is painted with a solid fill color and an optional border.
|
||||||
You can also use the radius property to create rounded rectangles.
|
You can also use the radius property to create rounded rectangles.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-text.html}{Text}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-text.html}{Text}
|
||||||
adds formatted read-only text.
|
adds formatted read-only text.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-textedit.html}{Text Edit}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-textedit.html}{Text Edit}
|
||||||
adds a single line of editable formatted text that can be validated.
|
adds a single line of editable formatted text that can be validated.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-textinput.html}{Text Input}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-textinput.html}{Text Input}
|
||||||
adds a single line of editable plain text that can be validated.
|
adds a single line of editable plain text that can be validated.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
@@ -4941,12 +5312,12 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To create a graphical button that scales beautifully without using vector graphics,
|
To create a graphical button that scales beautifully without using vector graphics,
|
||||||
use the \l{http://qt.nokia.com/doc/4.7-snapshot/qml-borderimage.html}{Border Image}
|
use the \l{http://doc.qt.nokia.com/4.7-snapshot/qml-borderimage.html}{Border Image}
|
||||||
element.
|
element.
|
||||||
|
|
||||||
\section3 Creating Scalable Buttons and Borders
|
\section3 Creating Scalable Buttons and Borders
|
||||||
|
|
||||||
You can use the \l{http://qt.nokia.com/doc/4.7-snapshot/qml-borderimage.html}{Border Image}
|
You can use the \l{http://doc.qt.nokia.com/4.7-snapshot/qml-borderimage.html}{Border Image}
|
||||||
element to display an image, such as a PNG file, as a border and a background.
|
element to display an image, such as a PNG file, as a border and a background.
|
||||||
|
|
||||||
Use two Border Image elements and suitable graphics to make it look like the button
|
Use two Border Image elements and suitable graphics to make it look like the button
|
||||||
@@ -5100,13 +5471,13 @@
|
|||||||
You can use the \gui Library items and your own components to create screens.
|
You can use the \gui Library items and your own components to create screens.
|
||||||
|
|
||||||
You can create the following types of views to organize items provided by
|
You can create the following types of views to organize items provided by
|
||||||
\l{http://qt.nokia.com/doc/4.7-snapshot/qdeclarativemodels.html}{data models}:
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qdeclarativemodels.html}{data models}:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-gridview.html}{Grid View}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-gridview.html}{Grid View}
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-listview.html}{List View}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-listview.html}{List View}
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-pathview.html}{Path View}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-pathview.html}{Path View}
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -5247,7 +5618,7 @@
|
|||||||
You can use different types of animated transitions. For example, you can animate changes
|
You can use different types of animated transitions. For example, you can animate changes
|
||||||
to property values and colors. You can use rotation animation to control the direction of
|
to property values and colors. You can use rotation animation to control the direction of
|
||||||
rotation. For more information, see
|
rotation. For more information, see
|
||||||
\l{http://doc.trolltech.com/4.7-snapshot/qdeclarativeanimation.html}{QML Animation}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html}{QML Animation}.
|
||||||
|
|
||||||
You can use the \c ParallelAnimation element to start several animations at the same time.
|
You can use the \c ParallelAnimation element to start several animations at the same time.
|
||||||
Or use the \c SequentialAnimation element to run them one after another.
|
Or use the \c SequentialAnimation element to run them one after another.
|
||||||
@@ -5260,14 +5631,14 @@
|
|||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-flickable.html}{Flickable}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-flickable.html}{Flickable}
|
||||||
items can be flicked horizontally or vertically.
|
items can be flicked horizontally or vertically.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-flipable.html}{Flipable}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-flipable.html}{Flipable}
|
||||||
items can be flipped between their front and back sides by using rotation,
|
items can be flipped between their front and back sides by using rotation,
|
||||||
state, and transition.
|
state, and transition.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-focusscope.html}{Focus Scope}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-focusscope.html}{Focus Scope}
|
||||||
assists in keyboard focus handling when building reusable QML components.
|
assists in keyboard focus handling when building reusable QML components.
|
||||||
\o \l{http://qt.nokia.com/doc/4.7-snapshot/qml-mousearea.html}{Mouse Area}
|
\o \l{http://doc.qt.nokia.com/4.7-snapshot/qml-mousearea.html}{Mouse Area}
|
||||||
enables simple mouse handling.
|
enables simple mouse handling.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
@@ -5283,10 +5654,10 @@
|
|||||||
A user interface is only a part of an application, and not really useful by itself.
|
A user interface is only a part of an application, and not really useful by itself.
|
||||||
You can use Qt or JavaScript to implement the application logic. For more information on
|
You can use Qt or JavaScript to implement the application logic. For more information on
|
||||||
using JavaScript, see
|
using JavaScript, see
|
||||||
\l {http://qt.nokia.com/doc/4.7-snapshot/qdeclarativejavascript.html} {Integrating JavaScript}.
|
\l {http://doc.qt.nokia.com/4.7-snapshot/qdeclarativejavascript.html} {Integrating JavaScript}.
|
||||||
|
|
||||||
For an example of how to use JavaScript to develop a game, see the
|
For an example of how to use JavaScript to develop a game, see the
|
||||||
\l {http://qt.nokia.com/doc/4.7-snapshot/qml-advtutorial.html} {QML Advanced Tutorial}.
|
\l {http://doc.qt.nokia.com/4.7-snapshot/qml-advtutorial.html} {QML Advanced Tutorial}.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -5317,7 +5688,8 @@
|
|||||||
|
|
||||||
To build and run Qt applications for Maemo, you need the following:
|
To build and run Qt applications for Maemo, you need the following:
|
||||||
\list
|
\list
|
||||||
\o Nokia N900 device with PR1.2 or later installed.
|
\o Nokia N900 device with software update release 1.2 (V10.2010.19-1)
|
||||||
|
or later installed.
|
||||||
\o MADDE cross-platform Maemo development
|
\o MADDE cross-platform Maemo development
|
||||||
tool (installed as part of the Nokia Qt SDK).
|
tool (installed as part of the Nokia Qt SDK).
|
||||||
|
|
||||||
@@ -5335,7 +5707,6 @@
|
|||||||
PC_Connectivity_<version>.exe (at the time of writing,
|
PC_Connectivity_<version>.exe (at the time of writing,
|
||||||
PC_Connectivity_0.9.4.exe).
|
PC_Connectivity_0.9.4.exe).
|
||||||
|
|
||||||
\o Qt installed on the device. Recent images should have Qt pre-installed.
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The Qt Creator/MADDE integration is supported on the following platforms:
|
The Qt Creator/MADDE integration is supported on the following platforms:
|
||||||
@@ -5370,38 +5741,13 @@
|
|||||||
|
|
||||||
\section2 Installing and Configuring Mad Developer
|
\section2 Installing and Configuring Mad Developer
|
||||||
|
|
||||||
To install Mad Developer on your device, you need to add an application
|
Install Mad Developer on a device and configure
|
||||||
catalogue to the list of catalogues your device checks for
|
|
||||||
installable software, and install the actual Mad Developer software
|
|
||||||
package. After the installation, you must start Mad Developer and configure
|
|
||||||
a connection between the development PC and the device.
|
a connection between the development PC and the device.
|
||||||
|
|
||||||
To install and configure Mad Developer:
|
To install and configure Mad Developer:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\o On the Nokia N900, select \gui {Application manager > Application catalogs
|
\o On the Nokia N900, select \gui{Download} > \gui{Development} > \gui{mad-developer}
|
||||||
> New}.
|
|
||||||
|
|
||||||
\o Specify the following settings:
|
|
||||||
|
|
||||||
\image qtcreator-app-manager-extras-devel-screenshot.png
|
|
||||||
|
|
||||||
\list a
|
|
||||||
|
|
||||||
\o \gui {Catalogue name}: \bold devel
|
|
||||||
|
|
||||||
\o \gui {Web address}:
|
|
||||||
\l http://repository.maemo.org/extras-devel
|
|
||||||
|
|
||||||
\o \gui Distribution: \bold fremantle
|
|
||||||
|
|
||||||
\o \gui Components: \bold {free non-free}
|
|
||||||
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
\o Click \gui Save to add the catalogue.
|
|
||||||
|
|
||||||
\o Select \gui{Download} > \gui{Development} > \gui{mad-developer}
|
|
||||||
to install the Mad Developer software package.
|
to install the Mad Developer software package.
|
||||||
\o Click \gui {Mad Developer} to start the Mad Developer application.
|
\o Click \gui {Mad Developer} to start the Mad Developer application.
|
||||||
|
|
||||||
@@ -5537,7 +5883,8 @@
|
|||||||
must generate it in Mad Developer and enter it in Qt Creator every time
|
must generate it in Mad Developer and enter it in Qt Creator every time
|
||||||
you connect to the Maemo emulator or to a device.
|
you connect to the Maemo emulator or to a device.
|
||||||
|
|
||||||
If you do not have an SSH key, you can create it in Qt Creator. For more
|
If you do not have an SSH key, you can create it in Qt Creator.
|
||||||
|
Encrypted keys are not supported. For more
|
||||||
information, see \l{Generating SSH Keys}.
|
information, see \l{Generating SSH Keys}.
|
||||||
|
|
||||||
To configure connections between Qt Creator and the Maemo emulator or
|
To configure connections between Qt Creator and the Maemo emulator or
|
||||||
@@ -5689,11 +6036,10 @@
|
|||||||
|
|
||||||
The Maemo emulator emulates the Nokia N900 device environment. You can test
|
The Maemo emulator emulates the Nokia N900 device environment. You can test
|
||||||
applications in conditions practically identical to running the application
|
applications in conditions practically identical to running the application
|
||||||
on a Nokia N900 device. You can test user interaction by using the keypad and
|
on a Nokia N900 device with software update release 1.2 (V10.2010.19-1).
|
||||||
|
You can test user interaction by using the keypad and
|
||||||
touch emulation.
|
touch emulation.
|
||||||
|
|
||||||
\note The Maemo emulator support requires the Nokia N900 PR1.2 update.
|
|
||||||
|
|
||||||
To test the application UI, user interaction with the application, and
|
To test the application UI, user interaction with the application, and
|
||||||
functionality that uses the mobility APIs, use the Qt Simulator,
|
functionality that uses the mobility APIs, use the Qt Simulator,
|
||||||
instead. For more information, see the
|
instead. For more information, see the
|
||||||
@@ -5707,7 +6053,9 @@
|
|||||||
\section1 Starting the Maemo Emulator
|
\section1 Starting the Maemo Emulator
|
||||||
|
|
||||||
The \gui {Start Maemo Emulator} button is visible if you have a project
|
The \gui {Start Maemo Emulator} button is visible if you have a project
|
||||||
open in Qt Creator for which you have added the Maemo build target.
|
open in Qt Creator for which you have added the Maemo build target
|
||||||
|
and if you have configured a connection between Qt Creator and the Maemo
|
||||||
|
Emulator.
|
||||||
|
|
||||||
To start the Maemo emulator:
|
To start the Maemo emulator:
|
||||||
|
|
||||||
@@ -5835,12 +6183,41 @@
|
|||||||
\o The \l{http://tools.ext.nokia.com/trk/}{App TRK} application for
|
\o The \l{http://tools.ext.nokia.com/trk/}{App TRK} application for
|
||||||
your device
|
your device
|
||||||
\o The \e{qt_installer.sis} package installed on the device, that is
|
\o The \e{qt_installer.sis} package installed on the device, that is
|
||||||
bundled with the binary Qt distribution
|
delivered with the Qt SDK.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To run your applications in the Symbian emulator, you also need
|
To run your applications in the Symbian emulator, you also need
|
||||||
to install Carbide.c++ v2.0.0 or higher.
|
to install Carbide.c++ v2.0.0 or higher.
|
||||||
|
|
||||||
|
\section1 Installing Required Applications on Devices
|
||||||
|
|
||||||
|
The Nokia Qt SDK installation program creates shortcuts for installing
|
||||||
|
the required applications on Symbian devices (you can also use any of
|
||||||
|
the standard methods for installing applications on devices):
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\o Connect the device to the development PC with an USB cable in
|
||||||
|
PC Suite Mode. If you have not previously used the device with Ovi Suite
|
||||||
|
or PC Suite, all the necessary drivers are installed automatically.
|
||||||
|
This takes approximately one minute.
|
||||||
|
|
||||||
|
\o Choose \gui {Start > Nokia Qt SDK > Symbian > Install Qt to Symbian
|
||||||
|
device} and follow the instructions on the screen to install Qt 4.6.2
|
||||||
|
libraries on the device.
|
||||||
|
|
||||||
|
\o Choose \gui {Start > Nokia Qt SDK > Symbian > Install QtMobility to Symbian
|
||||||
|
device} and follow the instructions on the screen to install Qt
|
||||||
|
mobility libraries on the device.
|
||||||
|
|
||||||
|
\o Choose \gui {Start > Nokia Qt SDK > Symbian > Install TRK to Symbian
|
||||||
|
device} and follow the instructions on the screen to install the TRK
|
||||||
|
debugging application for S60 5th Edition devices on the device.
|
||||||
|
|
||||||
|
\o Start TRK on the device.
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
\section1 Adding Symbian Platform SDKs
|
\section1 Adding Symbian Platform SDKs
|
||||||
|
|
||||||
Nokia Qt SDK contains all the tools you need for developing Qt applications for
|
Nokia Qt SDK contains all the tools you need for developing Qt applications for
|
||||||
@@ -5904,7 +6281,7 @@
|
|||||||
change the default plugin path, see \l{How to Create Qt Plugins}.
|
change the default plugin path, see \l{How to Create Qt Plugins}.
|
||||||
|
|
||||||
For more information about how to create plugins for \QD, see
|
For more information about how to create plugins for \QD, see
|
||||||
\l{http://doc.trolltech.com/4.6/designer-using-custom-widgets.html}{Creating and Using Components for Qt Designer}.
|
\l{http://doc.qt.nokia.com/4.7-snapshot/designer-using-custom-widgets.html}{Creating and Using Components for Qt Designer}.
|
||||||
|
|
||||||
\section1 Locating Qt Designer Plugins
|
\section1 Locating Qt Designer Plugins
|
||||||
|
|
||||||
|
|||||||
@@ -1214,8 +1214,15 @@ class Dumper:
|
|||||||
type = value.type
|
type = value.type
|
||||||
|
|
||||||
if type.code == gdb.TYPE_CODE_REF:
|
if type.code == gdb.TYPE_CODE_REF:
|
||||||
|
try:
|
||||||
|
# This throws "RuntimeError: Attempt to dereference a
|
||||||
|
# generic pointer." with MinGW's gcc 4.5 when it "identifies"
|
||||||
|
# a "QWidget &" as "void &".
|
||||||
type = type.target()
|
type = type.target()
|
||||||
value = value.cast(type)
|
value = value.cast(type)
|
||||||
|
except RuntimeError:
|
||||||
|
value = item.value
|
||||||
|
type = value.type
|
||||||
|
|
||||||
if type.code == gdb.TYPE_CODE_TYPEDEF:
|
if type.code == gdb.TYPE_CODE_TYPEDEF:
|
||||||
type = type.target()
|
type = type.target()
|
||||||
|
|||||||
@@ -1,5 +1,91 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module>
|
<module>
|
||||||
|
<type name="QAbstractItemModel" extends="Qt.QtObject">
|
||||||
|
<signal name="dataChanged">
|
||||||
|
<param name="topLeft" type="QModelIndex"/>
|
||||||
|
<param name="bottomRight" type="QModelIndex"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="headerDataChanged">
|
||||||
|
<param name="orientation" type="Qt.Orientation"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="layoutChanged"/>
|
||||||
|
<signal name="layoutAboutToBeChanged"/>
|
||||||
|
<signal name="rowsAboutToBeInserted">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="rowsInserted">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="rowsAboutToBeRemoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="rowsRemoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsAboutToBeInserted">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsInserted">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsAboutToBeRemoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsRemoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="first" type="int"/>
|
||||||
|
<param name="last" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="modelAboutToBeReset"/>
|
||||||
|
<signal name="modelReset"/>
|
||||||
|
<signal name="rowsAboutToBeMoved">
|
||||||
|
<param name="sourceParent" type="QModelIndex"/>
|
||||||
|
<param name="sourceStart" type="int"/>
|
||||||
|
<param name="sourceEnd" type="int"/>
|
||||||
|
<param name="destinationParent" type="QModelIndex"/>
|
||||||
|
<param name="destinationRow" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="rowsMoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="start" type="int"/>
|
||||||
|
<param name="end" type="int"/>
|
||||||
|
<param name="destination" type="QModelIndex"/>
|
||||||
|
<param name="row" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsAboutToBeMoved">
|
||||||
|
<param name="sourceParent" type="QModelIndex"/>
|
||||||
|
<param name="sourceStart" type="int"/>
|
||||||
|
<param name="sourceEnd" type="int"/>
|
||||||
|
<param name="destinationParent" type="QModelIndex"/>
|
||||||
|
<param name="destinationColumn" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="columnsMoved">
|
||||||
|
<param name="parent" type="QModelIndex"/>
|
||||||
|
<param name="start" type="int"/>
|
||||||
|
<param name="end" type="int"/>
|
||||||
|
<param name="destination" type="QModelIndex"/>
|
||||||
|
<param name="column" type="int"/>
|
||||||
|
</signal>
|
||||||
|
<method name="submit" type="bool"/>
|
||||||
|
<method name="revert"/>
|
||||||
|
</type>
|
||||||
|
<type name="QAbstractListModel" extends="QAbstractItemModel"/>
|
||||||
<type name="QAction" extends="Qt.QtObject">
|
<type name="QAction" extends="Qt.QtObject">
|
||||||
<enum name="MenuRole">
|
<enum name="MenuRole">
|
||||||
<enumerator name="NoRole" value="0"/>
|
<enumerator name="NoRole" value="0"/>
|
||||||
@@ -1466,7 +1552,7 @@
|
|||||||
<signal name="progressChanged">
|
<signal name="progressChanged">
|
||||||
<param type="qreal"/>
|
<param type="qreal"/>
|
||||||
</signal>
|
</signal>
|
||||||
<method name="errorsString" type="string"/>
|
<method name="errorString" type="string"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.Connections" version="4.7" extends="Qt.QtObject">
|
<type name="Qt.Connections" version="4.7" extends="Qt.QtObject">
|
||||||
<property name="target" type="Qt.QtObject"/>
|
<property name="target" type="Qt.QtObject"/>
|
||||||
@@ -2214,12 +2300,12 @@
|
|||||||
<type name="Qt.ParentChange" version="4.7" extends="QDeclarativeStateOperation">
|
<type name="Qt.ParentChange" version="4.7" extends="QDeclarativeStateOperation">
|
||||||
<property name="target" type="Qt.Item"/>
|
<property name="target" type="Qt.Item"/>
|
||||||
<property name="parent" type="Qt.Item"/>
|
<property name="parent" type="Qt.Item"/>
|
||||||
<property name="x" type="qreal"/>
|
<property name="x" type="QDeclarativeScriptString"/>
|
||||||
<property name="y" type="qreal"/>
|
<property name="y" type="QDeclarativeScriptString"/>
|
||||||
<property name="width" type="qreal"/>
|
<property name="width" type="QDeclarativeScriptString"/>
|
||||||
<property name="height" type="qreal"/>
|
<property name="height" type="QDeclarativeScriptString"/>
|
||||||
<property name="scale" type="qreal"/>
|
<property name="scale" type="QDeclarativeScriptString"/>
|
||||||
<property name="rotation" type="qreal"/>
|
<property name="rotation" type="QDeclarativeScriptString"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.Path" version="4.7" defaultProperty="pathElements" extends="Qt.QtObject">
|
<type name="Qt.Path" version="4.7" defaultProperty="pathElements" extends="Qt.QtObject">
|
||||||
<property name="pathElements" type="QDeclarativePathElement" isList="true"/>
|
<property name="pathElements" type="QDeclarativePathElement" isList="true"/>
|
||||||
@@ -2555,6 +2641,7 @@
|
|||||||
<enumerator name="WordWrap" value="1"/>
|
<enumerator name="WordWrap" value="1"/>
|
||||||
<enumerator name="WrapAnywhere" value="3"/>
|
<enumerator name="WrapAnywhere" value="3"/>
|
||||||
<enumerator name="WrapAtWordBoundaryOrAnywhere" value="4"/>
|
<enumerator name="WrapAtWordBoundaryOrAnywhere" value="4"/>
|
||||||
|
<enumerator name="Wrap" value="4"/>
|
||||||
</enum>
|
</enum>
|
||||||
<property name="text" type="string"/>
|
<property name="text" type="string"/>
|
||||||
<property name="font" type="QFont"/>
|
<property name="font" type="QFont"/>
|
||||||
@@ -2566,6 +2653,8 @@
|
|||||||
<property name="wrapMode" type="WrapMode"/>
|
<property name="wrapMode" type="WrapMode"/>
|
||||||
<property name="textFormat" type="TextFormat"/>
|
<property name="textFormat" type="TextFormat"/>
|
||||||
<property name="elide" type="TextElideMode"/>
|
<property name="elide" type="TextElideMode"/>
|
||||||
|
<property name="paintedWidth" type="qreal"/>
|
||||||
|
<property name="paintedHeight" type="qreal"/>
|
||||||
<signal name="textChanged">
|
<signal name="textChanged">
|
||||||
<param name="text" type="string"/>
|
<param name="text" type="string"/>
|
||||||
</signal>
|
</signal>
|
||||||
@@ -2597,6 +2686,7 @@
|
|||||||
<signal name="elideModeChanged">
|
<signal name="elideModeChanged">
|
||||||
<param name="mode" type="TextElideMode"/>
|
<param name="mode" type="TextElideMode"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
<signal name="paintedSizeChanged"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.TextEdit" version="4.7" defaultProperty="data" extends="QDeclarativePaintedItem">
|
<type name="Qt.TextEdit" version="4.7" defaultProperty="data" extends="QDeclarativePaintedItem">
|
||||||
<enum name="HAlignment">
|
<enum name="HAlignment">
|
||||||
@@ -2619,6 +2709,7 @@
|
|||||||
<enumerator name="WordWrap" value="1"/>
|
<enumerator name="WordWrap" value="1"/>
|
||||||
<enumerator name="WrapAnywhere" value="3"/>
|
<enumerator name="WrapAnywhere" value="3"/>
|
||||||
<enumerator name="WrapAtWordBoundaryOrAnywhere" value="4"/>
|
<enumerator name="WrapAtWordBoundaryOrAnywhere" value="4"/>
|
||||||
|
<enumerator name="Wrap" value="4"/>
|
||||||
</enum>
|
</enum>
|
||||||
<property name="text" type="string"/>
|
<property name="text" type="string"/>
|
||||||
<property name="color" type="QColor"/>
|
<property name="color" type="QColor"/>
|
||||||
@@ -2628,22 +2719,29 @@
|
|||||||
<property name="horizontalAlignment" type="HAlignment"/>
|
<property name="horizontalAlignment" type="HAlignment"/>
|
||||||
<property name="verticalAlignment" type="VAlignment"/>
|
<property name="verticalAlignment" type="VAlignment"/>
|
||||||
<property name="wrapMode" type="WrapMode"/>
|
<property name="wrapMode" type="WrapMode"/>
|
||||||
|
<property name="paintedWidth" type="qreal"/>
|
||||||
|
<property name="paintedHeight" type="qreal"/>
|
||||||
<property name="textFormat" type="TextFormat"/>
|
<property name="textFormat" type="TextFormat"/>
|
||||||
<property name="readOnly" type="bool"/>
|
<property name="readOnly" type="bool"/>
|
||||||
<property name="cursorVisible" type="bool"/>
|
<property name="cursorVisible" type="bool"/>
|
||||||
<property name="cursorPosition" type="int"/>
|
<property name="cursorPosition" type="int"/>
|
||||||
|
<property name="cursorRectangle" type="QRect"/>
|
||||||
<property name="cursorDelegate" type="Qt.Component"/>
|
<property name="cursorDelegate" type="Qt.Component"/>
|
||||||
<property name="selectionStart" type="int"/>
|
<property name="selectionStart" type="int"/>
|
||||||
<property name="selectionEnd" type="int"/>
|
<property name="selectionEnd" type="int"/>
|
||||||
<property name="selectedText" type="string"/>
|
<property name="selectedText" type="string"/>
|
||||||
<property name="focusOnPress" type="bool"/>
|
<property name="focusOnPress" type="bool"/>
|
||||||
|
<property name="showInputPanelOnFocus" type="bool"/>
|
||||||
<property name="persistentSelection" type="bool"/>
|
<property name="persistentSelection" type="bool"/>
|
||||||
<property name="textMargin" type="qreal"/>
|
<property name="textMargin" type="qreal"/>
|
||||||
<property name="inputMethodHints" type="Qt.InputMethodHints"/>
|
<property name="inputMethodHints" type="Qt.InputMethodHints"/>
|
||||||
|
<property name="selectByMouse" type="bool"/>
|
||||||
<signal name="textChanged">
|
<signal name="textChanged">
|
||||||
<param type="string"/>
|
<param type="string"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
<signal name="paintedSizeChanged"/>
|
||||||
<signal name="cursorPositionChanged"/>
|
<signal name="cursorPositionChanged"/>
|
||||||
|
<signal name="cursorRectangleChanged"/>
|
||||||
<signal name="selectionStartChanged"/>
|
<signal name="selectionStartChanged"/>
|
||||||
<signal name="selectionEndChanged"/>
|
<signal name="selectionEndChanged"/>
|
||||||
<signal name="selectionChanged"/>
|
<signal name="selectionChanged"/>
|
||||||
@@ -2685,7 +2783,15 @@
|
|||||||
<signal name="textMarginChanged">
|
<signal name="textMarginChanged">
|
||||||
<param name="textMargin" type="qreal"/>
|
<param name="textMargin" type="qreal"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
<signal name="selectByMouseChanged">
|
||||||
|
<param name="selectByMouse" type="bool"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="showInputPanelOnFocusChanged">
|
||||||
|
<param name="showOnFocus" type="bool"/>
|
||||||
|
</signal>
|
||||||
<method name="selectAll"/>
|
<method name="selectAll"/>
|
||||||
|
<method name="openSoftwareInputPanel"/>
|
||||||
|
<method name="closeSoftwareInputPanel"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.TextInput" version="4.7" defaultProperty="data" extends="QDeclarativePaintedItem">
|
<type name="Qt.TextInput" version="4.7" defaultProperty="data" extends="QDeclarativePaintedItem">
|
||||||
<enum name="EchoMode">
|
<enum name="EchoMode">
|
||||||
@@ -2720,9 +2826,11 @@
|
|||||||
<property name="acceptableInput" type="bool"/>
|
<property name="acceptableInput" type="bool"/>
|
||||||
<property name="echoMode" type="EchoMode"/>
|
<property name="echoMode" type="EchoMode"/>
|
||||||
<property name="focusOnPress" type="bool"/>
|
<property name="focusOnPress" type="bool"/>
|
||||||
|
<property name="showInputPanelOnFocus" type="bool"/>
|
||||||
<property name="passwordCharacter" type="string"/>
|
<property name="passwordCharacter" type="string"/>
|
||||||
<property name="displayText" type="string"/>
|
<property name="displayText" type="string"/>
|
||||||
<property name="autoScroll" type="bool"/>
|
<property name="autoScroll" type="bool"/>
|
||||||
|
<property name="selectByMouse" type="bool"/>
|
||||||
<signal name="textChanged"/>
|
<signal name="textChanged"/>
|
||||||
<signal name="cursorPositionChanged"/>
|
<signal name="cursorPositionChanged"/>
|
||||||
<signal name="selectionStartChanged"/>
|
<signal name="selectionStartChanged"/>
|
||||||
@@ -2772,6 +2880,12 @@
|
|||||||
<signal name="autoScrollChanged">
|
<signal name="autoScrollChanged">
|
||||||
<param name="autoScroll" type="bool"/>
|
<param name="autoScroll" type="bool"/>
|
||||||
</signal>
|
</signal>
|
||||||
|
<signal name="selectByMouseChanged">
|
||||||
|
<param name="selectByMouse" type="bool"/>
|
||||||
|
</signal>
|
||||||
|
<signal name="showInputPanelOnFocusChanged">
|
||||||
|
<param name="showOnFocus" type="bool"/>
|
||||||
|
</signal>
|
||||||
<method name="selectAll"/>
|
<method name="selectAll"/>
|
||||||
<method name="xToPosition" type="int">
|
<method name="xToPosition" type="int">
|
||||||
<param name="x" type="int"/>
|
<param name="x" type="int"/>
|
||||||
@@ -2779,6 +2893,8 @@
|
|||||||
<method name="moveCursorSelection">
|
<method name="moveCursorSelection">
|
||||||
<param name="pos" type="int"/>
|
<param name="pos" type="int"/>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="openSoftwareInputPanel"/>
|
||||||
|
<method name="closeSoftwareInputPanel"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.Timer" version="4.7" extends="Qt.QtObject">
|
<type name="Qt.Timer" version="4.7" extends="Qt.QtObject">
|
||||||
<property name="interval" type="int"/>
|
<property name="interval" type="int"/>
|
||||||
@@ -2884,6 +3000,10 @@
|
|||||||
<signal name="queryChanged"/>
|
<signal name="queryChanged"/>
|
||||||
<signal name="namespaceDeclarationsChanged"/>
|
<signal name="namespaceDeclarationsChanged"/>
|
||||||
<method name="reload"/>
|
<method name="reload"/>
|
||||||
|
<method name="get" type="QScriptValue">
|
||||||
|
<param name="index" type="int"/>
|
||||||
|
</method>
|
||||||
|
<method name="errorString" type="string"/>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.XmlRole" version="4.7" extends="Qt.QtObject">
|
<type name="Qt.XmlRole" version="4.7" extends="Qt.QtObject">
|
||||||
<property name="name" type="string"/>
|
<property name="name" type="string"/>
|
||||||
@@ -2893,6 +3013,31 @@
|
|||||||
<signal name="queryChanged"/>
|
<signal name="queryChanged"/>
|
||||||
<signal name="isKeyChanged"/>
|
<signal name="isKeyChanged"/>
|
||||||
</type>
|
</type>
|
||||||
|
<type name="Qt.labs.folderlistmodel.FolderListModel" version="1.0" extends="QAbstractListModel">
|
||||||
|
<enum name="SortField">
|
||||||
|
<enumerator name="Unsorted" value="0"/>
|
||||||
|
<enumerator name="Name" value="1"/>
|
||||||
|
<enumerator name="Time" value="2"/>
|
||||||
|
<enumerator name="Size" value="3"/>
|
||||||
|
<enumerator name="Type" value="4"/>
|
||||||
|
</enum>
|
||||||
|
<property name="folder" type="QUrl"/>
|
||||||
|
<property name="parentFolder" type="QUrl"/>
|
||||||
|
<property name="nameFilters" type="QStringList"/>
|
||||||
|
<property name="sortField" type="SortField"/>
|
||||||
|
<property name="sortReversed" type="bool"/>
|
||||||
|
<property name="showDirs" type="bool"/>
|
||||||
|
<property name="showDotAndDotDot" type="bool"/>
|
||||||
|
<property name="showOnlyReadable" type="bool"/>
|
||||||
|
<property name="count" type="int"/>
|
||||||
|
<signal name="folderChanged"/>
|
||||||
|
<method name="isFolder" type="bool">
|
||||||
|
<param name="index" type="int"/>
|
||||||
|
</method>
|
||||||
|
</type>
|
||||||
|
<type name="Qt.labs.gestures.GestureArea" version="1.0" defaultProperty="data" extends="Qt.Item">
|
||||||
|
<property name="gesture" type="QGesture"/>
|
||||||
|
</type>
|
||||||
<type name="Qt.labs.particles.ParticleMotion" version="1.0" extends="Qt.QtObject"/>
|
<type name="Qt.labs.particles.ParticleMotion" version="1.0" extends="Qt.QtObject"/>
|
||||||
<type name="Qt.labs.particles.ParticleMotionGravity" version="1.0" extends="Qt.labs.particles.ParticleMotion">
|
<type name="Qt.labs.particles.ParticleMotionGravity" version="1.0" extends="Qt.labs.particles.ParticleMotion">
|
||||||
<property name="xattractor" type="qreal"/>
|
<property name="xattractor" type="qreal"/>
|
||||||
@@ -2947,169 +3092,6 @@
|
|||||||
<param name="count" type="int"/>
|
<param name="count" type="int"/>
|
||||||
</method>
|
</method>
|
||||||
</type>
|
</type>
|
||||||
<type name="Qt.multimedia.Audio" version="4.7" extends="Qt.QtObject">
|
|
||||||
<enum name="Status">
|
|
||||||
<enumerator name="UnknownStatus" value="0"/>
|
|
||||||
<enumerator name="NoMedia" value="1"/>
|
|
||||||
<enumerator name="Loading" value="2"/>
|
|
||||||
<enumerator name="Loaded" value="3"/>
|
|
||||||
<enumerator name="Stalled" value="4"/>
|
|
||||||
<enumerator name="Buffering" value="5"/>
|
|
||||||
<enumerator name="Buffered" value="6"/>
|
|
||||||
<enumerator name="EndOfMedia" value="7"/>
|
|
||||||
<enumerator name="InvalidMedia" value="8"/>
|
|
||||||
</enum>
|
|
||||||
<enum name="Error">
|
|
||||||
<enumerator name="NoError" value="0"/>
|
|
||||||
<enumerator name="ResourceError" value="1"/>
|
|
||||||
<enumerator name="FormatError" value="2"/>
|
|
||||||
<enumerator name="NetworkError" value="3"/>
|
|
||||||
<enumerator name="AccessDenied" value="4"/>
|
|
||||||
<enumerator name="ServiceMissing" value="5"/>
|
|
||||||
</enum>
|
|
||||||
<property name="source" type="QUrl"/>
|
|
||||||
<property name="autoLoad" type="bool"/>
|
|
||||||
<property name="playing" type="bool"/>
|
|
||||||
<property name="paused" type="bool"/>
|
|
||||||
<property name="status" type="Status"/>
|
|
||||||
<property name="duration" type="int"/>
|
|
||||||
<property name="position" type="int"/>
|
|
||||||
<property name="volume" type="qreal"/>
|
|
||||||
<property name="muted" type="bool"/>
|
|
||||||
<property name="bufferProgress" type="int"/>
|
|
||||||
<property name="seekable" type="bool"/>
|
|
||||||
<property name="playbackRate" type="qreal"/>
|
|
||||||
<property name="error" type="Error"/>
|
|
||||||
<property name="errorString" type="string"/>
|
|
||||||
<signal name="sourceChanged"/>
|
|
||||||
<signal name="autoLoadChanged"/>
|
|
||||||
<signal name="playingChanged"/>
|
|
||||||
<signal name="pausedChanged"/>
|
|
||||||
<signal name="started"/>
|
|
||||||
<signal name="resumed"/>
|
|
||||||
<signal name="paused"/>
|
|
||||||
<signal name="stopped"/>
|
|
||||||
<signal name="statusChanged"/>
|
|
||||||
<signal name="loaded"/>
|
|
||||||
<signal name="buffering"/>
|
|
||||||
<signal name="stalled"/>
|
|
||||||
<signal name="buffered"/>
|
|
||||||
<signal name="endOfMedia"/>
|
|
||||||
<signal name="durationChanged"/>
|
|
||||||
<signal name="positionChanged"/>
|
|
||||||
<signal name="volumeChanged"/>
|
|
||||||
<signal name="mutedChanged"/>
|
|
||||||
<signal name="bufferProgressChanged"/>
|
|
||||||
<signal name="seekableChanged"/>
|
|
||||||
<signal name="playbackRateChanged"/>
|
|
||||||
<signal name="errorChanged"/>
|
|
||||||
<signal name="error">
|
|
||||||
<param name="error" type="QDeclarativeAudio.Error"/>
|
|
||||||
<param name="errorString" type="string"/>
|
|
||||||
</signal>
|
|
||||||
<method name="play"/>
|
|
||||||
<method name="pause"/>
|
|
||||||
<method name="stop"/>
|
|
||||||
</type>
|
|
||||||
<type name="Qt.multimedia.SoundEffect" version="4.7" extends="Qt.QtObject">
|
|
||||||
<property name="source" type="QUrl"/>
|
|
||||||
<property name="loops" type="int"/>
|
|
||||||
<property name="volume" type="int"/>
|
|
||||||
<property name="muted" type="bool"/>
|
|
||||||
<signal name="sourceChanged"/>
|
|
||||||
<signal name="loopsChanged"/>
|
|
||||||
<signal name="volumeChanged"/>
|
|
||||||
<signal name="mutedChanged"/>
|
|
||||||
<method name="play"/>
|
|
||||||
</type>
|
|
||||||
<type name="Qt.multimedia.Video" version="4.7" defaultProperty="data" extends="Qt.Item">
|
|
||||||
<enum name="FillMode">
|
|
||||||
<enumerator name="Stretch" value="0"/>
|
|
||||||
<enumerator name="PreserveAspectFit" value="1"/>
|
|
||||||
<enumerator name="PreserveAspectCrop" value="2"/>
|
|
||||||
</enum>
|
|
||||||
<enum name="Status">
|
|
||||||
<enumerator name="UnknownStatus" value="0"/>
|
|
||||||
<enumerator name="NoMedia" value="1"/>
|
|
||||||
<enumerator name="Loading" value="2"/>
|
|
||||||
<enumerator name="Loaded" value="3"/>
|
|
||||||
<enumerator name="Stalled" value="4"/>
|
|
||||||
<enumerator name="Buffering" value="5"/>
|
|
||||||
<enumerator name="Buffered" value="6"/>
|
|
||||||
<enumerator name="EndOfMedia" value="7"/>
|
|
||||||
<enumerator name="InvalidMedia" value="8"/>
|
|
||||||
</enum>
|
|
||||||
<enum name="Error">
|
|
||||||
<enumerator name="NoError" value="0"/>
|
|
||||||
<enumerator name="ResourceError" value="1"/>
|
|
||||||
<enumerator name="FormatError" value="2"/>
|
|
||||||
<enumerator name="NetworkError" value="3"/>
|
|
||||||
<enumerator name="AccessDenied" value="4"/>
|
|
||||||
<enumerator name="ServiceMissing" value="5"/>
|
|
||||||
</enum>
|
|
||||||
<property name="source" type="QUrl"/>
|
|
||||||
<property name="autoLoad" type="bool"/>
|
|
||||||
<property name="playing" type="bool"/>
|
|
||||||
<property name="paused" type="bool"/>
|
|
||||||
<property name="status" type="Status"/>
|
|
||||||
<property name="duration" type="int"/>
|
|
||||||
<property name="position" type="int"/>
|
|
||||||
<property name="volume" type="qreal"/>
|
|
||||||
<property name="muted" type="bool"/>
|
|
||||||
<property name="hasAudio" type="bool"/>
|
|
||||||
<property name="hasVideo" type="bool"/>
|
|
||||||
<property name="bufferProgress" type="int"/>
|
|
||||||
<property name="seekable" type="bool"/>
|
|
||||||
<property name="playbackRate" type="qreal"/>
|
|
||||||
<property name="error" type="Error"/>
|
|
||||||
<property name="errorString" type="string"/>
|
|
||||||
<property name="fillMode" type="FillMode"/>
|
|
||||||
<signal name="sourceChanged"/>
|
|
||||||
<signal name="autoLoadChanged"/>
|
|
||||||
<signal name="playingChanged"/>
|
|
||||||
<signal name="pausedChanged"/>
|
|
||||||
<signal name="started"/>
|
|
||||||
<signal name="resumed"/>
|
|
||||||
<signal name="paused"/>
|
|
||||||
<signal name="stopped"/>
|
|
||||||
<signal name="statusChanged"/>
|
|
||||||
<signal name="loaded"/>
|
|
||||||
<signal name="buffering"/>
|
|
||||||
<signal name="stalled"/>
|
|
||||||
<signal name="buffered"/>
|
|
||||||
<signal name="endOfMedia"/>
|
|
||||||
<signal name="durationChanged"/>
|
|
||||||
<signal name="positionChanged"/>
|
|
||||||
<signal name="volumeChanged"/>
|
|
||||||
<signal name="mutedChanged"/>
|
|
||||||
<signal name="hasAudioChanged"/>
|
|
||||||
<signal name="hasVideoChanged"/>
|
|
||||||
<signal name="bufferProgressChanged"/>
|
|
||||||
<signal name="seekableChanged"/>
|
|
||||||
<signal name="playbackRateChanged"/>
|
|
||||||
<signal name="errorChanged"/>
|
|
||||||
<signal name="error">
|
|
||||||
<param name="error" type="QDeclarativeVideo.Error"/>
|
|
||||||
<param name="errorString" type="string"/>
|
|
||||||
</signal>
|
|
||||||
<method name="play"/>
|
|
||||||
<method name="pause"/>
|
|
||||||
<method name="stop"/>
|
|
||||||
</type>
|
|
||||||
<type name="Qt.widgets.QGraphicsGridLayout" version="4.7" defaultProperty="children" extends="Qt.QtObject">
|
|
||||||
<property name="children" type="QGraphicsLayoutItem" isList="true"/>
|
|
||||||
<property name="spacing" type="qreal"/>
|
|
||||||
<property name="contentsMargin" type="qreal"/>
|
|
||||||
<property name="verticalSpacing" type="qreal"/>
|
|
||||||
<property name="horizontalSpacing" type="qreal"/>
|
|
||||||
</type>
|
|
||||||
<type name="Qt.widgets.QGraphicsLinearLayout" version="4.7" defaultProperty="children" extends="Qt.QtObject">
|
|
||||||
<property name="children" type="QGraphicsLayoutItem" isList="true"/>
|
|
||||||
<property name="orientation" type="Qt.Orientation"/>
|
|
||||||
<property name="spacing" type="qreal"/>
|
|
||||||
<property name="contentsMargin" type="qreal"/>
|
|
||||||
</type>
|
|
||||||
<type name="Qt.widgets.QGraphicsLinearLayoutStretchItem" version="4.7" extends="Qt.QtObject"/>
|
|
||||||
<type name="org.webkit.WebView" version="1.0" defaultProperty="data" extends="Qt.Item">
|
<type name="org.webkit.WebView" version="1.0" defaultProperty="data" extends="Qt.Item">
|
||||||
<enum name="Status">
|
<enum name="Status">
|
||||||
<enumerator name="Null" value="0"/>
|
<enumerator name="Null" value="0"/>
|
||||||
|
|||||||
@@ -429,7 +429,7 @@
|
|||||||
<message>
|
<message>
|
||||||
<location line="+4"/>
|
<location line="+4"/>
|
||||||
<source>The directory %1 contains an outdated .cbp file. Qt Creator needs to update this file by running cmake. If you want to add additional command line arguments, add them below. Note that cmake remembers command line arguments from the previous runs.</source>
|
<source>The directory %1 contains an outdated .cbp file. Qt Creator needs to update this file by running cmake. If you want to add additional command line arguments, add them below. Note that cmake remembers command line arguments from the previous runs.</source>
|
||||||
<translation>Das Verzeichnis %1 enthält eine veraltetet cbp-Datei. Qt Creator muss die Datei durch einen cmake-Aufruf erneuern. Zusätzliche Für Kommandozeilenargumente können unten angegeben werden. Beachten Sie, dass cmake die Argumente vorangegangener Aufrufe speichert.</translation>
|
<translation>Das Verzeichnis %1 enthält eine veraltete cbp-Datei. Qt Creator muss die Datei durch einen cmake-Aufruf erneuern. Zusätzliche Kommandozeilenargumente können unten angegeben werden. Beachten Sie, dass cmake die Argumente vorangegangener Aufrufe speichert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
<location line="+6"/>
|
||||||
@@ -5481,7 +5481,7 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/designer/cpp/formclasswizarddialog.cpp" line="+52"/>
|
<location filename="../../../src/plugins/designer/cpp/formclasswizarddialog.cpp" line="+52"/>
|
||||||
<source>Qt Designer Form Class</source>
|
<source>Qt Designer Form Class</source>
|
||||||
<translation>Qt Designer-Formular-Klasse</translation>
|
<translation>Qt-Designer-Formularklasse</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
@@ -5522,22 +5522,22 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/designer/formeditorplugin.cpp" line="+130"/>
|
<location filename="../../../src/plugins/designer/formeditorplugin.cpp" line="+130"/>
|
||||||
<source>Qt Designer Form</source>
|
<source>Qt Designer Form</source>
|
||||||
<translation>Qt Designer-Formular</translation>
|
<translation>Qt-Designer-Formular</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
<source>Creates a Qt Designer form along with a matching class (C++ header and source file) for implementation purposes. You can add the form and class to an existing Qt C++ Project.</source>
|
<source>Creates a Qt Designer form along with a matching class (C++ header and source file) for implementation purposes. You can add the form and class to an existing Qt C++ Project.</source>
|
||||||
<translation>Erstellt eine Qt Designer-Formular-Datei mit zugehörigem Klassenrumpf (bestehend aus C++-Header- und Quelldatei) für ein existierendes C++-Projekt.</translation>
|
<translation>Erstellt ein Qt-Designer-Formular mit zugehörigem Klassenrumpf (bestehend aus C++-Header- und -Quelldatei) für ein existierendes C++-Projekt.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+8"/>
|
<location line="+8"/>
|
||||||
<source>Creates a Qt Designer form that you can add to a Qt C++ project. This is useful if you already have an existing class for the UI business logic.</source>
|
<source>Creates a Qt Designer form that you can add to a Qt C++ project. This is useful if you already have an existing class for the UI business logic.</source>
|
||||||
<translation>Erstellt eine Qt Designer-Formular-Datei für ein C++-Projekt. Verwenden Sie diese Vorlage, wenn bereits Geschäftslogik existiert.</translation>
|
<translation>Erstellt ein Qt-Designer-Formular für ein C++-Projekt. Verwenden Sie diese Vorlage, wenn bereits eine Klasse für den Programmablauf existiert.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-2"/>
|
<location line="-2"/>
|
||||||
<source>Qt Designer Form Class</source>
|
<source>Qt Designer Form Class</source>
|
||||||
<translation>Qt Designer-Formular-Klasse</translation>
|
<translation>Qt-Designer-Formularklasse</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@@ -5713,7 +5713,7 @@ Versuchen Sie, das Projekt neu zu erstellen.</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/designer/formwizarddialog.cpp" line="+60"/>
|
<location filename="../../../src/plugins/designer/formwizarddialog.cpp" line="+60"/>
|
||||||
<source>Qt Designer Form</source>
|
<source>Qt Designer Form</source>
|
||||||
<translation>Qt Designer-Formular</translation>
|
<translation>Qt-Designer-Formular</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+2"/>
|
<location line="+2"/>
|
||||||
@@ -8559,7 +8559,7 @@ on slow machines. In this case, the value should be increased.</source>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Qt Designer file</source>
|
<source>Qt Designer file</source>
|
||||||
<translation>Qt Designer-Datei</translation>
|
<translation>Qt-Designer-Datei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
<location line="+6"/>
|
||||||
@@ -8569,7 +8569,7 @@ on slow machines. In this case, the value should be increased.</source>
|
|||||||
<message>
|
<message>
|
||||||
<location line="-5"/>
|
<location line="-5"/>
|
||||||
<source>Generic Qt Creator Project file</source>
|
<source>Generic Qt Creator Project file</source>
|
||||||
<translation>Generische Qt Creator Projektdatei</translation>
|
<translation>Allgemeine Qt-Creator-Projektdatei</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-23"/>
|
<location line="-23"/>
|
||||||
@@ -8639,17 +8639,17 @@ on slow machines. In this case, the value should be increased.</source>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+12"/>
|
<location line="+12"/>
|
||||||
<source>Generic Project Files</source>
|
<source>Generic Project Files</source>
|
||||||
<translation>Generische Projektdateien</translation>
|
<translation>Allgemeine Projektdateien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Generic Project Include Paths</source>
|
<source>Generic Project Include Paths</source>
|
||||||
<translation>Include-Pfade für generisches Projekt</translation>
|
<translation>Include-Pfade für allgemeines Projekt</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Generic Project Configuration File</source>
|
<source>Generic Project Configuration File</source>
|
||||||
<translation>Projekt-Konfigurationsdatei für generische Projekte</translation>
|
<translation>Projekt-Konfigurationsdatei für allgemeine Projekte</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
@@ -10006,7 +10006,7 @@ Fehler: %2</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+52"/>
|
<location line="+52"/>
|
||||||
<source>File &pattern:</source>
|
<source>File &pattern:</source>
|
||||||
<translation>Such&muster für Dateinamen</translation>
|
<translation>Such&muster für Dateinamen:</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@@ -10165,7 +10165,7 @@ Fehler: %2</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+47"/>
|
<location line="+47"/>
|
||||||
<source>File &pattern:</source>
|
<source>File &pattern:</source>
|
||||||
<translation>Such&muster für Dateinamen</translation>
|
<translation>Such&muster für Dateinamen:</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@@ -11851,7 +11851,7 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü
|
|||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
<source>Explore Qt Quick Examples</source>
|
<source>Explore Qt Quick Examples</source>
|
||||||
<translation>Qt Quick-Beispiele öffnen</translation>
|
<translation>Qt-Quick-Beispiele öffnen</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
@@ -11871,7 +11871,7 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü
|
|||||||
<source>Creates a Qt application for the desktop. Includes a Qt Designer-based main window.
|
<source>Creates a Qt application for the desktop. Includes a Qt Designer-based main window.
|
||||||
|
|
||||||
Preselects a desktop Qt for building the application if available.</source>
|
Preselects a desktop Qt for building the application if available.</source>
|
||||||
<translation>Erstellt eine Qt-Anwendung für den Desktop mit einem Qt Designer-basierten Hauptfenster.
|
<translation>Erstellt eine Qt-Anwendung für den Desktop mit einem Qt-Designer-basierten Hauptfenster.
|
||||||
|
|
||||||
Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist.</translation>
|
Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfügbar ist.</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -12010,7 +12010,7 @@ Wählt eine für Desktop-Entwicklung geeignete Qt-Version aus, sofern sie verfü
|
|||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Forms</source>
|
<source>Forms</source>
|
||||||
<translation>Formular-Dateien</translation>
|
<translation>Formulardateien</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
@@ -14470,7 +14470,7 @@ Die folgenden Encodings scheinen der Datei zu entsprechen:</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location line="+4"/>
|
<location line="+4"/>
|
||||||
<source>File &pattern:</source>
|
<source>File &pattern:</source>
|
||||||
<translation>Such&muster für Dateinamen</translation>
|
<translation>Such&muster für Dateinamen:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+18"/>
|
<location line="+18"/>
|
||||||
@@ -17419,7 +17419,7 @@ Sie können die Änderungen in einem Stash ablegen oder rücksetzen.</translatio
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/qmldesigner/settingspage.cpp" line="+83"/>
|
<location filename="../../../src/plugins/qmldesigner/settingspage.cpp" line="+83"/>
|
||||||
<source>Qt Quick Designer</source>
|
<source>Qt Quick Designer</source>
|
||||||
<translation>Qt Quick Designer</translation>
|
<translation>Qt-Quick-Designer</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@@ -20133,7 +20133,7 @@ QML-Anwendungen werden durch die QML-Laufzeitumgebung direkt ausgeführt und ben
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/qmldesigner/qmldesignerplugin.cpp" line="+130"/>
|
<location filename="../../../src/plugins/qmldesigner/qmldesignerplugin.cpp" line="+130"/>
|
||||||
<source>Switch Text/Design</source>
|
<source>Switch Text/Design</source>
|
||||||
<translation>Text/Entwurf umschalten</translation>
|
<translation>Text/Design umschalten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+200"/>
|
<location line="+200"/>
|
||||||
@@ -20171,7 +20171,7 @@ QML-Anwendungen werden durch die QML-Laufzeitumgebung direkt ausgeführt und ben
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/coreplugin/designmode.cpp" line="+151"/>
|
<location filename="../../../src/plugins/coreplugin/designmode.cpp" line="+151"/>
|
||||||
<source>Design</source>
|
<source>Design</source>
|
||||||
<translation>Entwurf</translation>
|
<translation>Design</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@@ -21509,7 +21509,7 @@ Haben Sie Qemu gestartet?</translation>
|
|||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/designer/formeditorfactory.cpp" line="+93"/>
|
<location filename="../../../src/plugins/designer/formeditorfactory.cpp" line="+93"/>
|
||||||
<source>This file can only be edited in <b>Design</b> mode.</source>
|
<source>This file can only be edited in <b>Design</b> mode.</source>
|
||||||
<translation>Datei kann nur im <b>Entwurfsmodus</b> bearbeitet werden.</translation>
|
<translation>Datei kann nur im <b>Designmodus</b> bearbeitet werden.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
@@ -21579,7 +21579,7 @@ Haben Sie Qemu gestartet?</translation>
|
|||||||
<source>Creates a Qt application optimized for mobile devices with a Qt Designer-based main window.
|
<source>Creates a Qt application optimized for mobile devices with a Qt Designer-based main window.
|
||||||
|
|
||||||
Preselects Qt for Simulator and mobile targets if available</source>
|
Preselects Qt for Simulator and mobile targets if available</source>
|
||||||
<translation>Erstellt eine Qt-Anwendung für mobile Geräte mit einem Qt Designer-basierten Hauptfenster.
|
<translation>Erstellt eine Qt-Anwendung für mobile Geräte mit einem Qt-Designer-basierten Hauptfenster.
|
||||||
|
|
||||||
Wählt Qt-Versionen für Simulator und mobile Ziele aus, sofern sie verfügbar sind.</translation>
|
Wählt Qt-Versionen für Simulator und mobile Ziele aus, sofern sie verfügbar sind.</translation>
|
||||||
</message>
|
</message>
|
||||||
@@ -21678,23 +21678,23 @@ Wählt Qt-Versionen für Simulator und mobile Ziele aus, sofern sie verfügbar s
|
|||||||
<message>
|
<message>
|
||||||
<location line="-15"/>
|
<location line="-15"/>
|
||||||
<source>Do you want to enable the experimental Qt Quick Designer?</source>
|
<source>Do you want to enable the experimental Qt Quick Designer?</source>
|
||||||
<translation>Möchten Sie den experimentellen Quick-Designer aktivieren?</translation>
|
<translation>Möchten Sie den experimentellen Qt-Quick-Designer aktivieren?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<location line="+23"/>
|
<location line="+23"/>
|
||||||
<source>Enable Qt Quick Designer</source>
|
<source>Enable Qt Quick Designer</source>
|
||||||
<translation>Quick Designer aktivieren</translation>
|
<translation>Qt-Quick-Designer aktivieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="-6"/>
|
<location line="-6"/>
|
||||||
<source>Enable experimental Qt Quick Designer?</source>
|
<source>Enable experimental Qt Quick Designer?</source>
|
||||||
<translation>Möchten Sie den experimentellen Quick-Designer aktivieren?</translation>
|
<translation>Möchten Sie den experimentellen Qt-Quick-Designer aktivieren?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Do you want to enable the experimental Qt Quick Designer? After enabling it, you can access the visual design capabilities by switching to Design Mode. This can affect the overall stability of Qt Creator. To disable Qt Quick Designer again, visit the menu '%1' and disable 'QmlDesigner'.</source>
|
<source>Do you want to enable the experimental Qt Quick Designer? After enabling it, you can access the visual design capabilities by switching to Design Mode. This can affect the overall stability of Qt Creator. To disable Qt Quick Designer again, visit the menu '%1' and disable 'QmlDesigner'.</source>
|
||||||
<translation>Möchten Sie den experimentellen Quick-Designer aktivieren? Nach der Aktivierung haben Sie Zugriff auf die graphische Entwurfsfunktionalität, wenn Sie in den Entwurfsmodus schalten. Das kann allerdings die Stabilität von Qt Creator beeinträchtigen. Um Quick-Designer zu deaktivieren, wählen Sie '%1' und deaktivieren 'QmlDesigner' in dem gezeigten Fenster.</translation>
|
<translation>Möchten Sie den experimentellen Qt-Quick-Designer aktivieren? Dadurch bekommen Sie Zugriff auf die grafische Designfunktion, wenn Sie in den Designmodus schalten. Dies kann allerdings die Stabilität von Qt Creator beeinträchtigen. Um den Qt-Quick-Designer wieder zu deaktivieren, wählen Sie '%1' und deaktivieren 'QmlDesigner' in dem gezeigten Fenster.</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+6"/>
|
<location line="+6"/>
|
||||||
@@ -22576,7 +22576,7 @@ Namen <E-Mail> Alias <E-Mail?</translation>
|
|||||||
<location line="+1"/>
|
<location line="+1"/>
|
||||||
<source>Could not preview Qt Quick (QML) file. Reason:
|
<source>Could not preview Qt Quick (QML) file. Reason:
|
||||||
%1</source>
|
%1</source>
|
||||||
<translation>Die Qt-Quick-Datei (QML) konnte angezeigt werden:
|
<translation>Die Qt-Quick-Datei (QML) konnte nicht angezeigt werden:
|
||||||
%1</translation>
|
%1</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
|||||||
@@ -173,7 +173,8 @@ int main(int argc, char **argv)
|
|||||||
// increase the number of file that can be opened in Qt Creator.
|
// increase the number of file that can be opened in Qt Creator.
|
||||||
struct rlimit rl;
|
struct rlimit rl;
|
||||||
getrlimit(RLIMIT_NOFILE, &rl);
|
getrlimit(RLIMIT_NOFILE, &rl);
|
||||||
rl.rlim_cur = rl.rlim_max;
|
|
||||||
|
rl.rlim_cur = qMin((rlim_t)OPEN_MAX, rl.rlim_max);
|
||||||
setrlimit(RLIMIT_NOFILE, &rl);
|
setrlimit(RLIMIT_NOFILE, &rl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -108,10 +108,11 @@ bool Ne7sshSftp::handleData (Botan::SecureVector<Botan::byte>& packet)
|
|||||||
commBuffer.addVector (sftpBuffer);
|
commBuffer.addVector (sftpBuffer);
|
||||||
mainBuffer.addVector (sftpBuffer);
|
mainBuffer.addVector (sftpBuffer);
|
||||||
|
|
||||||
len = mainBuffer.getInt();
|
if (mainBuffer.length() < sizeof(uint32)
|
||||||
|
|| mainBuffer.getInt() > mainBuffer.length())
|
||||||
|
return true;
|
||||||
|
|
||||||
if (len > mainBuffer.length()) return true;
|
commBuffer.clear();
|
||||||
else commBuffer.clear();
|
|
||||||
|
|
||||||
_cmd = mainBuffer.getByte();
|
_cmd = mainBuffer.getByte();
|
||||||
|
|
||||||
|
|||||||
@@ -1494,6 +1494,20 @@ void Context::setProperty(const ObjectValue *object, const QString &name, const
|
|||||||
_properties[object].insert(name, value);
|
_properties[object].insert(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Context::defaultPropertyName(const ObjectValue *object)
|
||||||
|
{
|
||||||
|
for (const ObjectValue *o = object; o; o = o->prototype(this)) {
|
||||||
|
if (const ASTObjectValue *astObjValue = dynamic_cast<const ASTObjectValue *>(o)) {
|
||||||
|
QString defaultProperty = astObjValue->defaultPropertyName();
|
||||||
|
if (!defaultProperty.isEmpty())
|
||||||
|
return defaultProperty;
|
||||||
|
} else if (const QmlObjectValue *qmlValue = dynamic_cast<const QmlObjectValue *>(o)) {
|
||||||
|
return qmlValue->defaultPropertyName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
bool Context::documentImportsPlugins(const QmlJS::Document *doc) const
|
bool Context::documentImportsPlugins(const QmlJS::Document *doc) const
|
||||||
{
|
{
|
||||||
return _documentsImportingPlugins.contains(doc->fileName());
|
return _documentsImportingPlugins.contains(doc->fileName());
|
||||||
@@ -2800,7 +2814,7 @@ ASTObjectValue::ASTObjectValue(UiQualifiedId *typeName,
|
|||||||
UiObjectInitializer *initializer,
|
UiObjectInitializer *initializer,
|
||||||
const QmlJS::Document *doc,
|
const QmlJS::Document *doc,
|
||||||
Engine *engine)
|
Engine *engine)
|
||||||
: ObjectValue(engine), _typeName(typeName), _initializer(initializer), _doc(doc)
|
: ObjectValue(engine), _typeName(typeName), _initializer(initializer), _doc(doc), _defaultPropertyRef(0)
|
||||||
{
|
{
|
||||||
if (_initializer) {
|
if (_initializer) {
|
||||||
for (UiObjectMemberList *it = _initializer->members; it; it = it->next) {
|
for (UiObjectMemberList *it = _initializer->members; it; it = it->next) {
|
||||||
@@ -2809,6 +2823,8 @@ ASTObjectValue::ASTObjectValue(UiQualifiedId *typeName,
|
|||||||
if (def->type == UiPublicMember::Property && def->name && def->memberType) {
|
if (def->type == UiPublicMember::Property && def->name && def->memberType) {
|
||||||
ASTPropertyReference *ref = new ASTPropertyReference(def, _doc, engine);
|
ASTPropertyReference *ref = new ASTPropertyReference(def, _doc, engine);
|
||||||
_properties.append(ref);
|
_properties.append(ref);
|
||||||
|
if (def->defaultToken.isValid())
|
||||||
|
_defaultPropertyRef = ref;
|
||||||
} else if (def->type == UiPublicMember::Signal && def->name) {
|
} else if (def->type == UiPublicMember::Signal && def->name) {
|
||||||
ASTSignalReference *ref = new ASTSignalReference(def, _doc, engine);
|
ASTSignalReference *ref = new ASTSignalReference(def, _doc, engine);
|
||||||
_signals.append(ref);
|
_signals.append(ref);
|
||||||
@@ -2846,6 +2862,16 @@ void ASTObjectValue::processMembers(MemberProcessor *processor) const
|
|||||||
ObjectValue::processMembers(processor);
|
ObjectValue::processMembers(processor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ASTObjectValue::defaultPropertyName() const
|
||||||
|
{
|
||||||
|
if (_defaultPropertyRef) {
|
||||||
|
UiPublicMember *prop = _defaultPropertyRef->ast();
|
||||||
|
if (prop && prop->name)
|
||||||
|
return prop->name->asString();
|
||||||
|
}
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
ASTVariableReference::ASTVariableReference(VariableDeclaration *ast, Engine *engine)
|
ASTVariableReference::ASTVariableReference(VariableDeclaration *ast, Engine *engine)
|
||||||
: Reference(engine), _ast(ast)
|
: Reference(engine), _ast(ast)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -297,6 +297,8 @@ public:
|
|||||||
const Value *property(const ObjectValue *object, const QString &name) const;
|
const Value *property(const ObjectValue *object, const QString &name) const;
|
||||||
void setProperty(const ObjectValue *object, const QString &name, const Value *value);
|
void setProperty(const ObjectValue *object, const QString &name, const Value *value);
|
||||||
|
|
||||||
|
QString defaultPropertyName(const ObjectValue *object);
|
||||||
|
|
||||||
bool documentImportsPlugins(const Document *doc) const;
|
bool documentImportsPlugins(const Document *doc) const;
|
||||||
void setDocumentImportsPlugins(const Document *doc);
|
void setDocumentImportsPlugins(const Document *doc);
|
||||||
|
|
||||||
@@ -817,6 +819,7 @@ class QMLJS_EXPORT ASTObjectValue: public ObjectValue
|
|||||||
const Document *_doc;
|
const Document *_doc;
|
||||||
QList<ASTPropertyReference *> _properties;
|
QList<ASTPropertyReference *> _properties;
|
||||||
QList<ASTSignalReference *> _signals;
|
QList<ASTSignalReference *> _signals;
|
||||||
|
ASTPropertyReference *_defaultPropertyRef;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ASTObjectValue(AST::UiQualifiedId *typeName,
|
ASTObjectValue(AST::UiQualifiedId *typeName,
|
||||||
@@ -827,6 +830,8 @@ public:
|
|||||||
|
|
||||||
bool getSourceLocation(QString *fileName, int *line, int *column) const;
|
bool getSourceLocation(QString *fileName, int *line, int *column) const;
|
||||||
virtual void processMembers(MemberProcessor *processor) const;
|
virtual void processMembers(MemberProcessor *processor) const;
|
||||||
|
|
||||||
|
QString defaultPropertyName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
} } // end of namespace QmlJS::Interpreter
|
} } // end of namespace QmlJS::Interpreter
|
||||||
|
|||||||
@@ -275,7 +275,9 @@ public:
|
|||||||
if (type == TypePermissions) {
|
if (type == TypePermissions) {
|
||||||
emit changed();
|
emit changed();
|
||||||
} else {
|
} else {
|
||||||
open(m_fileName);
|
emit aboutToReload();
|
||||||
|
if (open(m_fileName))
|
||||||
|
emit reloaded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void changed();
|
void changed();
|
||||||
|
|
||||||
|
void aboutToReload();
|
||||||
|
void reloaded();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Core
|
} // namespace Core
|
||||||
|
|||||||
@@ -221,23 +221,24 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_toolTip.isEmpty()) {
|
|
||||||
foreach (const Document::Include &incl, doc->includes()) {
|
|
||||||
if (incl.line() == lineNumber) {
|
|
||||||
m_toolTip = QDir::toNativeSeparators(incl.fileName());
|
|
||||||
m_helpId = QFileInfo(incl.fileName()).fileName();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_helpEngineNeedsSetup
|
if (m_helpEngineNeedsSetup
|
||||||
&& m_helpEngine->registeredDocumentations().count() > 0) {
|
&& m_helpEngine->registeredDocumentations().count() > 0) {
|
||||||
m_helpEngine->setupData();
|
m_helpEngine->setupData();
|
||||||
m_helpEngineNeedsSetup = false;
|
m_helpEngineNeedsSetup = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, QUrl> helpLinks;
|
QMap<QString, QUrl> helpLinks;
|
||||||
|
|
||||||
|
if (m_toolTip.isEmpty()) {
|
||||||
|
foreach (const Document::Include &incl, doc->includes()) {
|
||||||
|
if (incl.line() == lineNumber) {
|
||||||
|
m_toolTip = QDir::toNativeSeparators(incl.fileName());
|
||||||
|
m_helpId = QFileInfo(incl.fileName()).fileName();
|
||||||
|
helpLinks = m_helpEngine->linksForIdentifier(m_helpId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_helpId.isEmpty()) {
|
if (m_helpId.isEmpty()) {
|
||||||
// Move to the end of a qualified name
|
// Move to the end of a qualified name
|
||||||
bool stop = false;
|
bool stop = false;
|
||||||
|
|||||||
@@ -1078,8 +1078,11 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
|
|||||||
const unsigned engineCapabilities = d->m_engine->debuggerCapabilities();
|
const unsigned engineCapabilities = d->m_engine->debuggerCapabilities();
|
||||||
theDebuggerAction(OperateByInstruction)
|
theDebuggerAction(OperateByInstruction)
|
||||||
->setEnabled(engineCapabilities & DisassemblerCapability);
|
->setEnabled(engineCapabilities & DisassemblerCapability);
|
||||||
d->m_actions.reverseDirectionAction
|
|
||||||
->setEnabled(engineCapabilities & ReverseSteppingCapability);
|
const bool canReverse = (engineCapabilities & ReverseSteppingCapability)
|
||||||
|
&& theDebuggerBoolSetting(EnableReverseDebugging);
|
||||||
|
d->m_actions.reverseDirectionAction->setChecked(false);
|
||||||
|
d->m_actions.reverseDirectionAction->setEnabled(canReverse);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerManager::startFailed()
|
void DebuggerManager::startFailed()
|
||||||
@@ -1101,6 +1104,7 @@ void DebuggerManager::cleanupViews()
|
|||||||
d->m_sourceFilesWindow->removeAll();
|
d->m_sourceFilesWindow->removeAll();
|
||||||
d->m_disassemblerViewAgent.cleanup();
|
d->m_disassemblerViewAgent.cleanup();
|
||||||
d->m_actions.reverseDirectionAction->setChecked(false);
|
d->m_actions.reverseDirectionAction->setChecked(false);
|
||||||
|
d->m_actions.reverseDirectionAction->setEnabled(false);
|
||||||
hideDebuggerToolTip();
|
hideDebuggerToolTip();
|
||||||
|
|
||||||
// FIXME: Move to plugin?
|
// FIXME: Move to plugin?
|
||||||
|
|||||||
@@ -335,6 +335,9 @@ public slots:
|
|||||||
QString needle2 = QLatin1Char('>') + needle;
|
QString needle2 = QLatin1Char('>') + needle;
|
||||||
QTextCursor cursor(document());
|
QTextCursor cursor(document());
|
||||||
do {
|
do {
|
||||||
|
cursor = document()->find(needle, cursor);
|
||||||
|
if (cursor.isNull())
|
||||||
|
break; // Not found.
|
||||||
const QString line = cursor.block().text();
|
const QString line = cursor.block().text();
|
||||||
if (line.startsWith(needle) || line.startsWith(needle2)) {
|
if (line.startsWith(needle) || line.startsWith(needle2)) {
|
||||||
setFocus();
|
setFocus();
|
||||||
|
|||||||
@@ -1539,8 +1539,8 @@ void DebuggerPlugin::enableReverseDebuggingTriggered(const QVariant &value)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(m_reverseToolButton, return);
|
QTC_ASSERT(m_reverseToolButton, return);
|
||||||
m_reverseToolButton->setVisible(value.toBool());
|
m_reverseToolButton->setVisible(value.toBool());
|
||||||
if (!value.toBool())
|
|
||||||
m_manager->debuggerManagerActions().reverseDirectionAction->setChecked(false);
|
m_manager->debuggerManagerActions().reverseDirectionAction->setChecked(false);
|
||||||
|
m_manager->debuggerManagerActions().reverseDirectionAction->setEnabled(value.toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerPlugin::toggleBreakpoint()
|
void DebuggerPlugin::toggleBreakpoint()
|
||||||
|
|||||||
@@ -1892,6 +1892,7 @@ void GdbEngine::executeStepI()
|
|||||||
void GdbEngine::executeStepOut()
|
void GdbEngine::executeStepOut()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
|
QTC_ASSERT(state() == InferiorStopped, qDebug() << state());
|
||||||
|
postCommand("-stack-select-frame 0");
|
||||||
setTokenBarrier();
|
setTokenBarrier();
|
||||||
setState(InferiorRunningRequested);
|
setState(InferiorRunningRequested);
|
||||||
showStatusMessage(tr("Finish function requested..."), 5000);
|
showStatusMessage(tr("Finish function requested..."), 5000);
|
||||||
|
|||||||
@@ -281,6 +281,15 @@ void FormEditorW::fullInit()
|
|||||||
initDesignerSubWindows();
|
initDesignerSubWindows();
|
||||||
m_integration = new QtCreatorIntegration(m_formeditor, this);
|
m_integration = new QtCreatorIntegration(m_formeditor, this);
|
||||||
m_formeditor->setIntegration(m_integration);
|
m_formeditor->setIntegration(m_integration);
|
||||||
|
// Connect Qt Designer help request to HelpManager.
|
||||||
|
// TODO: Use Core::HelpManager once it has been introduced.
|
||||||
|
foreach(QObject *object, ExtensionSystem::PluginManager::instance()->allObjects()) {
|
||||||
|
if (!qstrcmp(object->metaObject()->className(), "Help::HelpManager")) {
|
||||||
|
connect(m_integration, SIGNAL(creatorHelpRequested(QString)),
|
||||||
|
object, SLOT(handleHelpRequest(QString)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This will initialize our TabOrder, Signals and slots and Buddy editors.
|
* This will initialize our TabOrder, Signals and slots and Buddy editors.
|
||||||
|
|||||||
@@ -142,7 +142,9 @@ void FormWindowFile::reload(ReloadFlag flag, ChangeType type)
|
|||||||
if (type == TypePermissions) {
|
if (type == TypePermissions) {
|
||||||
emit changed();
|
emit changed();
|
||||||
} else {
|
} else {
|
||||||
|
emit aboutToReload();
|
||||||
emit reload(m_fileName);
|
emit reload(m_fileName);
|
||||||
|
emit reloaded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,14 @@ QtCreatorIntegration::QtCreatorIntegration(QDesignerFormEditorInterface *core, F
|
|||||||
setSlotNavigationEnabled(true);
|
setSlotNavigationEnabled(true);
|
||||||
connect(this, SIGNAL(navigateToSlot(QString, QString, QStringList)),
|
connect(this, SIGNAL(navigateToSlot(QString, QString, QStringList)),
|
||||||
this, SLOT(slotNavigateToSlot(QString, QString, QStringList)));
|
this, SLOT(slotNavigateToSlot(QString, QString, QStringList)));
|
||||||
|
connect(this, SIGNAL(helpRequested(QString,QString)),
|
||||||
|
this, SLOT(slotDesignerHelpRequested(QString,QString)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QtCreatorIntegration::slotDesignerHelpRequested(const QString &manual, const QString &document)
|
||||||
|
{
|
||||||
|
// Pass on as URL.
|
||||||
|
emit creatorHelpRequested(QString::fromLatin1("qthelp://com.trolltech.%1/qdoc/%2").arg(manual, document));
|
||||||
}
|
}
|
||||||
|
|
||||||
void QtCreatorIntegration::updateSelection()
|
void QtCreatorIntegration::updateSelection()
|
||||||
|
|||||||
@@ -46,12 +46,18 @@ public:
|
|||||||
|
|
||||||
QWidget *containerWindow(QWidget *widget) const;
|
QWidget *containerWindow(QWidget *widget) const;
|
||||||
|
|
||||||
bool supportsToSlotNavigation() { return true; };
|
bool supportsToSlotNavigation() { return true; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void creatorHelpRequested(const QString &url);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateSelection();
|
void updateSelection();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames);
|
void slotNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames);
|
||||||
|
void slotDesignerHelpRequested(const QString &manual, const QString &document);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool navigateToSlot(const QString &objectName,
|
bool navigateToSlot(const QString &objectName,
|
||||||
const QString &signalSignature,
|
const QString &signalSignature,
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ public:
|
|||||||
void setupGuiHelpEngine();
|
void setupGuiHelpEngine();
|
||||||
bool guiEngineNeedsUpdate() const;
|
bool guiEngineNeedsUpdate() const;
|
||||||
|
|
||||||
void handleHelpRequest(const QString &url);
|
|
||||||
|
|
||||||
void verifyDocumenation();
|
void verifyDocumenation();
|
||||||
void registerDocumentation(const QStringList &fileNames);
|
void registerDocumentation(const QStringList &fileNames);
|
||||||
void unregisterDocumentation(const QStringList &nameSpaces);
|
void unregisterDocumentation(const QStringList &nameSpaces);
|
||||||
@@ -69,6 +67,9 @@ public:
|
|||||||
|
|
||||||
static BookmarkManager& bookmarkManager();
|
static BookmarkManager& bookmarkManager();
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void handleHelpRequest(const QString &url);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void helpRequested(const QUrl &url);
|
void helpRequested(const QUrl &url);
|
||||||
|
|
||||||
|
|||||||
@@ -852,8 +852,7 @@ void HelpPlugin::handleHelpRequest(const QUrl &url)
|
|||||||
// local help not installed, resort to external web help
|
// local help not installed, resort to external web help
|
||||||
QString urlPrefix = QLatin1String("http://doc.trolltech.com/");
|
QString urlPrefix = QLatin1String("http://doc.trolltech.com/");
|
||||||
if (url.authority() == QLatin1String("com.nokia.qtcreator")) {
|
if (url.authority() == QLatin1String("com.nokia.qtcreator")) {
|
||||||
urlPrefix.append(QString::fromLatin1("qtcreator-%1.%2")
|
urlPrefix.append(QString::fromLatin1("qtcreator"));
|
||||||
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR));
|
|
||||||
} else {
|
} else {
|
||||||
urlPrefix.append(QLatin1String("latest"));
|
urlPrefix.append(QLatin1String("latest"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ SUBDIRS = plugin_coreplugin \
|
|||||||
plugin_mercurial \
|
plugin_mercurial \
|
||||||
debugger/dumper.pro
|
debugger/dumper.pro
|
||||||
|
|
||||||
|
SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML)
|
||||||
|
|
||||||
|
!isEmpty(SUPPORT_QT_QML) {
|
||||||
|
message("Adding support for Qt/QML projects.")
|
||||||
|
DEFINES += QTCREATOR_WITH_QML
|
||||||
|
|
||||||
contains(QT_CONFIG, declarative) {
|
contains(QT_CONFIG, declarative) {
|
||||||
|
|
||||||
SUBDIRS += plugin_qmlprojectmanager
|
SUBDIRS += plugin_qmlprojectmanager
|
||||||
@@ -51,6 +57,7 @@ contains(QT_CONFIG, declarative) {
|
|||||||
warning()
|
warning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plugin_coreplugin.subdir = coreplugin
|
plugin_coreplugin.subdir = coreplugin
|
||||||
|
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ void DragTool::move(QPointF scenePos)
|
|||||||
/* if (event->modifiers().testFlag(Qt::ControlModifier) != view()->isSnapButtonChecked())
|
/* if (event->modifiers().testFlag(Qt::ControlModifier) != view()->isSnapButtonChecked())
|
||||||
useSnapping = MoveManipulator::UseSnapping;*/
|
useSnapping = MoveManipulator::UseSnapping;*/
|
||||||
|
|
||||||
m_moveManipulator.update(scenePos, useSnapping);
|
m_moveManipulator.update(scenePos, useSnapping, MoveManipulator::UseBaseState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ FormEditorItem* ItemCreatorTool::calculateContainer(const QPointF &point)
|
|||||||
QList<QGraphicsItem *> list = scene()->items(point);
|
QList<QGraphicsItem *> list = scene()->items(point);
|
||||||
foreach (QGraphicsItem *item, list) {
|
foreach (QGraphicsItem *item, list) {
|
||||||
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
FormEditorItem *formEditorItem = FormEditorItem::fromQGraphicsItem(item);
|
||||||
if (formEditorItem && formEditorItem->isContainer())
|
if (formEditorItem)
|
||||||
return formEditorItem;
|
return formEditorItem;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ QList<QRectF> MoveManipulator::tanslatedBoundingRects(const QList<QRectF> &bound
|
|||||||
/*
|
/*
|
||||||
/brief updates the position of the items.
|
/brief updates the position of the items.
|
||||||
*/
|
*/
|
||||||
void MoveManipulator::update(const QPointF& updatePoint, Snapping useSnapping)
|
void MoveManipulator::update(const QPointF& updatePoint, Snapping useSnapping, State stateToBeManipulated)
|
||||||
{
|
{
|
||||||
deleteSnapLines(); //Since they position is changed and the item is moved the snapping lines are
|
deleteSnapLines(); //Since they position is changed and the item is moved the snapping lines are
|
||||||
//are obsolete. The new updated snapping lines (color and visibility) will be
|
//are obsolete. The new updated snapping lines (color and visibility) will be
|
||||||
@@ -226,6 +226,9 @@ void MoveManipulator::update(const QPointF& updatePoint, Snapping useSnapping)
|
|||||||
|
|
||||||
foreach (FormEditorItem* item, m_itemList) {
|
foreach (FormEditorItem* item, m_itemList) {
|
||||||
QPointF positionInContainerSpace(m_beginPositionHash.value(item) + offsetVector);
|
QPointF positionInContainerSpace(m_beginPositionHash.value(item) + offsetVector);
|
||||||
|
|
||||||
|
// don't support anchors for base state because it is not needed by the droptool
|
||||||
|
if (stateToBeManipulated == UseActualState) {
|
||||||
QmlAnchors anchors(item->qmlItemNode().anchors());
|
QmlAnchors anchors(item->qmlItemNode().anchors());
|
||||||
|
|
||||||
if (anchors.instanceHasAnchor(AnchorLine::Top)) {
|
if (anchors.instanceHasAnchor(AnchorLine::Top)) {
|
||||||
@@ -253,9 +256,11 @@ void MoveManipulator::update(const QPointF& updatePoint, Snapping useSnapping)
|
|||||||
}
|
}
|
||||||
|
|
||||||
item->qmlItemNode().setPosition(positionInContainerSpace);
|
item->qmlItemNode().setPosition(positionInContainerSpace);
|
||||||
|
} else {
|
||||||
|
item->qmlItemNode().modelNode().variantProperty("x").setValue(qRound(positionInContainerSpace.x()));
|
||||||
|
item->qmlItemNode().modelNode().variantProperty("y").setValue(qRound(positionInContainerSpace.y()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,13 +57,18 @@ public:
|
|||||||
NoSnapping
|
NoSnapping
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum State {
|
||||||
|
UseActualState,
|
||||||
|
UseBaseState
|
||||||
|
};
|
||||||
|
|
||||||
MoveManipulator(LayerItem *layerItem, FormEditorView *view);
|
MoveManipulator(LayerItem *layerItem, FormEditorView *view);
|
||||||
~MoveManipulator();
|
~MoveManipulator();
|
||||||
void setItems(const QList<FormEditorItem*> &itemList);
|
void setItems(const QList<FormEditorItem*> &itemList);
|
||||||
void setItem(FormEditorItem* item);
|
void setItem(FormEditorItem* item);
|
||||||
|
|
||||||
void begin(const QPointF& beginPoint);
|
void begin(const QPointF& beginPoint);
|
||||||
void update(const QPointF& updatePoint, Snapping useSnapping);
|
void update(const QPointF& updatePoint, Snapping useSnapping, State stateToBeManipulated = UseActualState);
|
||||||
void reparentTo(FormEditorItem *newParent);
|
void reparentTo(FormEditorItem *newParent);
|
||||||
void end(const QPointF& endPoint);
|
void end(const QPointF& endPoint);
|
||||||
|
|
||||||
|
|||||||
@@ -90,13 +90,13 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
|
|||||||
m_resizeIndicator.hide();
|
m_resizeIndicator.hide();
|
||||||
|
|
||||||
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
|
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
|
||||||
if (containerItem &&
|
if (containerItem
|
||||||
containerItem != m_movingItems.first()->parentItem() &&
|
&& view()->currentState().isBaseState()) {
|
||||||
view()->currentState().isBaseState() &&
|
if (containerItem != m_movingItems.first()->parentItem()
|
||||||
!event->modifiers().testFlag(Qt::ShiftModifier)) {
|
&& event->modifiers().testFlag(Qt::ShiftModifier)) {
|
||||||
|
|
||||||
m_moveManipulator.reparentTo(containerItem);
|
m_moveManipulator.reparentTo(containerItem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool shouldSnapping = view()->widget()->snappingAction()->isChecked();
|
bool shouldSnapping = view()->widget()->snappingAction()->isChecked();
|
||||||
bool shouldSnappingAndAnchoring = view()->widget()->snappingAndAnchoringAction()->isChecked();
|
bool shouldSnappingAndAnchoring = view()->widget()->snappingAndAnchoringAction()->isChecked();
|
||||||
@@ -313,9 +313,7 @@ FormEditorItem* MoveTool::containerFormEditorItem(const QList<QGraphicsItem*> &i
|
|||||||
if (formEditorItem
|
if (formEditorItem
|
||||||
&& !selectedItemList.contains(formEditorItem)
|
&& !selectedItemList.contains(formEditorItem)
|
||||||
&& isNotAncestorOfItemInList(formEditorItem, selectedItemList))
|
&& isNotAncestorOfItemInList(formEditorItem, selectedItemList))
|
||||||
if (formEditorItem->isContainer()) {
|
|
||||||
return formEditorItem;
|
return formEditorItem;
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
virtual ~Model();
|
virtual ~Model();
|
||||||
|
|
||||||
static Model *create(QString type, int major = 4, int minor = 6);
|
static Model *create(QString type, int major = 4, int minor = 7);
|
||||||
|
|
||||||
Model *masterModel() const;
|
Model *masterModel() const;
|
||||||
void setMasterModel(Model *model);
|
void setMasterModel(Model *model);
|
||||||
|
|||||||
@@ -68,14 +68,16 @@ public:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
|
void loadPlugins(QDeclarativeEngine *engine);
|
||||||
void parseQmlTypes();
|
void parseQmlTypes();
|
||||||
void parseNonQmlTypes();
|
void parseNonQmlTypes();
|
||||||
void parseValueTypes();
|
void parseValueTypes();
|
||||||
void parseNonQmlClassRecursively(const QMetaObject *qMetaObject, int majorVersion, int minorVersion);
|
void parseNonQmlClassRecursively(const QMetaObject *qMetaObject);
|
||||||
void parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const;
|
void parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const;
|
||||||
void parseClassInfo(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const;
|
void parseClassInfo(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const;
|
||||||
|
|
||||||
QString typeName(const QMetaObject *qMetaObject) const;
|
QList<QDeclarativeType*> qmlTypes();
|
||||||
|
void typeInfo(const QMetaObject *qMetaObject, QString *typeName, int *majorVersion = 0, int *minorVersion = 0) const;
|
||||||
|
|
||||||
void parseXmlFiles();
|
void parseXmlFiles();
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ void MetaInfoPrivate::initialize()
|
|||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
Q_UNUSED(engine);
|
Q_UNUSED(engine);
|
||||||
|
|
||||||
|
loadPlugins(&engine);
|
||||||
parseQmlTypes();
|
parseQmlTypes();
|
||||||
parseNonQmlTypes();
|
parseNonQmlTypes();
|
||||||
parseXmlFiles();
|
parseXmlFiles();
|
||||||
@@ -120,7 +123,26 @@ void MetaInfoPrivate::initialize()
|
|||||||
m_isInitialized = true;
|
m_isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MetaInfoPrivate::loadPlugins(QDeclarativeEngine *engine)
|
||||||
|
{
|
||||||
|
// hack to load plugins
|
||||||
|
QDeclarativeComponent pluginComponent(engine, 0);
|
||||||
|
|
||||||
|
QStringList pluginList;
|
||||||
|
pluginList += "import Qt 4.7";
|
||||||
|
pluginList += "import org.webkit 1.0";
|
||||||
|
|
||||||
|
// load maybe useful plugins
|
||||||
|
pluginList += "import Qt.labs.folderlistmodel 1.0";
|
||||||
|
pluginList += "import Qt.labs.gestures 1.0";
|
||||||
|
pluginList += "import Qt.multimedia 4.7";
|
||||||
|
pluginList += "import Qt.labs.particles 1.0";
|
||||||
|
|
||||||
|
QString componentString = QString("%1\n Item {}\n").arg(pluginList.join("\n"));
|
||||||
|
|
||||||
|
|
||||||
|
pluginComponent.setData(componentString.toLatin1(), QUrl());
|
||||||
|
}
|
||||||
|
|
||||||
void MetaInfoPrivate::parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const
|
void MetaInfoPrivate::parseProperties(NodeMetaInfo &nodeMetaInfo, const QMetaObject *qMetaObject) const
|
||||||
{
|
{
|
||||||
@@ -187,48 +209,83 @@ void MetaInfoPrivate::parseClassInfo(NodeMetaInfo &nodeMetaInfo, const QMetaObje
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaInfoPrivate::parseNonQmlClassRecursively(const QMetaObject *qMetaObject, int majorVersion, int minorVersion)
|
void MetaInfoPrivate::parseNonQmlClassRecursively(const QMetaObject *qMetaObject)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject");
|
Q_ASSERT_X(qMetaObject, Q_FUNC_INFO, "invalid QMetaObject");
|
||||||
const QString className = qMetaObject->className();
|
|
||||||
|
|
||||||
if (className.isEmpty()) {
|
QString typeName;
|
||||||
|
int majorVersion = -1;
|
||||||
|
int minorVersion = -1;
|
||||||
|
typeInfo(qMetaObject, &typeName, &majorVersion, &minorVersion);
|
||||||
|
|
||||||
|
if (typeName.isEmpty()) {
|
||||||
qWarning() << "Meta type system: Registered class has no name.";
|
qWarning() << "Meta type system: Registered class has no name.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_q->hasNodeMetaInfo(typeName(qMetaObject), majorVersion, minorVersion)) {
|
NodeMetaInfo existingInfo = m_q->nodeMetaInfo(typeName, majorVersion, minorVersion);
|
||||||
|
if (existingInfo.isValid()
|
||||||
|
&& existingInfo.majorVersion() == majorVersion
|
||||||
|
&& existingInfo.minorVersion() == minorVersion) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
NodeMetaInfo nodeMetaInfo(*m_q);
|
NodeMetaInfo nodeMetaInfo(*m_q);
|
||||||
nodeMetaInfo.setType(typeName(qMetaObject), majorVersion, minorVersion);
|
nodeMetaInfo.setType(typeName, majorVersion, minorVersion);
|
||||||
parseProperties(nodeMetaInfo, qMetaObject);
|
parseProperties(nodeMetaInfo, qMetaObject);
|
||||||
parseClassInfo(nodeMetaInfo, qMetaObject);
|
parseClassInfo(nodeMetaInfo, qMetaObject);
|
||||||
|
|
||||||
|
QString superTypeName;
|
||||||
|
int superTypeMajorVersion = -1;
|
||||||
|
int superTypeMinorVersion = -1;
|
||||||
|
|
||||||
|
if (qMetaObject->superClass()) {
|
||||||
|
typeInfo(qMetaObject->superClass(), &superTypeName, &superTypeMajorVersion, &superTypeMinorVersion);
|
||||||
|
nodeMetaInfo.setSuperClass(superTypeName, superTypeMajorVersion, superTypeMinorVersion);
|
||||||
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "adding non qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion() << ", parent type" << typeName(qMetaObject->superClass());
|
qDebug() << "adding non qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion()
|
||||||
if (qMetaObject->superClass())
|
<< ", parent type" << superTypeName << superTypeMajorVersion << superTypeMinorVersion;
|
||||||
nodeMetaInfo.setSuperClass(typeName(qMetaObject->superClass()));
|
|
||||||
|
|
||||||
m_q->addNodeInfo(nodeMetaInfo);
|
m_q->addNodeInfo(nodeMetaInfo);
|
||||||
|
|
||||||
|
if (const QMetaObject *superClass = qMetaObject->superClass())
|
||||||
|
parseNonQmlClassRecursively(superClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const QMetaObject *superClass = qMetaObject->superClass()) {
|
QList<QDeclarativeType*> MetaInfoPrivate::qmlTypes()
|
||||||
parseNonQmlClassRecursively(superClass, majorVersion, minorVersion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QString MetaInfoPrivate::typeName(const QMetaObject *qMetaObject) const
|
|
||||||
{
|
{
|
||||||
if (!qMetaObject)
|
QList<QDeclarativeType*> list;
|
||||||
return QString();
|
foreach (QDeclarativeType *type, QDeclarativeMetaType::qmlTypes()) {
|
||||||
QString className = qMetaObject->className();
|
if (!type->qmlTypeName().startsWith("Bauhaus/")
|
||||||
if (QDeclarativeType *qmlType = QDeclarativeMetaType::qmlType(qMetaObject)) {
|
&& !type->qmlTypeName().startsWith("QmlProject/"))
|
||||||
QString qmlClassName(qmlType->qmlTypeName());
|
list += type;
|
||||||
if (!qmlClassName.isEmpty())
|
|
||||||
className = qmlType->qmlTypeName(); // Ensure that we always use the qml name,
|
|
||||||
// if available.
|
|
||||||
}
|
}
|
||||||
return className;
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetaInfoPrivate::typeInfo(const QMetaObject *qMetaObject, QString *typeName, int *majorVersion, int *minorVersion) const
|
||||||
|
{
|
||||||
|
Q_ASSERT(typeName);
|
||||||
|
|
||||||
|
if (!qMetaObject)
|
||||||
|
return;
|
||||||
|
|
||||||
|
*typeName = qMetaObject->className();
|
||||||
|
int majVersion = -1;
|
||||||
|
int minVersion = -1;
|
||||||
|
QDeclarativeType *qmlType = QDeclarativeMetaType::qmlType(qMetaObject);
|
||||||
|
if (qmlType) {
|
||||||
|
if (!qmlType->qmlTypeName().isEmpty()) {
|
||||||
|
*typeName = qmlType->qmlTypeName();
|
||||||
|
majVersion = qmlType->majorVersion();
|
||||||
|
minVersion = qmlType->minorVersion();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (majorVersion)
|
||||||
|
*majorVersion = majVersion;
|
||||||
|
if (minorVersion)
|
||||||
|
*minorVersion = minVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaInfoPrivate::parseValueTypes()
|
void MetaInfoPrivate::parseValueTypes()
|
||||||
@@ -291,12 +348,12 @@ void MetaInfoPrivate::parseValueTypes()
|
|||||||
|
|
||||||
void MetaInfoPrivate::parseQmlTypes()
|
void MetaInfoPrivate::parseQmlTypes()
|
||||||
{
|
{
|
||||||
foreach (QDeclarativeType *qmlType, QDeclarativeMetaType::qmlTypes()) {
|
foreach (QDeclarativeType *qmlType, qmlTypes()) {
|
||||||
const QString qtTypeName(qmlType->typeName());
|
const QString qtTypeName(qmlType->typeName());
|
||||||
const QString qmlTypeName(qmlType->qmlTypeName());
|
const QString qmlTypeName(qmlType->qmlTypeName());
|
||||||
m_QtTypesToQmlTypes.insert(qtTypeName, qmlTypeName);
|
m_QtTypesToQmlTypes.insert(qtTypeName, qmlTypeName);
|
||||||
}
|
}
|
||||||
foreach (QDeclarativeType *qmlType, QDeclarativeMetaType::qmlTypes()) {
|
foreach (QDeclarativeType *qmlType, qmlTypes()) {
|
||||||
const QMetaObject *qMetaObject = qmlType->metaObject();
|
const QMetaObject *qMetaObject = qmlType->metaObject();
|
||||||
|
|
||||||
// parseQmlTypes is called iteratively e.g. when plugins are loaded
|
// parseQmlTypes is called iteratively e.g. when plugins are loaded
|
||||||
@@ -307,32 +364,42 @@ void MetaInfoPrivate::parseQmlTypes()
|
|||||||
nodeMetaInfo.setType(qmlType->qmlTypeName(), qmlType->majorVersion(), qmlType->minorVersion());
|
nodeMetaInfo.setType(qmlType->qmlTypeName(), qmlType->majorVersion(), qmlType->minorVersion());
|
||||||
|
|
||||||
parseProperties(nodeMetaInfo, qMetaObject);
|
parseProperties(nodeMetaInfo, qMetaObject);
|
||||||
parseClassInfo(nodeMetaInfo, qMetaObject);
|
|
||||||
|
|
||||||
QString superTypeName = typeName(qMetaObject->superClass());
|
|
||||||
if (qmlType->baseMetaObject() != qMetaObject) {
|
if (qmlType->baseMetaObject() != qMetaObject) {
|
||||||
// type is declared with Q_DECLARE_EXTENDED_TYPE
|
// type is declared with Q_DECLARE_EXTENDED_TYPE
|
||||||
// also parse properties of original type
|
|
||||||
parseProperties(nodeMetaInfo, qmlType->baseMetaObject());
|
parseProperties(nodeMetaInfo, qmlType->baseMetaObject());
|
||||||
superTypeName = typeName(qmlType->baseMetaObject()->superClass());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeMetaInfo.setSuperClass(superTypeName);
|
parseClassInfo(nodeMetaInfo, qMetaObject);
|
||||||
|
|
||||||
|
QString superTypeName;
|
||||||
|
int superTypeMajorVersion = -1;
|
||||||
|
int superTypeMinorVersion = -1;
|
||||||
|
if (const QMetaObject *superClassObject = qmlType->baseMetaObject()->superClass())
|
||||||
|
typeInfo(superClassObject, &superTypeName, &superTypeMajorVersion, &superTypeMinorVersion);
|
||||||
|
|
||||||
|
if (!superTypeName.isEmpty())
|
||||||
|
nodeMetaInfo.setSuperClass(superTypeName, superTypeMajorVersion, superTypeMinorVersion);
|
||||||
|
|
||||||
|
if (debug) {
|
||||||
|
qDebug() << "adding qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion()
|
||||||
|
<< ", super class" << superTypeName << superTypeMajorVersion << superTypeMinorVersion;
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
qDebug() << "adding qml type" << nodeMetaInfo.typeName() << nodeMetaInfo.majorVersion() << nodeMetaInfo.minorVersion() << "super class" << superTypeName;
|
|
||||||
m_q->addNodeInfo(nodeMetaInfo);
|
m_q->addNodeInfo(nodeMetaInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MetaInfoPrivate::parseNonQmlTypes()
|
void MetaInfoPrivate::parseNonQmlTypes()
|
||||||
{
|
{
|
||||||
foreach (QDeclarativeType *qmlType, QDeclarativeMetaType::qmlTypes()) {
|
foreach (QDeclarativeType *qmlType, qmlTypes()) {
|
||||||
if (!qmlType->qmlTypeName().contains("Bauhaus"))
|
if (qmlType->qmlTypeName().startsWith("Bauhaus/")
|
||||||
parseNonQmlClassRecursively(qmlType->metaObject(), qmlType->majorVersion(), qmlType->minorVersion());
|
|| qmlType->qmlTypeName().startsWith("QmlProject/"))
|
||||||
|
continue;
|
||||||
|
if (qmlType->metaObject()->superClass())
|
||||||
|
parseNonQmlClassRecursively(qmlType->metaObject()->superClass());
|
||||||
}
|
}
|
||||||
|
|
||||||
parseNonQmlClassRecursively(&QDeclarativeAnchors::staticMetaObject, -1, -1);
|
parseNonQmlClassRecursively(&QDeclarativeAnchors::staticMetaObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -417,12 +484,14 @@ MetaInfo& MetaInfo::operator=(const MetaInfo &other)
|
|||||||
bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const
|
bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const
|
||||||
{
|
{
|
||||||
foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) {
|
foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) {
|
||||||
if (info.availableInVersion(majorVersion, minorVersion)) {
|
if (info.availableInVersion(majorVersion, minorVersion)) { {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!isGlobal())
|
if (!isGlobal())
|
||||||
return global().hasNodeMetaInfo(typeName);
|
return global().hasNodeMetaInfo(typeName);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,16 +500,21 @@ bool MetaInfo::hasNodeMetaInfo(const QString &typeName, int majorVersion, int mi
|
|||||||
*/
|
*/
|
||||||
NodeMetaInfo MetaInfo::nodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const
|
NodeMetaInfo MetaInfo::nodeMetaInfo(const QString &typeName, int majorVersion, int minorVersion) const
|
||||||
{
|
{
|
||||||
|
NodeMetaInfo returnInfo;
|
||||||
foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) {
|
foreach (const NodeMetaInfo &info, m_p->m_nodeMetaInfoHash.values(typeName)) {
|
||||||
// todo: The order for different types for different versions is random here.
|
|
||||||
if (info.availableInVersion(majorVersion, minorVersion)) {
|
if (info.availableInVersion(majorVersion, minorVersion)) {
|
||||||
return info;
|
if (!returnInfo.isValid()
|
||||||
|
|| returnInfo.majorVersion() < info.majorVersion()
|
||||||
|
|| (returnInfo.majorVersion() == info.minorVersion()
|
||||||
|
&& returnInfo.minorVersion() < info.minorVersion()))
|
||||||
|
returnInfo = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isGlobal())
|
if (!returnInfo.isValid()
|
||||||
|
&& !isGlobal())
|
||||||
return global().nodeMetaInfo(typeName);
|
return global().nodeMetaInfo(typeName);
|
||||||
|
|
||||||
return NodeMetaInfo();
|
return returnInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString MetaInfo::fromQtTypes(const QString &type) const
|
QString MetaInfo::fromQtTypes(const QString &type) const
|
||||||
|
|||||||
@@ -210,12 +210,13 @@ public:
|
|||||||
int &minorVersion, QString &defaultPropertyName)
|
int &minorVersion, QString &defaultPropertyName)
|
||||||
{
|
{
|
||||||
const Interpreter::ObjectValue *value = m_context->lookupType(m_doc.data(), astTypeNode);
|
const Interpreter::ObjectValue *value = m_context->lookupType(m_doc.data(), astTypeNode);
|
||||||
|
defaultPropertyName = m_context->defaultPropertyName(value);
|
||||||
|
|
||||||
const Interpreter::QmlObjectValue * qmlValue = dynamic_cast<const Interpreter::QmlObjectValue *>(value);
|
const Interpreter::QmlObjectValue * qmlValue = dynamic_cast<const Interpreter::QmlObjectValue *>(value);
|
||||||
if (qmlValue) {
|
if (qmlValue) {
|
||||||
typeName = qmlValue->packageName() + QLatin1String("/") + qmlValue->className();
|
typeName = qmlValue->packageName() + QLatin1String("/") + qmlValue->className();
|
||||||
majorVersion = qmlValue->majorVersion();
|
majorVersion = qmlValue->majorVersion();
|
||||||
minorVersion = qmlValue->minorVersion();
|
minorVersion = qmlValue->minorVersion();
|
||||||
defaultPropertyName = qmlValue->defaultPropertyName();
|
|
||||||
} else if (value) {
|
} else if (value) {
|
||||||
for (UiQualifiedId *iter = astTypeNode; iter; iter = iter->next)
|
for (UiQualifiedId *iter = astTypeNode; iter; iter = iter->next)
|
||||||
if (!iter->next && iter->name)
|
if (!iter->next && iter->name)
|
||||||
|
|||||||
@@ -72,6 +72,19 @@ void FileSystemWatcher::addFile(const QString &file)
|
|||||||
addFiles(QStringList(file));
|
addFiles(QStringList(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
|
||||||
|
// Returns upper limit of file handles that can be opened by this process at once. Exceeding it will probably result in crashes!
|
||||||
|
static rlim_t getFileLimit()
|
||||||
|
{
|
||||||
|
struct rlimit rl;
|
||||||
|
getrlimit(RLIMIT_NOFILE, &rl);
|
||||||
|
return rl.rlim_cur;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void FileSystemWatcher::addFiles(const QStringList &files)
|
void FileSystemWatcher::addFiles(const QStringList &files)
|
||||||
{
|
{
|
||||||
QStringList toAdd;
|
QStringList toAdd;
|
||||||
@@ -84,6 +97,17 @@ void FileSystemWatcher::addFiles(const QStringList &files)
|
|||||||
qWarning() << "FileSystemWatcher: File" << file << "is already being watched";
|
qWarning() << "FileSystemWatcher: File" << file << "is already being watched";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
static rlim_t maxFileOpen = getFileLimit();
|
||||||
|
// We're potentially watching a _lot_ of directories. This might crash qtcreator when we hit the upper limit.
|
||||||
|
// Heuristic is therefore: Don't use more than half of the file handles available in this watcher
|
||||||
|
if ((rlim_t)m_directories.size() + (rlim_t)m_files.size() > maxFileOpen / 2) {
|
||||||
|
qWarning() << "File" << file << "is not watched: Too many file handles are already open (max is" << maxFileOpen;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_files.append(file);
|
m_files.append(file);
|
||||||
|
|
||||||
const int count = ++m_fileCount[file];
|
const int count = ++m_fileCount[file];
|
||||||
@@ -149,6 +173,17 @@ void FileSystemWatcher::addDirectories(const QStringList &directories)
|
|||||||
qWarning() << "Directory" << directory << "is already being watched";
|
qWarning() << "Directory" << directory << "is already being watched";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
static rlim_t maxFileOpen = getFileLimit();
|
||||||
|
// We're potentially watching a _lot_ of directories. This might crash qtcreator when we hit the upper limit.
|
||||||
|
// Heuristic is therefore: Don't use more than half of the file handles available in this watcher
|
||||||
|
if ((rlim_t)m_directories.size() + (rlim_t)m_files.size() > maxFileOpen / 2) {
|
||||||
|
qWarning() << "Directory" << directory << "is not watched: Too many file handles are already open (max is" << maxFileOpen;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_directories.append(directory);
|
m_directories.append(directory);
|
||||||
|
|
||||||
const int count = ++m_directoryCount[directory];
|
const int count = ++m_directoryCount[directory];
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
<comment>Qt Project include file</comment>
|
<comment>Qt Project include file</comment>
|
||||||
<glob pattern="*.pri"/>
|
<glob pattern="*.pri"/>
|
||||||
</mime-type>
|
</mime-type>
|
||||||
|
<mime-type type="application/vnd.nokia.qt.qmakeprofeaturefile">
|
||||||
|
<sub-class-of type="text/plain"/>
|
||||||
|
<comment>Qt Project feature file</comment>
|
||||||
|
<glob pattern="*.prf"/>
|
||||||
|
</mime-type>
|
||||||
<mime-type type="application/x-linguist">
|
<mime-type type="application/x-linguist">
|
||||||
<sub-class-of type="application/xml"/>
|
<sub-class-of type="application/xml"/>
|
||||||
<comment>message catalog</comment>
|
<comment>message catalog</comment>
|
||||||
|
|||||||
@@ -66,16 +66,27 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
|
|||||||
ui(new Ui::GettingStartedWelcomePageWidget)
|
ui(new Ui::GettingStartedWelcomePageWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
#ifndef QTCREATOR_WITH_QML
|
||||||
|
ui->demosExamplesFrameQml->hide();
|
||||||
|
#endif
|
||||||
|
|
||||||
ui->didYouKnowTextBrowser->viewport()->setAutoFillBackground(false);
|
ui->didYouKnowTextBrowser->viewport()->setAutoFillBackground(false);
|
||||||
|
|
||||||
connect(ui->tutorialTreeWidget, SIGNAL(activated(QString)), SLOT(slotOpenHelpPage(const QString&)));
|
connect(ui->tutorialTreeWidget, SIGNAL(activated(QString)), SLOT(slotOpenHelpPage(const QString&)));
|
||||||
|
|
||||||
ui->tutorialTreeWidget->addItem(tr("The Qt Creator User Interface"),
|
ui->tutorialTreeWidget->addItem(tr("The Qt Creator User Interface"),
|
||||||
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-quick-tour.html"));
|
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-quick-tour.html"));
|
||||||
|
ui->tutorialTreeWidget->addItem(tr("Building and Running an Example"),
|
||||||
|
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-build-example-application.html?view=split"));
|
||||||
ui->tutorialTreeWidget->addItem(tr("Creating a Qt C++ Application"),
|
ui->tutorialTreeWidget->addItem(tr("Creating a Qt C++ Application"),
|
||||||
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-writing-program.html?view=split"));
|
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-writing-program.html?view=split"));
|
||||||
|
ui->tutorialTreeWidget->addItem(tr("Creating a Mobile Application"),
|
||||||
|
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-mobile-example?view=split"));
|
||||||
|
#ifdef QTCREATOR_WITH_QML
|
||||||
ui->tutorialTreeWidget->addItem(tr("Creating a Qt Quick Application"),
|
ui->tutorialTreeWidget->addItem(tr("Creating a Qt Quick Application"),
|
||||||
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-qml-application.html?view=split"));
|
QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-qml-application.html?view=split"));
|
||||||
|
#endif
|
||||||
|
|
||||||
srand(QDateTime::currentDateTime().toTime_t());
|
srand(QDateTime::currentDateTime().toTime_t());
|
||||||
QStringList tips = tipsOfTheDay();
|
QStringList tips = tipsOfTheDay();
|
||||||
@@ -175,8 +186,6 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
const QString &sourcePath)
|
const QString &sourcePath)
|
||||||
{
|
{
|
||||||
ui->qmlExamplesButton->setText(tr("Choose an example..."));
|
ui->qmlExamplesButton->setText(tr("Choose an example..."));
|
||||||
QMenu *menu = new QMenu(ui->qmlExamplesButton);
|
|
||||||
ui->qmlExamplesButton->setMenu(menu);
|
|
||||||
|
|
||||||
QStringList roots;
|
QStringList roots;
|
||||||
roots << (examplePath + QLatin1String("/declarative"))
|
roots << (examplePath + QLatin1String("/declarative"))
|
||||||
@@ -197,6 +206,11 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
exampleProjects.insert(fileName, exampleProject);
|
exampleProjects.insert(fileName, exampleProject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!exampleProjects.isEmpty()) {
|
||||||
|
QMenu *menu = new QMenu(ui->qmlExamplesButton);
|
||||||
|
ui->qmlExamplesButton->setMenu(menu);
|
||||||
|
|
||||||
QMapIterator<QString, QString> it(exampleProjects);
|
QMapIterator<QString, QString> it(exampleProjects);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
@@ -206,6 +220,7 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa
|
|||||||
// FIXME once we have help for QML examples
|
// FIXME once we have help for QML examples
|
||||||
// exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
// exampleAction->setProperty(HelpPathPropertyName, helpPath);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ui->qmlExamplesButton->setEnabled(!exampleProjects.isEmpty());
|
ui->qmlExamplesButton->setEnabled(!exampleProjects.isEmpty());
|
||||||
}
|
}
|
||||||
@@ -380,15 +395,11 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
|
|||||||
tr("Ctrl", "Shortcut key");
|
tr("Ctrl", "Shortcut key");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
tips.append(tr("You can switch between Qt Creator's modes using <tt>Ctrl+number</tt>:<ul>"
|
|
||||||
"<li>1 - Welcome</li><li>2 - Edit</li><li>3 - Debug</li><li>4 - Projects</li><li>5 - Help</li></ul>"));
|
|
||||||
//:%1 gets replaced by Alt (Win/Unix) or Cmd (Mac)
|
//:%1 gets replaced by Alt (Win/Unix) or Cmd (Mac)
|
||||||
tips.append(tr("You can show and hide the side bar using <tt>%1+0<tt>.").arg(altShortcut));
|
tips.append(tr("You can show and hide the side bar using <tt>%1+0<tt>.").arg(altShortcut));
|
||||||
tips.append(tr("You can fine tune the <tt>Find</tt> function by selecting "Whole Words" "
|
tips.append(tr("You can fine tune the <tt>Find</tt> function by selecting "Whole Words" "
|
||||||
"or "Case Sensitive". Simply click on the icons on the right end of the line edit."));
|
"or "Case Sensitive". Simply click on the icons on the right end of the line edit."));
|
||||||
tips.append(tr("If you add <a href=\"qthelp://com.nokia.qtcreator/doc/creator-external-library-handling.html\""
|
tips.append(tr("If you add external libraries to your project, Qt Creator will automatically offer syntax highlighting "
|
||||||
">external libraries</a>, Qt Creator will automatically offer syntax highlighting "
|
|
||||||
"and code completion."));
|
"and code completion."));
|
||||||
tips.append(tr("The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> "
|
tips.append(tr("The code completion is CamelCase-aware. For example, to complete <tt>namespaceUri</tt> "
|
||||||
"you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>."));
|
"you can just type <tt>nU</tt> and hit <tt>Ctrl+Space</tt>."));
|
||||||
@@ -403,9 +414,9 @@ QStringList GettingStartedWelcomePageWidget::tipsOfTheDay()
|
|||||||
tips.append(tr("You can quickly search methods, classes, help and more using the "
|
tips.append(tr("You can quickly search methods, classes, help and more using the "
|
||||||
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-navigation.html\">Locator bar</a> (<tt>%1+K</tt>).").arg(ctrlShortcut));
|
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-navigation.html\">Locator bar</a> (<tt>%1+K</tt>).").arg(ctrlShortcut));
|
||||||
tips.append(tr("You can add custom build steps in the "
|
tips.append(tr("You can add custom build steps in the "
|
||||||
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#build-settings\">build settings</a>."));
|
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-build-settings.html\">build settings</a>."));
|
||||||
tips.append(tr("Within a session, you can add "
|
tips.append(tr("Within a session, you can add "
|
||||||
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-project-pane.html#dependencies\">dependencies</a> between projects."));
|
"<a href=\"qthelp://com.nokia.qtcreator/doc/creator-build-dependencies.html\">dependencies</a> between projects."));
|
||||||
tips.append(tr("You can set the preferred editor encoding for every project in <tt>Projects -> Editor Settings -> Default Encoding</tt>."));
|
tips.append(tr("You can set the preferred editor encoding for every project in <tt>Projects -> Editor Settings -> Default Encoding</tt>."));
|
||||||
tips.append(tr("You can use Qt Creator with a number of <a href=\"qthelp://com.nokia.qtcreator/doc/creator-version-control.html\">"
|
tips.append(tr("You can use Qt Creator with a number of <a href=\"qthelp://com.nokia.qtcreator/doc/creator-version-control.html\">"
|
||||||
"revision control systems</a> such as Subversion, Perforce, CVS and Git."));
|
"revision control systems</a> such as Subversion, Perforce, CVS and Git."));
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QFrame" name="demosExamplesFrame_2">
|
<widget class="QFrame" name="demosExamplesFrameQml">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="Utils::WelcomeModeLabel" name="demoTitleLabel_2">
|
<widget class="Utils::WelcomeModeLabel" name="demoTitleLabeldemosExamplesFrameQml">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Explore Qt Quick Examples</string>
|
<string>Explore Qt Quick Examples</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ using namespace Qt4ProjectManager::Internal;
|
|||||||
|
|
||||||
ProFileEditorFactory::ProFileEditorFactory(Qt4Manager *manager, TextEditor::TextEditorActionHandler *handler) :
|
ProFileEditorFactory::ProFileEditorFactory(Qt4Manager *manager, TextEditor::TextEditorActionHandler *handler) :
|
||||||
m_mimeTypes(QStringList() << QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)
|
m_mimeTypes(QStringList() << QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)
|
||||||
<< QLatin1String(Qt4ProjectManager::Constants::PROINCLUDEFILE_MIMETYPE)),
|
<< QLatin1String(Qt4ProjectManager::Constants::PROINCLUDEFILE_MIMETYPE)
|
||||||
|
<< QLatin1String(Qt4ProjectManager::Constants::PROFEATUREFILE_MIMETYPE)),
|
||||||
m_manager(manager),
|
m_manager(manager),
|
||||||
m_actionHandler(handler)
|
m_actionHandler(handler)
|
||||||
{
|
{
|
||||||
@@ -56,6 +57,8 @@ ProFileEditorFactory::ProFileEditorFactory(Qt4Manager *manager, TextEditor::Text
|
|||||||
QLatin1String("pro"));
|
QLatin1String("pro"));
|
||||||
iconProvider->registerIconOverlayForSuffix(QIcon(":/qt4projectmanager/images/qt_project.png"),
|
iconProvider->registerIconOverlayForSuffix(QIcon(":/qt4projectmanager/images/qt_project.png"),
|
||||||
QLatin1String("pri"));
|
QLatin1String("pri"));
|
||||||
|
iconProvider->registerIconOverlayForSuffix(QIcon(":/qt4projectmanager/images/qt_project.png"),
|
||||||
|
QLatin1String("prf"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ProFileEditorFactory::~ProFileEditorFactory()
|
ProFileEditorFactory::~ProFileEditorFactory()
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const char * const PROFILE_EDITOR_ID = "Qt4.proFileEditor";
|
|||||||
const char * const PROFILE_EDITOR_DISPLAY_NAME = QT_TRANSLATE_NOOP("OpenWith::Editors", ".pro File Editor");
|
const char * const PROFILE_EDITOR_DISPLAY_NAME = QT_TRANSLATE_NOOP("OpenWith::Editors", ".pro File Editor");
|
||||||
const char * const PROFILE_MIMETYPE = "application/vnd.nokia.qt.qmakeprofile";
|
const char * const PROFILE_MIMETYPE = "application/vnd.nokia.qt.qmakeprofile";
|
||||||
const char * const PROINCLUDEFILE_MIMETYPE = "application/vnd.nokia.qt.qmakeproincludefile";
|
const char * const PROINCLUDEFILE_MIMETYPE = "application/vnd.nokia.qt.qmakeproincludefile";
|
||||||
|
const char * const PROFEATUREFILE_MIMETYPE = "application/vnd.nokia.qt.qmakeprofeaturefile";
|
||||||
const char * const CPP_SOURCE_MIMETYPE = "text/x-c++src";
|
const char * const CPP_SOURCE_MIMETYPE = "text/x-c++src";
|
||||||
const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
|
const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr";
|
||||||
const char * const FORM_MIMETYPE = "application/x-designer";
|
const char * const FORM_MIMETYPE = "application/x-designer";
|
||||||
|
|||||||
@@ -209,7 +209,9 @@ void ResourceEditorFile::reload(ReloadFlag flag, ChangeType type)
|
|||||||
if (type == TypePermissions) {
|
if (type == TypePermissions) {
|
||||||
emit changed();
|
emit changed();
|
||||||
} else {
|
} else {
|
||||||
m_parent->open(m_parent->m_resourceEditor->fileName());
|
emit aboutToReload();
|
||||||
|
if (m_parent->open(m_parent->m_resourceEditor->fileName()))
|
||||||
|
emit reloaded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,12 +142,8 @@ BaseTextDocument::BaseTextDocument()
|
|||||||
|
|
||||||
BaseTextDocument::~BaseTextDocument()
|
BaseTextDocument::~BaseTextDocument()
|
||||||
{
|
{
|
||||||
QTextBlock block = m_document->begin();
|
documentClosing();
|
||||||
while (block.isValid()) {
|
|
||||||
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData()))
|
|
||||||
data->documentClosing();
|
|
||||||
block = block.next();
|
|
||||||
}
|
|
||||||
delete m_document;
|
delete m_document;
|
||||||
m_document = 0;
|
m_document = 0;
|
||||||
}
|
}
|
||||||
@@ -332,6 +328,8 @@ void BaseTextDocument::reload(QTextCodec *codec)
|
|||||||
void BaseTextDocument::reload()
|
void BaseTextDocument::reload()
|
||||||
{
|
{
|
||||||
emit aboutToReload();
|
emit aboutToReload();
|
||||||
|
documentClosing(); // removes text marks non-permanently
|
||||||
|
|
||||||
if (open(m_fileName))
|
if (open(m_fileName))
|
||||||
emit reloaded();
|
emit reloaded();
|
||||||
}
|
}
|
||||||
@@ -383,7 +381,6 @@ void BaseTextDocument::cleanWhitespace(const QTextCursor &cursor)
|
|||||||
|
|
||||||
void BaseTextDocument::cleanWhitespace(QTextCursor &cursor, bool cleanIndentation, bool inEntireDocument)
|
void BaseTextDocument::cleanWhitespace(QTextCursor &cursor, bool cleanIndentation, bool inEntireDocument)
|
||||||
{
|
{
|
||||||
|
|
||||||
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(m_document->documentLayout());
|
BaseTextDocumentLayout *documentLayout = qobject_cast<BaseTextDocumentLayout*>(m_document->documentLayout());
|
||||||
|
|
||||||
QTextBlock block = m_document->findBlock(cursor.selectionStart());
|
QTextBlock block = m_document->findBlock(cursor.selectionStart());
|
||||||
@@ -431,3 +428,13 @@ void BaseTextDocument::ensureFinalNewLine(QTextCursor& cursor)
|
|||||||
cursor.insertText(QLatin1String("\n"));
|
cursor.insertText(QLatin1String("\n"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseTextDocument::documentClosing()
|
||||||
|
{
|
||||||
|
QTextBlock block = m_document->begin();
|
||||||
|
while (block.isValid()) {
|
||||||
|
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(block.userData()))
|
||||||
|
data->documentClosing();
|
||||||
|
block = block.next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -117,8 +117,6 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void titleChanged(QString title);
|
void titleChanged(QString title);
|
||||||
void aboutToReload();
|
|
||||||
void reloaded();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
@@ -151,6 +149,7 @@ private:
|
|||||||
|
|
||||||
void cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument);
|
void cleanWhitespace(QTextCursor& cursor, bool cleanIndentation, bool inEntireDocument);
|
||||||
void ensureFinalNewLine(QTextCursor& cursor);
|
void ensureFinalNewLine(QTextCursor& cursor);
|
||||||
|
void documentClosing();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace TextEditor
|
} // namespace TextEditor
|
||||||
|
|||||||
@@ -2015,8 +2015,8 @@ QTextBlock BaseTextEditor::foldedBlockAt(const QPoint &pos, QRect *box) const
|
|||||||
{
|
{
|
||||||
QPointF offset(contentOffset());
|
QPointF offset(contentOffset());
|
||||||
QTextBlock block = firstVisibleBlock();
|
QTextBlock block = firstVisibleBlock();
|
||||||
int top = (int)blockBoundingGeometry(block).translated(offset).top();
|
qreal top = blockBoundingGeometry(block).translated(offset).top();
|
||||||
int bottom = top + (int)blockBoundingRect(block).height();
|
qreal bottom = top + blockBoundingRect(block).height();
|
||||||
|
|
||||||
int viewportHeight = viewport()->height();
|
int viewportHeight = viewport()->height();
|
||||||
|
|
||||||
@@ -2050,7 +2050,7 @@ QTextBlock BaseTextEditor::foldedBlockAt(const QPoint &pos, QRect *box) const
|
|||||||
|
|
||||||
block = nextBlock;
|
block = nextBlock;
|
||||||
top = bottom;
|
top = bottom;
|
||||||
bottom = top + (int)blockBoundingRect(block).height();
|
bottom = top + blockBoundingRect(block).height();
|
||||||
}
|
}
|
||||||
return QTextBlock();
|
return QTextBlock();
|
||||||
}
|
}
|
||||||
@@ -2283,8 +2283,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
QRect er = e->rect();
|
QRect er = e->rect();
|
||||||
QRect viewportRect = viewport()->rect();
|
QRect viewportRect = viewport()->rect();
|
||||||
|
|
||||||
const QColor baseColor = palette().base().color();
|
|
||||||
|
|
||||||
qreal lineX = 0;
|
qreal lineX = 0;
|
||||||
|
|
||||||
if (d->m_visibleWrapColumn > 0) {
|
if (d->m_visibleWrapColumn > 0) {
|
||||||
@@ -2318,6 +2316,8 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
QAbstractTextDocumentLayout::PaintContext context = getPaintContext();
|
QAbstractTextDocumentLayout::PaintContext context = getPaintContext();
|
||||||
|
|
||||||
if (!d->m_highlightBlocksInfo.isEmpty()) {
|
if (!d->m_highlightBlocksInfo.isEmpty()) {
|
||||||
|
const QColor baseColor = palette().base().color();
|
||||||
|
|
||||||
// extra pass for the block highlight
|
// extra pass for the block highlight
|
||||||
|
|
||||||
const int margin = 5;
|
const int margin = 5;
|
||||||
@@ -2345,7 +2345,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
int vi = i > 0 ? d->m_highlightBlocksInfo.visualIndent.at(i-1) : 0;
|
int vi = i > 0 ? d->m_highlightBlocksInfo.visualIndent.at(i-1) : 0;
|
||||||
painter.fillRect(rr.adjusted(vi, 0, -8*i, 0), calcBlendColor(baseColor, i, count));
|
painter.fillRect(rr.adjusted(vi, 0, -8*i, 0), calcBlendColor(baseColor, i, count));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
offsetFP.ry() += r.height();
|
offsetFP.ry() += r.height();
|
||||||
|
|
||||||
@@ -2610,8 +2609,8 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
offset = contentOffset();
|
offset = contentOffset();
|
||||||
block = firstVisibleBlock();
|
block = firstVisibleBlock();
|
||||||
|
|
||||||
int top = (int)blockBoundingGeometry(block).translated(offset).top();
|
qreal top = blockBoundingGeometry(block).translated(offset).top();
|
||||||
int bottom = top + (int)blockBoundingRect(block).height();
|
qreal bottom = top + blockBoundingRect(block).height();
|
||||||
|
|
||||||
QTextCursor cursor = textCursor();
|
QTextCursor cursor = textCursor();
|
||||||
bool hasSelection = cursor.hasSelection();
|
bool hasSelection = cursor.hasSelection();
|
||||||
@@ -2642,8 +2641,9 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
QTextLine line = layout->lineAt(i);
|
QTextLine line = layout->lineAt(i);
|
||||||
QRectF lineRect = line.naturalTextRect().translated(offset.x(), top);
|
QRectF lineRect = line.naturalTextRect().translated(offset.x(), top);
|
||||||
QChar visualArrow((ushort)0x21b5);
|
QChar visualArrow((ushort)0x21b5);
|
||||||
painter.drawText(static_cast<int>(lineRect.right()),
|
painter.drawText(QPointF(lineRect.right(),
|
||||||
static_cast<int>(lineRect.top() + line.ascent()), visualArrow);
|
lineRect.top() + line.ascent()),
|
||||||
|
visualArrow);
|
||||||
}
|
}
|
||||||
if (!nextBlock.isValid()) { // paint EOF symbol
|
if (!nextBlock.isValid()) { // paint EOF symbol
|
||||||
QTextLine line = layout->lineAt(lineCount-1);
|
QTextLine line = layout->lineAt(lineCount-1);
|
||||||
@@ -2724,55 +2724,7 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
block = nextVisibleBlock;
|
block = nextVisibleBlock;
|
||||||
top = bottom;
|
top = bottom;
|
||||||
bottom = top + (int)blockBoundingRect(block).height();
|
bottom = top + blockBoundingRect(block).height();
|
||||||
}
|
|
||||||
|
|
||||||
if (visibleCollapsedBlock.isValid() ) {
|
|
||||||
int margin = doc->documentMargin();
|
|
||||||
qreal maxWidth = 0;
|
|
||||||
qreal blockHeight = 0;
|
|
||||||
QTextBlock b = visibleCollapsedBlock;
|
|
||||||
|
|
||||||
while (!b.isVisible()) {
|
|
||||||
b.setVisible(true); // make sure block bounding rect works
|
|
||||||
QRectF r = blockBoundingRect(b).translated(visibleCollapsedBlockOffset);
|
|
||||||
|
|
||||||
QTextLayout *layout = b.layout();
|
|
||||||
for (int i = layout->lineCount()-1; i >= 0; --i)
|
|
||||||
maxWidth = qMax(maxWidth, layout->lineAt(i).naturalTextWidth() + 2*margin);
|
|
||||||
|
|
||||||
blockHeight += r.height();
|
|
||||||
|
|
||||||
b.setVisible(false); // restore previous state
|
|
||||||
b.setLineCount(0); // restore 0 line count for invisible block
|
|
||||||
b = b.next();
|
|
||||||
}
|
|
||||||
|
|
||||||
painter.save();
|
|
||||||
painter.setRenderHint(QPainter::Antialiasing, true);
|
|
||||||
painter.translate(.5, .5);
|
|
||||||
QBrush brush = baseColor;
|
|
||||||
if (d->m_ifdefedOutFormat.hasProperty(QTextFormat::BackgroundBrush))
|
|
||||||
brush = d->m_ifdefedOutFormat.background();
|
|
||||||
painter.setBrush(brush);
|
|
||||||
painter.drawRoundedRect(QRectF(visibleCollapsedBlockOffset.x(),
|
|
||||||
visibleCollapsedBlockOffset.y(),
|
|
||||||
maxWidth, blockHeight).adjusted(0, 0, 0, 0), 3, 3);
|
|
||||||
painter.restore();
|
|
||||||
|
|
||||||
QTextBlock end = b;
|
|
||||||
b = visibleCollapsedBlock;
|
|
||||||
while (b != end) {
|
|
||||||
b.setVisible(true); // make sure block bounding rect works
|
|
||||||
QRectF r = blockBoundingRect(b).translated(visibleCollapsedBlockOffset);
|
|
||||||
QTextLayout *layout = b.layout();
|
|
||||||
QVector<QTextLayout::FormatRange> selections;
|
|
||||||
layout->draw(&painter, visibleCollapsedBlockOffset, selections, er);
|
|
||||||
|
|
||||||
b.setVisible(false); // restore previous state
|
|
||||||
visibleCollapsedBlockOffset.ry() += r.height();
|
|
||||||
b = b.next();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->m_animator && d->m_animator->isRunning()) {
|
if (d->m_animator && d->m_animator->isRunning()) {
|
||||||
@@ -2798,6 +2750,64 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
|
|||||||
cursor_layout->drawCursor(&painter, cursor_offset, cursor_cpos, cursorWidth());
|
cursor_layout->drawCursor(&painter, cursor_offset, cursor_cpos, cursorWidth());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (visibleCollapsedBlock.isValid()) {
|
||||||
|
drawCollapsedBlockPopup(painter,
|
||||||
|
visibleCollapsedBlock,
|
||||||
|
visibleCollapsedBlockOffset,
|
||||||
|
er);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void BaseTextEditor::drawCollapsedBlockPopup(QPainter &painter,
|
||||||
|
const QTextBlock &block,
|
||||||
|
QPointF offset,
|
||||||
|
const QRect &clip)
|
||||||
|
{
|
||||||
|
int margin = block.document()->documentMargin();
|
||||||
|
qreal maxWidth = 0;
|
||||||
|
qreal blockHeight = 0;
|
||||||
|
QTextBlock b = block;
|
||||||
|
|
||||||
|
while (!b.isVisible()) {
|
||||||
|
b.setVisible(true); // make sure block bounding rect works
|
||||||
|
QRectF r = blockBoundingRect(b).translated(offset);
|
||||||
|
|
||||||
|
QTextLayout *layout = b.layout();
|
||||||
|
for (int i = layout->lineCount()-1; i >= 0; --i)
|
||||||
|
maxWidth = qMax(maxWidth, layout->lineAt(i).naturalTextWidth() + 2*margin);
|
||||||
|
|
||||||
|
blockHeight += r.height();
|
||||||
|
|
||||||
|
b.setVisible(false); // restore previous state
|
||||||
|
b.setLineCount(0); // restore 0 line count for invisible block
|
||||||
|
b = b.next();
|
||||||
|
}
|
||||||
|
|
||||||
|
painter.save();
|
||||||
|
painter.setRenderHint(QPainter::Antialiasing, true);
|
||||||
|
painter.translate(.5, .5);
|
||||||
|
QBrush brush = palette().base();
|
||||||
|
if (d->m_ifdefedOutFormat.hasProperty(QTextFormat::BackgroundBrush))
|
||||||
|
brush = d->m_ifdefedOutFormat.background();
|
||||||
|
painter.setBrush(brush);
|
||||||
|
painter.drawRoundedRect(QRectF(offset.x(),
|
||||||
|
offset.y(),
|
||||||
|
maxWidth, blockHeight).adjusted(0, 0, 0, 0), 3, 3);
|
||||||
|
painter.restore();
|
||||||
|
|
||||||
|
QTextBlock end = b;
|
||||||
|
b = block;
|
||||||
|
while (b != end) {
|
||||||
|
b.setVisible(true); // make sure block bounding rect works
|
||||||
|
QRectF r = blockBoundingRect(b).translated(offset);
|
||||||
|
QTextLayout *layout = b.layout();
|
||||||
|
QVector<QTextLayout::FormatRange> selections;
|
||||||
|
layout->draw(&painter, offset, selections, clip);
|
||||||
|
|
||||||
|
b.setVisible(false); // restore previous state
|
||||||
|
offset.ry() += r.height();
|
||||||
|
b = b.next();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *BaseTextEditor::extraArea() const
|
QWidget *BaseTextEditor::extraArea() const
|
||||||
@@ -2898,7 +2908,6 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
|||||||
int selStart = textCursor().selectionStart();
|
int selStart = textCursor().selectionStart();
|
||||||
int selEnd = textCursor().selectionEnd();
|
int selEnd = textCursor().selectionEnd();
|
||||||
|
|
||||||
const QColor baseColor = palette().base().color();
|
|
||||||
QPalette pal = d->m_extraArea->palette();
|
QPalette pal = d->m_extraArea->palette();
|
||||||
pal.setCurrentColorGroup(QPalette::Active);
|
pal.setCurrentColorGroup(QPalette::Active);
|
||||||
QPainter painter(d->m_extraArea);
|
QPainter painter(d->m_extraArea);
|
||||||
@@ -2924,7 +2933,8 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
|||||||
while (block.isValid() && top <= e->rect().bottom()) {
|
while (block.isValid() && top <= e->rect().bottom()) {
|
||||||
|
|
||||||
top = bottom;
|
top = bottom;
|
||||||
bottom = top + blockBoundingRect(block).height();
|
const qreal height = blockBoundingRect(block).height();
|
||||||
|
bottom = top + height;
|
||||||
QTextBlock nextBlock = block.next();
|
QTextBlock nextBlock = block.next();
|
||||||
|
|
||||||
QTextBlock nextVisibleBlock = nextBlock;
|
QTextBlock nextVisibleBlock = nextBlock;
|
||||||
@@ -3056,7 +3066,7 @@ void BaseTextEditor::extraAreaPaintEvent(QPaintEvent *e)
|
|||||||
painter.setFont(f);
|
painter.setFont(f);
|
||||||
painter.setPen(d->m_currentLineNumberFormat.foreground().color());
|
painter.setPen(d->m_currentLineNumberFormat.foreground().color());
|
||||||
}
|
}
|
||||||
painter.drawText(markWidth, top, extraAreaWidth - markWidth - 4, fm.height(), Qt::AlignRight, number);
|
painter.drawText(QRectF(markWidth, top, extraAreaWidth - markWidth - 4, height), Qt::AlignRight, number);
|
||||||
if (selected)
|
if (selected)
|
||||||
painter.restore();
|
painter.restore();
|
||||||
}
|
}
|
||||||
@@ -3497,7 +3507,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
|||||||
toggleBlockVisible(c);
|
toggleBlockVisible(c);
|
||||||
d->moveCursorVisible(false);
|
d->moveCursorVisible(false);
|
||||||
}
|
}
|
||||||
} else if (d->m_lineNumbersVisible && e->pos().x() > markWidth) {
|
} else if (e->pos().x() > markWidth) {
|
||||||
QTextCursor selection = cursor;
|
QTextCursor selection = cursor;
|
||||||
selection.setVisualNavigation(true);
|
selection.setVisualNavigation(true);
|
||||||
d->extraAreaSelectionAnchorBlockNumber = selection.blockNumber();
|
d->extraAreaSelectionAnchorBlockNumber = selection.blockNumber();
|
||||||
|
|||||||
@@ -492,6 +492,11 @@ private:
|
|||||||
bool active,
|
bool active,
|
||||||
bool hovered) const;
|
bool hovered) const;
|
||||||
|
|
||||||
|
void drawCollapsedBlockPopup(QPainter &painter,
|
||||||
|
const QTextBlock &block,
|
||||||
|
QPointF offset,
|
||||||
|
const QRect &clip);
|
||||||
|
|
||||||
void toggleBlockVisible(const QTextBlock &block);
|
void toggleBlockVisible(const QTextBlock &block);
|
||||||
QRect foldBox();
|
QRect foldBox();
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include "basetextmark.h"
|
#include "basetextmark.h"
|
||||||
|
|
||||||
|
#include "basetextdocument.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
@@ -37,18 +39,25 @@
|
|||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
BaseTextMark::BaseTextMark()
|
|
||||||
: m_markableInterface(0), m_internalMark(0), m_init(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BaseTextMark::BaseTextMark(const QString &filename, int line)
|
BaseTextMark::BaseTextMark(const QString &filename, int line)
|
||||||
: m_markableInterface(0), m_internalMark(0), m_fileName(filename), m_line(line), m_init(false)
|
: m_markableInterface(0)
|
||||||
|
, m_internalMark(0)
|
||||||
|
, m_fileName(filename)
|
||||||
|
, m_line(line)
|
||||||
|
, m_init(false)
|
||||||
{
|
{
|
||||||
// Why is this?
|
// Why is this?
|
||||||
QTimer::singleShot(0, this, SLOT(init()));
|
QTimer::singleShot(0, this, SLOT(init()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BaseTextMark::~BaseTextMark()
|
||||||
|
{
|
||||||
|
// oha we are deleted
|
||||||
|
if (m_markableInterface)
|
||||||
|
m_markableInterface->removeMark(m_internalMark);
|
||||||
|
removeInternalMark();
|
||||||
|
}
|
||||||
|
|
||||||
void BaseTextMark::init()
|
void BaseTextMark::init()
|
||||||
{
|
{
|
||||||
m_init = true;
|
m_init = true;
|
||||||
@@ -73,39 +82,49 @@ void BaseTextMark::editorOpened(Core::IEditor *editor)
|
|||||||
m_markableInterface = textEditor->markableInterface();
|
m_markableInterface = textEditor->markableInterface();
|
||||||
m_internalMark = new InternalMark(this);
|
m_internalMark = new InternalMark(this);
|
||||||
|
|
||||||
if (!m_markableInterface->addMark(m_internalMark, m_line)) {
|
if (m_markableInterface->addMark(m_internalMark, m_line)) {
|
||||||
delete m_internalMark;
|
// Handle reload of text documents, readding the mark as necessary
|
||||||
m_internalMark = 0;
|
connect(textEditor->file(), SIGNAL(reloaded()),
|
||||||
m_markableInterface = 0;
|
this, SLOT(documentReloaded()), Qt::UniqueConnection);
|
||||||
|
} else {
|
||||||
|
removeInternalMark();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BaseTextMark::documentReloaded()
|
||||||
|
{
|
||||||
|
if (m_markableInterface)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BaseTextDocument *doc = qobject_cast<BaseTextDocument*>(sender());
|
||||||
|
if (!doc)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_markableInterface = doc->documentMarker();
|
||||||
|
m_internalMark = new InternalMark(this);
|
||||||
|
|
||||||
|
if (!m_markableInterface->addMark(m_internalMark, m_line))
|
||||||
|
removeInternalMark();
|
||||||
|
}
|
||||||
|
|
||||||
void BaseTextMark::childRemovedFromEditor(InternalMark *mark)
|
void BaseTextMark::childRemovedFromEditor(InternalMark *mark)
|
||||||
{
|
{
|
||||||
Q_UNUSED(mark)
|
Q_UNUSED(mark)
|
||||||
// m_internalMark was removed from the editor
|
// m_internalMark was removed from the editor
|
||||||
delete m_internalMark;
|
removeInternalMark();
|
||||||
m_markableInterface = 0;
|
|
||||||
m_internalMark = 0;
|
|
||||||
removedFromEditor();
|
removedFromEditor();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseTextMark::documentClosingFor(InternalMark *mark)
|
void BaseTextMark::documentClosingFor(InternalMark *mark)
|
||||||
{
|
{
|
||||||
Q_UNUSED(mark)
|
Q_UNUSED(mark)
|
||||||
// the document is closing
|
removeInternalMark();
|
||||||
delete m_internalMark;
|
|
||||||
m_markableInterface = 0;
|
|
||||||
m_internalMark = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseTextMark::~BaseTextMark()
|
void BaseTextMark::removeInternalMark()
|
||||||
{
|
{
|
||||||
// oha we are deleted
|
|
||||||
if (m_markableInterface)
|
|
||||||
m_markableInterface->removeMark(m_internalMark);
|
|
||||||
delete m_internalMark;
|
delete m_internalMark;
|
||||||
m_internalMark = 0;
|
m_internalMark = 0;
|
||||||
m_markableInterface = 0;
|
m_markableInterface = 0;
|
||||||
@@ -128,13 +147,10 @@ void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
|
|||||||
m_init = true;
|
m_init = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (m_markableInterface)
|
if (m_markableInterface)
|
||||||
m_markableInterface->removeMark(m_internalMark);
|
m_markableInterface->removeMark(m_internalMark);
|
||||||
m_markableInterface = 0;
|
// This is only necessary since m_internalMark is created in editorOpened
|
||||||
// This is only necessary since m_internalMark is created in ediorOpened
|
removeInternalMark();
|
||||||
delete m_internalMark;
|
|
||||||
m_internalMark = 0;
|
|
||||||
|
|
||||||
foreach (Core::IEditor *editor, em->openedEditors())
|
foreach (Core::IEditor *editor, em->openedEditors())
|
||||||
editorOpened(editor);
|
editorOpened(editor);
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ class TEXTEDITOR_EXPORT BaseTextMark : public QObject
|
|||||||
{
|
{
|
||||||
friend class Internal::InternalMark;
|
friend class Internal::InternalMark;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseTextMark();
|
|
||||||
BaseTextMark(const QString &filename, int line);
|
BaseTextMark(const QString &filename, int line);
|
||||||
~BaseTextMark();
|
~BaseTextMark();
|
||||||
|
|
||||||
@@ -69,12 +69,16 @@ public:
|
|||||||
int lineNumber() const { return m_line; }
|
int lineNumber() const { return m_line; }
|
||||||
|
|
||||||
void moveMark(const QString &filename, int line);
|
void moveMark(const QString &filename, int line);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void editorOpened(Core::IEditor *editor);
|
|
||||||
void init();
|
void init();
|
||||||
|
void editorOpened(Core::IEditor *editor);
|
||||||
|
void documentReloaded();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void childRemovedFromEditor(Internal::InternalMark *mark);
|
void childRemovedFromEditor(Internal::InternalMark *mark);
|
||||||
void documentClosingFor(Internal::InternalMark *mark);
|
void documentClosingFor(Internal::InternalMark *mark);
|
||||||
|
void removeInternalMark();
|
||||||
|
|
||||||
ITextMarkable *m_markableInterface;
|
ITextMarkable *m_markableInterface;
|
||||||
Internal::InternalMark *m_internalMark;
|
Internal::InternalMark *m_internalMark;
|
||||||
|
|||||||
@@ -334,6 +334,8 @@ bool CompletionListView::event(QEvent *e)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
m_completionWidget->closeList(index);
|
m_completionWidget->closeList(index);
|
||||||
|
if (m_infoFrame)
|
||||||
|
m_infoFrame->close();
|
||||||
return true;
|
return true;
|
||||||
} else if (e->type() == QEvent::ShortcutOverride) {
|
} else if (e->type() == QEvent::ShortcutOverride) {
|
||||||
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
|
QKeyEvent *ke = static_cast<QKeyEvent *>(e);
|
||||||
|
|||||||
@@ -257,9 +257,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QByteArray code;
|
QByteArray code;
|
||||||
code += "import Qt 4.7;\n";
|
code += "import Qt 4.7;\n";
|
||||||
code += "import Qt.widgets 4.7;\n";
|
|
||||||
code += "import Qt.multimedia 1.0;\n";
|
|
||||||
code += "import Qt.labs.particles 4.7;\n";
|
code += "import Qt.labs.particles 4.7;\n";
|
||||||
|
code += "import Qt.labs.gestures 4.7;\n";
|
||||||
|
code += "import Qt.labs.folderlistmodel 4.7;\n";
|
||||||
code += "import org.webkit 1.0;\n";
|
code += "import org.webkit 1.0;\n";
|
||||||
code += "Item {}";
|
code += "Item {}";
|
||||||
QDeclarativeComponent c(engine);
|
QDeclarativeComponent c(engine);
|
||||||
@@ -313,9 +313,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QByteArray code;
|
QByteArray code;
|
||||||
code += "import Qt 4.7;\n";
|
code += "import Qt 4.7;\n";
|
||||||
code += "import Qt.widgets 4.7;\n";
|
|
||||||
code += "import Qt.multimedia 1.0;\n";
|
|
||||||
code += "import Qt.labs.particles 4.7;\n";
|
code += "import Qt.labs.particles 4.7;\n";
|
||||||
|
code += "import Qt.labs.gestures 4.7;\n";
|
||||||
|
code += "import Qt.labs.folderlistmodel 4.7;\n";
|
||||||
code += "import org.webkit 1.0;\n";
|
code += "import org.webkit 1.0;\n";
|
||||||
code += tyName;
|
code += tyName;
|
||||||
code += " {}\n";
|
code += " {}\n";
|
||||||
|
|||||||
@@ -3343,35 +3343,6 @@ void TestCore::testSubComponentManager()
|
|||||||
QVERIFY(myButtonMetaInfo.property("border.width", true).isValid());
|
QVERIFY(myButtonMetaInfo.property("border.width", true).isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCore::testComponentLoadingTabWidget()
|
|
||||||
{
|
|
||||||
|
|
||||||
QSKIP("TODO: fails", SkipAll);
|
|
||||||
|
|
||||||
QString fileName = QString(QTCREATORDIR) + "/tests/auto/qml/qmldesigner/data/fx/tabs.qml";
|
|
||||||
QFile file(fileName);
|
|
||||||
QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text));
|
|
||||||
|
|
||||||
QPlainTextEdit textEdit;
|
|
||||||
textEdit.setPlainText(file.readAll());
|
|
||||||
NotIndentingTextEditModifier modifier(&textEdit);
|
|
||||||
|
|
||||||
QScopedPointer<Model> model(Model::create("Qt/Item"));
|
|
||||||
model->setFileUrl(QUrl::fromLocalFile(fileName));
|
|
||||||
QScopedPointer<SubComponentManager> subComponentManager(new SubComponentManager(model->metaInfo(), 0));
|
|
||||||
subComponentManager->update(QUrl::fromLocalFile(fileName), modifier.text().toUtf8());
|
|
||||||
|
|
||||||
QScopedPointer<TestRewriterView> testRewriterView(new TestRewriterView());
|
|
||||||
testRewriterView->setTextModifier(&modifier);
|
|
||||||
model->attachView(testRewriterView.data());
|
|
||||||
|
|
||||||
QVERIFY(testRewriterView->errors().isEmpty());
|
|
||||||
QVERIFY(testRewriterView->rootModelNode().isValid());
|
|
||||||
|
|
||||||
ModelNode rootModelNode = testRewriterView->rootModelNode();
|
|
||||||
QCOMPARE(rootModelNode.type(), QLatin1String("TabWidget"));
|
|
||||||
}
|
|
||||||
|
|
||||||
void TestCore::testAnchorsAndRewriting()
|
void TestCore::testAnchorsAndRewriting()
|
||||||
{
|
{
|
||||||
const QString qmlString("import Qt 4.7\n"
|
const QString qmlString("import Qt 4.7\n"
|
||||||
@@ -3606,6 +3577,16 @@ void TestCore::testMetaInfo()
|
|||||||
{
|
{
|
||||||
QScopedPointer<Model> model(Model::create("Qt/Item"));
|
QScopedPointer<Model> model(Model::create("Qt/Item"));
|
||||||
QVERIFY(model.data());
|
QVERIFY(model.data());
|
||||||
|
|
||||||
|
// test whether default type is registered
|
||||||
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
|
||||||
|
|
||||||
|
// test whether types from plugins are registered
|
||||||
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("org.webkit/WebView", 1, 0));
|
||||||
|
|
||||||
|
// test whether non-qml type is registered
|
||||||
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("QGraphicsObject", 4, 7)); // Qt 4.7 namespace
|
||||||
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("QGraphicsObject", 1, 0)); // webkit 1.0 namespace
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestCore::testMetaInfoSimpleType()
|
void TestCore::testMetaInfoSimpleType()
|
||||||
@@ -3619,11 +3600,11 @@ void TestCore::testMetaInfoSimpleType()
|
|||||||
QScopedPointer<Model> model(Model::create("Qt/Item"));
|
QScopedPointer<Model> model(Model::create("Qt/Item"));
|
||||||
QVERIFY(model.data());
|
QVERIFY(model.data());
|
||||||
|
|
||||||
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item"));
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
|
||||||
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
|
QVERIFY(model->metaInfo().hasNodeMetaInfo("Qt/Item", 4, 7));
|
||||||
|
|
||||||
NodeMetaInfo itemMetaInfo = model->metaInfo().nodeMetaInfo("Qt/Item", 4, 7);
|
NodeMetaInfo itemMetaInfo = model->metaInfo().nodeMetaInfo("Qt/Item", 4, 7);
|
||||||
NodeMetaInfo itemMetaInfo2 = model->metaInfo().nodeMetaInfo("Qt/Item");
|
NodeMetaInfo itemMetaInfo2 = model->metaInfo().nodeMetaInfo("Qt/Item", 4, 7);
|
||||||
QCOMPARE(itemMetaInfo, itemMetaInfo2);
|
QCOMPARE(itemMetaInfo, itemMetaInfo2);
|
||||||
|
|
||||||
QVERIFY(itemMetaInfo.isValid());
|
QVERIFY(itemMetaInfo.isValid());
|
||||||
@@ -3635,12 +3616,12 @@ void TestCore::testMetaInfoSimpleType()
|
|||||||
NodeMetaInfo graphicsObjectInfo = itemMetaInfo.directSuperClass();
|
NodeMetaInfo graphicsObjectInfo = itemMetaInfo.directSuperClass();
|
||||||
QVERIFY(graphicsObjectInfo.isValid());
|
QVERIFY(graphicsObjectInfo.isValid());
|
||||||
QCOMPARE(graphicsObjectInfo.typeName(), QLatin1String("QGraphicsObject"));
|
QCOMPARE(graphicsObjectInfo.typeName(), QLatin1String("QGraphicsObject"));
|
||||||
QCOMPARE(graphicsObjectInfo.majorVersion(), 4);
|
QCOMPARE(graphicsObjectInfo.majorVersion(), -1);
|
||||||
QCOMPARE(graphicsObjectInfo.minorVersion(), 7);
|
QCOMPARE(graphicsObjectInfo.minorVersion(), -1);
|
||||||
|
|
||||||
QCOMPARE(itemMetaInfo.superClasses().size(), 2); // QGraphicsObject, Qt/QtObject
|
QCOMPARE(itemMetaInfo.superClasses().size(), 2); // QGraphicsObject, Qt/QtObject
|
||||||
QVERIFY(itemMetaInfo.isSubclassOf("QGraphicsObject", 4, 7));
|
QVERIFY(itemMetaInfo.isSubclassOf("QGraphicsObject", 4, 7));
|
||||||
QVERIFY(itemMetaInfo.isSubclassOf("Qt/QtObject", -1, -1));
|
QVERIFY(itemMetaInfo.isSubclassOf("Qt/QtObject", 4, 7));
|
||||||
|
|
||||||
// availableInVersion
|
// availableInVersion
|
||||||
QVERIFY(itemMetaInfo.availableInVersion(4, 7));
|
QVERIFY(itemMetaInfo.availableInVersion(4, 7));
|
||||||
@@ -3698,8 +3679,8 @@ void TestCore::testMetaInfoExtendedType()
|
|||||||
NodeMetaInfo graphicsObjectTypeInfo = graphicsWidgetTypeInfo.directSuperClass();
|
NodeMetaInfo graphicsObjectTypeInfo = graphicsWidgetTypeInfo.directSuperClass();
|
||||||
QVERIFY(graphicsObjectTypeInfo.isValid());
|
QVERIFY(graphicsObjectTypeInfo.isValid());
|
||||||
QCOMPARE(graphicsObjectTypeInfo.typeName(), QLatin1String("QGraphicsObject"));
|
QCOMPARE(graphicsObjectTypeInfo.typeName(), QLatin1String("QGraphicsObject"));
|
||||||
QCOMPARE(graphicsObjectTypeInfo.majorVersion(), 4);
|
QCOMPARE(graphicsObjectTypeInfo.majorVersion(), -1);
|
||||||
QCOMPARE(graphicsObjectTypeInfo.minorVersion(), 7);
|
QCOMPARE(graphicsObjectTypeInfo.minorVersion(), -1);
|
||||||
QCOMPARE(graphicsWidgetTypeInfo.superClasses().size(), 2);
|
QCOMPARE(graphicsWidgetTypeInfo.superClasses().size(), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3730,8 +3711,8 @@ void TestCore::testMetaInfoCustomType()
|
|||||||
NodeMetaInfo stateOperationInfo = propertyChangesInfo.directSuperClass();
|
NodeMetaInfo stateOperationInfo = propertyChangesInfo.directSuperClass();
|
||||||
QVERIFY(stateOperationInfo.isValid());
|
QVERIFY(stateOperationInfo.isValid());
|
||||||
QCOMPARE(stateOperationInfo.typeName(), QLatin1String("QDeclarativeStateOperation"));
|
QCOMPARE(stateOperationInfo.typeName(), QLatin1String("QDeclarativeStateOperation"));
|
||||||
QCOMPARE(stateOperationInfo.majorVersion(), 4);
|
QCOMPARE(stateOperationInfo.majorVersion(), -1);
|
||||||
QCOMPARE(stateOperationInfo.minorVersion(), 7);
|
QCOMPARE(stateOperationInfo.minorVersion(), -1);
|
||||||
QCOMPARE(propertyChangesInfo.superClasses().size(), 2);
|
QCOMPARE(propertyChangesInfo.superClasses().size(), 2);
|
||||||
|
|
||||||
// DeclarativePropertyChanges just has 3 properties
|
// DeclarativePropertyChanges just has 3 properties
|
||||||
|
|||||||