Merge remote-tracking branch 'origin/2.8' into HEAD

This commit is contained in:
Eike Ziller
2013-07-18 11:54:02 +02:00
54 changed files with 8051 additions and 2843 deletions

View File

@@ -156,7 +156,7 @@
using Qt Quick 2.1. The Qt Quick Components and Controls are based on using Qt Quick 2.1. The Qt Quick Components and Controls are based on
standard QML types. To view the components and controls in the standard QML types. To view the components and controls in the
\gui {Library} pane, add import \gui {Library} pane, add import
statements to the .pro file of your project. For example: statements to the QML file in the \gui Edit mode. For example:
\list \list

View File

@@ -77,19 +77,22 @@ QWidget {
QComboBox { QComboBox {
id: box id: box
property variant backendValue: comboBox.backendValue property variant backendValue: comboBox.backendValue
onCurrentTextChanged: { backendValue.value = currentText; evaluate(); } onCurrentTextChanged: {
onItemsChanged: { print("valuechanged");
if (comboBox.backendValue.value == curentText) print(comboBox.currentText)
return; backendValue.value = comboBox.currentText; evaluate(); }
box.setCurrentTextSilent(comboBox.backendValue.value); onItemsChanged: {
} if (comboBox.backendValue.value === comboBox.curentText)
return;
property variant backendValueValue: comboBox.backendValue.value box.setCurrentTextSilent(comboBox.backendValue.value);
onBackendValueValueChanged: { }
if (comboBox.backendValue.value == curentText)
return; property variant backendValueValue: comboBox.backendValue.value
box.setCurrentTextSilent(comboBox.backendValue.value); onBackendValueValueChanged: {
} if (comboBox.backendValue.value === comboBox.curentText)
return;
box.setCurrentTextSilent(comboBox.backendValue.value);
}
ExtendedFunctionButton { ExtendedFunctionButton {
backendValue: comboBox.backendValue; backendValue: comboBox.backendValue;
y: 3 y: 3

View File

@@ -59,24 +59,24 @@ QWidget {
} }
} }
} //QWidget } //QWidget
// Qt namespace enums not supported by the rewriter
// QWidget {
// layout: HorizontalLayout {
// Label {
// text: qsTr("Layout direction")
// }
// ComboBox { QWidget {
// baseStateFlag: isBaseState layout: HorizontalLayout {
// items : { ["LeftToRight", "RightToLeft"] } Label {
// currentText: backendValues.layoutDirection.value; text: qsTr("Layout direction")
// onItemsChanged: { }
// currentText = backendValues.layoutDirection.value;
// } ComboBox {
// backendValue: backendValues.layoutDirection baseStateFlag: isBaseState
// } items : { ["LeftToRight", "RightToLeft"] }
// } currentText: backendValues.layoutDirection.value;
// } //QWidget onItemsChanged: {
currentText = backendValues.layoutDirection.value;
}
backendValue: backendValues.layoutDirection
}
}
} //QWidget
IntEditor { IntEditor {
backendValue: backendValues.spacing backendValue: backendValues.spacing
caption: qsTr("Spacing") caption: qsTr("Spacing")

View File

@@ -75,24 +75,27 @@ QWidget {
} }
} }
} //QWidget } //QWidget
// Qt namespace enums not supported by the rewriter //Qt namespace enums not supported by the rewriter
// QWidget { QWidget {
// layout: HorizontalLayout { layout: HorizontalLayout {
// Label { Label {
// text: qsTr("Layout direction") text: qsTr("Layout direction")
// } }
// ComboBox { ComboBox {
// baseStateFlag: isBaseState id: alignmentBox
// items : { ["LeftToRight", "RightToLeft"] } baseStateFlag: isBaseState
// currentText: backendValues.layoutDirection.value; items : { ["LeftToRight", "RightToLeft"] }
// onItemsChanged: { currentText: backendValues.layoutDirection.value;
// currentText = backendValues.layoutDirection.value; onItemsChanged: {
// } alignmentBox.currentText = backendValues.layoutDirection.value;
// backendValue: backendValues.layoutDirection print("blab");
// } print(alignmentBox.currentText);
// } }
// } //QWidget backendValue: backendValues.layoutDirection
}
}
} //QWidget
IntEditor { IntEditor {
backendValue: backendValues.spacing backendValue: backendValues.spacing
caption: qsTr("Spacing") caption: qsTr("Spacing")

View File

@@ -42,24 +42,23 @@ QWidget {
finished: finishedNotify; finished: finishedNotify;
caption: qsTr("Row") caption: qsTr("Row")
layout: VerticalLayout { layout: VerticalLayout {
// Qt namespace enums not supported by the rewriter QWidget {
// QWidget { layout: HorizontalLayout {
// layout: HorizontalLayout { Label {
// Label { text: qsTr("Layout direction")
// text: qsTr("Layout direction") }
// }
// ComboBox { ComboBox {
// baseStateFlag: isBaseState baseStateFlag: isBaseState
// items : { ["LeftToRight", "RightToLeft"] } items : { ["LeftToRight", "RightToLeft"] }
// currentText: backendValues.layoutDirection.value; currentText: backendValues.layoutDirection.value;
// onItemsChanged: { onItemsChanged: {
// currentText = backendValues.layoutDirection.value; currentText = backendValues.layoutDirection.value;
// } }
// backendValue: backendValues.layoutDirection backendValue: backendValues.layoutDirection
// } }
// } }
// } //QWidget } //QWidget
IntEditor { IntEditor {
backendValue: backendValues.spacing backendValue: backendValues.spacing
caption: qsTr("Spacing") caption: qsTr("Spacing")

View File

@@ -71,5 +71,5 @@ case $value$:
default: default:
break; break;
}</snippet> }</snippet>
<snippet group="C++" trigger="Q_PROPERTY" id="cpp_q_property">Q_PROPERTY($type$ $name$ READ $name$ WRITE set$name$ NOTIFY $name$Changed);</snippet> <snippet group="C++" trigger="Q_PROPERTY" id="cpp_q_property">Q_PROPERTY($type$ $name$ READ $name$ WRITE set$name$ NOTIFY $name$Changed)</snippet>
</snippets> </snippets>

File diff suppressed because it is too large Load Diff

View File

@@ -37,18 +37,13 @@ Product {
"qmlviewer.xml", "qmlviewer.xml",
"sort.xml", "sort.xml",
] ]
switch (qbs.targetOS) { if (qbs.targetOS.contains("windows"))
case "windows":
list.push("notepad_win.xml"); list.push("notepad_win.xml");
break; else if (qbs.targetOS.contains("osx"))
case "mac":
list.push("vi_mac.xml"); list.push("vi_mac.xml");
break; else
default:
list.push("vi.xml"); list.push("vi.xml");
}
return list; return list;
} }
} }
} }

View File

@@ -9,7 +9,7 @@ Application {
: ["$ORIGIN/../lib/qtcreator"] : ["$ORIGIN/../lib/qtcreator"]
cpp.defines: Defaults.defines(qbs) cpp.defines: Defaults.defines(qbs)
cpp.linkerFlags: { cpp.linkerFlags: {
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw")) if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"] return ["-Wl,-s"]
} }
cpp.includePaths: [ cpp.includePaths: [

View File

@@ -24,7 +24,7 @@ Product {
cmd.ide_version_major = product.ide_version_major; cmd.ide_version_major = product.ide_version_major;
cmd.ide_version_minor = product.ide_version_minor; cmd.ide_version_minor = product.ide_version_minor;
cmd.ide_version_release = product.ide_version_release; cmd.ide_version_release = product.ide_version_release;
cmd.onWindows = (product.moduleProperty("qbs", "targetOS") === "windows"); cmd.onWindows = (product.moduleProperty("qbs", "targetOS").contains("windows"));
cmd.sourceCode = function() { cmd.sourceCode = function() {
var file = new TextFile(input.fileName); var file = new TextFile(input.fileName);
var content = file.readAll(); var content = file.readAll();

View File

@@ -10,7 +10,7 @@ DynamicLibrary {
cpp.defines: Defaults.defines(qbs) cpp.defines: Defaults.defines(qbs)
cpp.linkerFlags: { cpp.linkerFlags: {
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw")) if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"] return ["-Wl,-s"]
} }
cpp.installNamePrefix: "@rpath/PlugIns/" cpp.installNamePrefix: "@rpath/PlugIns/"

View File

@@ -38,6 +38,49 @@
using namespace CPlusPlus; using namespace CPlusPlus;
/*!
\class Overview
\brief The Overview class converts a FullySpecifiedType and/or any qualified
name to its string representation.
The public data members (except the ones starting with \e marked)
determine what exactly and how to print.
You can get the start and end position of a function argument
in the resulting string. Set \c markedArgument to the desired
argument. After processing, \c markedArgumentBegin and
\c markedArgumentEnd will contain the positions.
*/
/*!
\enum Overview::StarBindFlag
The StarBindFlag enum describes how the '*' and '&' in pointers/references
should be bound in the string representation.
This also applies to rvalue references ('&&'), but not to pointers to
functions or arrays, because it seems to be quite uncommon to use spaces in
them. For example:
\code
void (*p)()
void (*p)[]
\endcode
See the examples below. These assume that exactly one
flag is set. That is, it may look different with
flag combinations.
\value BindToIdentifier
e.g. "char *foo", but not "char * foo"
\value BindToTypeName
e.g. "char*", but not "char *"
\value BindToLeftSpecifier
e.g. "char * const* const", but not "char * const * const"
\value BindToRightSpecifier
e.g. "char *const", but not "char * const"
*/
Overview::Overview() Overview::Overview()
: starBindFlags(BindToIdentifier), // default to "Qt Style" : starBindFlags(BindToIdentifier), // default to "Qt Style"
showArgumentNames(false), showArgumentNames(false),

View File

@@ -37,16 +37,6 @@
namespace CPlusPlus { namespace CPlusPlus {
/*!
\class Overview
\brief Converts a FullySpecifiedType and/or any qualified name,
to its string representation.
The public data members (except the ones starting with "marked")
determine what exactly and how to print.
*/
class CPLUSPLUS_EXPORT Overview class CPLUSPLUS_EXPORT Overview
{ {
public: public:
@@ -67,33 +57,7 @@ public:
QString prettyType(const FullySpecifiedType &type, const QString &name) const; QString prettyType(const FullySpecifiedType &type, const QString &name) const;
public: public:
/*!
\enum Overview::StarBindFlag
The StarBindFlags describe how the '*' and '&' in pointers/references
should be bound in the string representation.
This also applies to rvalue references ('&&'), but not to
pointers to functions or arrays like in
void (*p)()
void (*p)[]
since it seems to be quite uncommon to use spaces there.
See the examples below. These assume that exactly one
flag is set. That is, it may look different with
flag combinations.
\value BindToIdentifier
e.g. "char *foo", but not "char * foo"
\value BindToTypeName
e.g. "char*", but not "char *"
\value BindToLeftSpecifier
e.g. "char * const* const", but not "char * const * const"
\value BindToRightSpecifier
e.g. "char *const", but not "char * const"
*/
enum StarBindFlag { enum StarBindFlag {
BindToIdentifier = 0x1, BindToIdentifier = 0x1,
BindToTypeName = 0x2, BindToTypeName = 0x2,
@@ -110,12 +74,6 @@ public:
bool showTemplateParameters: 1; bool showTemplateParameters: 1;
bool includeWhiteSpaceInOperatorName: 1; /// "operator =()" vs "operator=()" bool includeWhiteSpaceInOperatorName: 1; /// "operator =()" vs "operator=()"
/*!
You can get the start and end position of a function argument
in the resulting string. Set "markedArgument" to the desired
argument. After processing, "markedArgumentBegin" and
"markedArgumentEnd" will contain the positions.
*/
unsigned markedArgument; unsigned markedArgument;
int markedArgumentBegin; int markedArgumentBegin;
int markedArgumentEnd; int markedArgumentEnd;

View File

@@ -42,6 +42,14 @@
using namespace CPlusPlus; using namespace CPlusPlus;
/*!
\class TypePrettyPrinter
\brief The TypePrettyPrinter class is a helper class for the Overview class.
This class does the main type conversion work.
Do not use this class directly, use Overview instead.
*/
TypePrettyPrinter::TypePrettyPrinter(const Overview *overview) TypePrettyPrinter::TypePrettyPrinter(const Overview *overview)
: _overview(overview) : _overview(overview)

View File

@@ -40,14 +40,6 @@ namespace CPlusPlus {
class Overview; class Overview;
class FullySpecifiedType; class FullySpecifiedType;
/*!
\class TypePrettyPrinter
\brief Helper class for Overview. Does the main type conversation work.
Don't use this class directly, use Overview instead.
*/
class CPLUSPLUS_EXPORT TypePrettyPrinter: protected TypeVisitor class CPLUSPLUS_EXPORT TypePrettyPrinter: protected TypeVisitor
{ {
public: public:

View File

@@ -32,6 +32,7 @@ DynamicLibrary {
Group { Group {
fileTagsFilter: product.type fileTagsFilter: product.type
qbs.install: true qbs.install: true
qbs.installDir: project.ide_library_path + "/qtcomponents/plugin" qbs.installDir: (qbs.targetOS.contains("windows") ? "lib/qtcreator" : project.ide_library_path)
+ "/qtcomponents/plugin"
} }
} }

View File

@@ -70,9 +70,9 @@ QtcLibrary {
result.push("USE_SYSTEM_BOTAN") result.push("USE_SYSTEM_BOTAN")
} else { } else {
result.push("BOTAN_DLL=") result.push("BOTAN_DLL=")
if (qbs.toolchain === "msvc") if (qbs.toolchain.contains("msvc"))
result.push("BOTAN_BUILD_COMPILER_IS_MSVC", "BOTAN_TARGET_OS_HAS_GMTIME_S") result.push("BOTAN_BUILD_COMPILER_IS_MSVC", "BOTAN_TARGET_OS_HAS_GMTIME_S")
if (qbs.toolchain === "gcc" || qbs.toolchain === "mingw") if (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw"))
result.push("BOTAN_BUILD_COMPILER_IS_GCC") result.push("BOTAN_BUILD_COMPILER_IS_GCC")
if (qbs.targetOS.contains("linux")) if (qbs.targetOS.contains("linux"))
result.push("BOTAN_TARGET_OS_IS_LINUX", "BOTAN_TARGET_OS_HAS_CLOCK_GETTIME", result.push("BOTAN_TARGET_OS_IS_LINUX", "BOTAN_TARGET_OS_HAS_CLOCK_GETTIME",
@@ -105,7 +105,7 @@ QtcLibrary {
// For Botan. // For Botan.
Properties { Properties {
condition: qbs.toolchain === "mingw" condition: qbs.toolchain.contains("mingw")
cpp.cxxFlags: [ cpp.cxxFlags: [
"-fpermissive", "-fpermissive",
"-finline-functions", "-finline-functions",

View File

@@ -10,12 +10,10 @@ Product {
targetName: { targetName: {
// see PluginSpecPrivate::loadLibrary() // see PluginSpecPrivate::loadLibrary()
if (qbs.debugInformation) { if (qbs.debugInformation) {
switch (qbs.targetOS) { if (qbs.targetOS.contains("windows"))
case "windows":
return name + "d"; return name + "d";
case "mac": if (qbs.targetOS.contains("osx"))
return name + "_debug"; return name + "_debug";
}
} }
return name; return name;
} }
@@ -33,7 +31,7 @@ Product {
cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/../..", "@executable_path/.."] cpp.rpaths: qbs.targetOS.contains("osx") ? ["@loader_path/../..", "@executable_path/.."]
: ["$ORIGIN", "$ORIGIN/..", "$ORIGIN/../.."] : ["$ORIGIN", "$ORIGIN/..", "$ORIGIN/../.."]
cpp.linkerFlags: { cpp.linkerFlags: {
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw")) if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"] return ["-Wl,-s"]
} }
cpp.includePaths: [ ".", ".." ] cpp.includePaths: [ ".", ".." ]

View File

@@ -1277,6 +1277,8 @@ Core::IEditor *EditorManager::activateEditor(Core::Internal::EditorView *view, C
ICore::raiseWindow(editor->widget()); ICore::raiseWindow(editor->widget());
} }
} }
} else if (!(flags & DoNotMakeVisible)) {
view->setCurrentEditor(editor);
} }
return editor; return editor;
} }

View File

@@ -52,6 +52,7 @@ public:
virtual void startSession() = 0; virtual void startSession() = 0;
virtual void endSession() = 0; virtual void endSession() = 0;
virtual void resetSession() = 0;
virtual void executeStep() = 0; virtual void executeStep() = 0;
virtual void executeStepOut() = 0; virtual void executeStepOut() = 0;

View File

@@ -656,6 +656,9 @@ void QmlEngine::shutdownInferior()
void QmlEngine::shutdownEngine() void QmlEngine::shutdownEngine()
{ {
if (m_adapter.activeDebuggerClient())
m_adapter.activeDebuggerClient()->resetSession();
if (qmlConsoleManager()) if (qmlConsoleManager())
qmlConsoleManager()->setScriptEvaluator(0); qmlConsoleManager()->setScriptEvaluator(0);
m_noDebugOutputTimer.stop(); m_noDebugOutputTimer.stop();

View File

@@ -949,6 +949,11 @@ void QmlV8DebuggerClient::endSession()
d->disconnect(); d->disconnect();
} }
void QmlV8DebuggerClient::resetSession()
{
clearExceptionSelection();
}
void QmlV8DebuggerClient::executeStep() void QmlV8DebuggerClient::executeStep()
{ {
clearExceptionSelection(); clearExceptionSelection();

View File

@@ -62,6 +62,7 @@ public:
void startSession(); void startSession();
void endSession(); void endSession();
void resetSession();
void executeStep(); void executeStep();
void executeStepOut(); void executeStepOut();

View File

@@ -223,6 +223,10 @@ void QScriptDebuggerClient::startSession()
} }
void QScriptDebuggerClient::endSession() void QScriptDebuggerClient::endSession()
{
}
void QScriptDebuggerClient::resetSession()
{ {
d->sessionStarted = false; d->sessionStarted = false;
} }

View File

@@ -47,6 +47,7 @@ public:
void startSession(); void startSession();
void endSession(); void endSession();
void resetSession();
void executeStep(); void executeStep();
void executeStepOut(); void executeStepOut();

View File

@@ -198,15 +198,17 @@ void BranchDialog::checkout()
m_model->checkoutBranch(idx); m_model->checkoutBranch(idx);
} else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) { } else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) {
QString stashMessage; if (branchCheckoutDialog.makeStashOfCurrentBranch()) {
if (branchCheckoutDialog.makeStashOfCurrentBranch() if (!gitClient->executeSynchronousStash(m_repository,
|| branchCheckoutDialog.moveLocalChangesToNextBranch()) { currentBranch + QLatin1String("-AutoStash"))) {
return;
if (!gitClient->beginStashScope(m_repository, currentBranch + QLatin1String("-AutoStash"), NoPrompt)) }
} else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) {
if (!gitClient->beginStashScope(m_repository, QLatin1String("Checkout"), NoPrompt))
return; return;
stashMessage = gitClient->stashInfo(m_repository).stashMessage();
} else if (branchCheckoutDialog.discardLocalChanges()) { } else if (branchCheckoutDialog.discardLocalChanges()) {
gitClient->synchronousReset(m_repository); if (!gitClient->synchronousReset(m_repository))
return;
} }
m_model->checkoutBranch(idx); m_model->checkoutBranch(idx);
@@ -220,7 +222,7 @@ void BranchDialog::checkout()
} }
} }
if (!stashMessage.isEmpty() && branchCheckoutDialog.moveLocalChangesToNextBranch()) if (branchCheckoutDialog.moveLocalChangesToNextBranch())
gitClient->endStashScope(m_repository); gitClient->endStashScope(m_repository);
else if (branchCheckoutDialog.popStashOfNextBranch()) else if (branchCheckoutDialog.popStashOfNextBranch())
gitClient->synchronousStashRestore(m_repository, stashName, true); gitClient->synchronousStashRestore(m_repository, stashName, true);

View File

@@ -33,6 +33,55 @@
namespace ProjectExplorer { namespace ProjectExplorer {
/*!
\class ProjectExplorer::IDeviceFactory
\brief The IDeviceFactory class implements an interface for classes that
provide services related to a certain type of device.
The factory objects have to be added to the global object pool via
\c ExtensionSystem::PluginManager::addObject().
\sa ExtensionSystem::PluginManager::addObject()
*/
/*!
\fn virtual QString displayNameForId(Core::Id type) const = 0
Returns a short, one-line description of the device type.
*/
/*!
\fn virtual QList<Core::Id> availableCreationIds() const = 0
Lists the device types this factory can create.
*/
/*!
\fn virtual IDevice::Ptr create(Core::Id id) const = 0
Creates a new device with the id \a id. This may or may not open a wizard.
*/
/*!
\fn virtual bool canRestore(const QVariantMap &map) const = 0
Checks whether this factory can restore a device from the serialized state
specified by \a map.
*/
/*!
\fn virtual IDevice::Ptr restore(const QVariantMap &map) const = 0
Loads a device from a serialized state. Only called if \c canRestore()
returns true for \a map.
*/
/*!
Checks whether this factory can create new devices. This function is used
to hide auto-detect-only factories from the listing of possible devices
to create.
*/
bool IDeviceFactory::canCreate() const bool IDeviceFactory::canCreate() const
{ {
return !availableCreationIds().isEmpty(); return !availableCreationIds().isEmpty();

View File

@@ -42,49 +42,23 @@ QT_END_NAMESPACE
namespace ProjectExplorer { namespace ProjectExplorer {
class IDeviceWidget; class IDeviceWidget;
/*!
\class ProjectExplorer::IDeviceFactory
\brief Provides an interface for classes providing services related to certain type of device.
The factory objects have to be added to the global object pool via
\c ExtensionSystem::PluginManager::addObject().
\sa ExtensionSystem::PluginManager::addObject()
*/
class PROJECTEXPLORER_EXPORT IDeviceFactory : public QObject class PROJECTEXPLORER_EXPORT IDeviceFactory : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
/*!
A short, one-line description of what the device type.
*/
virtual QString displayNameForId(Core::Id type) const = 0; virtual QString displayNameForId(Core::Id type) const = 0;
/*!
A list of device types this factory can create.
*/
virtual QList<Core::Id> availableCreationIds() const = 0; virtual QList<Core::Id> availableCreationIds() const = 0;
/*!
Check whether this factory can create new devices. This is used to hide
auto-detect-only factories from the listing of possible devices to create.
*/
virtual bool canCreate() const; virtual bool canCreate() const;
/*!
Create a new device. This may or may not open a wizard.
*/
virtual IDevice::Ptr create(Core::Id id) const = 0; virtual IDevice::Ptr create(Core::Id id) const = 0;
/*!
Check whether this factory can restore a device from the given serialized state.
*/
virtual bool canRestore(const QVariantMap &map) const = 0; virtual bool canRestore(const QVariantMap &map) const = 0;
/*!
Loads a device from a serialized state. Will only ever be called if canRestore()
returns true for the given map.
*/
virtual IDevice::Ptr restore(const QVariantMap &map) const = 0; virtual IDevice::Ptr restore(const QVariantMap &map) const = 0;
static IDeviceFactory *find(Core::Id type); static IDeviceFactory *find(Core::Id type);

View File

@@ -5,36 +5,15 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin { QtcPlugin {
name: "QbsProjectManager" name: "QbsProjectManager"
property var qbs_source_dir: qbs.getenv("QBS_SOURCE_DIR") property var externalQbsDefines: project.useExternalQbs
property var qbs_build_dir: qbs.getenv("QBS_BUILD_DIR") ? ['QBS_BUILD_DIR="' + project.qbs_build_dir +'"'] : []
property var externalQbsIncludes: project.useExternalQbs ? [project.qbs_source_dir + "/src/lib"] : []
condition: qbs_source_dir !== undefined && qbs_build_dir !== undefined property var externalQbsLibraryPaths: project.useExternalQbs ? [project.qbs_build_dir + "/lib"] : []
property var externalQbsRPaths: project.useExternalQbs ? [project.qbs_build_dir + "/lib"] : []
Depends { name: "Qt"; submodules: [ "widgets", "script" ] } property var externalQbsDynamicLibraries: {
Depends { name: "ProjectExplorer" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "TextEditor" }
Depends { name: "QtSupport" }
Depends { name: "QmlJS" }
Depends { name: "QmlJSTools" }
cpp.includePaths: base.concat([
qbs_source_dir + "/src",
qbs_source_dir + "/src/lib",
])
cpp.defines: base.concat([
'QBS_SOURCE_DIR="' + qbs_source_dir + '"',
'QBS_BUILD_DIR="' + qbs_build_dir +'"',
'QML_BUILD_STATIC_LIB'
])
cpp.libraryPaths: base.concat([qbs_build_dir + "/lib"])
cpp.rpaths: base.concat([qbs_build_dir + "/lib"])
cpp.dynamicLibraries: {
var libs = [] var libs = []
if (!project.useExternalQbs)
return libs;
if (qbs.targetOS.contains("windows")) { if (qbs.targetOS.contains("windows")) {
libs.push("shell32") libs.push("shell32")
if (qbs.enableDebugCode) if (qbs.enableDebugCode)
@@ -47,6 +26,29 @@ QtcPlugin {
return libs return libs
} }
condition: project.useExternalQbs || project.qbsSubModuleExists
Depends { name: "Qt"; submodules: [ "widgets", "script" ] }
Depends { name: "ProjectExplorer" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "TextEditor" }
Depends { name: "QtSupport" }
Depends { name: "QmlJS" }
Depends { name: "QmlJSTools" }
Depends {
name: "qbscore"
condition: project.qbsSubModuleExists && !project.useExternalQbs
}
cpp.defines: base.concat([
'QML_BUILD_STATIC_LIB'
]).concat(externalQbsDefines)
cpp.includePaths: base.concat(externalQbsIncludes)
cpp.libraryPaths: base.concat(externalQbsLibraryPaths)
cpp.rpaths: base.concat(externalQbsRPaths)
cpp.dynamicLibraries: base.concat(externalQbsDynamicLibraries)
files: [ files: [
"qbsbuildconfiguration.cpp", "qbsbuildconfiguration.cpp",
"qbsbuildconfiguration.h", "qbsbuildconfiguration.h",

View File

@@ -82,10 +82,18 @@ const char resetZDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Re
const char anchorsFillDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Fill"); const char anchorsFillDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Fill");
const char anchorsResetDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Reset"); const char anchorsResetDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Reset");
const char layoutColumnDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Column"); const char layoutColumnPositionerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Column (Positioner)");
const char layoutRowDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Row"); const char layoutRowPositionerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Row (Positioner)");
const char layoutGridDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Grid"); const char layoutGridPositionerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Grid (Positioner)");
const char layoutFlowDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Flow"); const char layoutFlowPositionerDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in Flow (Positioner)");
const char layoutColumnLayoutDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in ColumnLayout");
const char layoutRowLayoutDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in RowLayout");
const char layoutGridLayoutDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Layout in GridLayout");
const char layoutFillWidthDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Fill Width");
const char layoutFillHeightDisplayName[] = QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Fill Height");
const int priorityFirst = 220; const int priorityFirst = 220;
const int prioritySelectionCategory = 200; const int prioritySelectionCategory = 200;

View File

@@ -30,6 +30,7 @@
#include "designeractionmanager.h" #include "designeractionmanager.h"
#include "modelnodecontextmenu_helper.h" #include "modelnodecontextmenu_helper.h"
#include <nodeproperty.h> #include <nodeproperty.h>
#include <nodemetainfo.h>
namespace QmlDesigner { namespace QmlDesigner {
@@ -246,6 +247,65 @@ public:
} }
}; };
class FillLayoutModelNodeAction : public ModelNodeAction
{
public:
FillLayoutModelNodeAction(const QString &description, const QByteArray &category, int priority,
ModelNodeOperations::SelectionAction action,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
ModelNodeAction(description, category, priority, action, enabled, visibility)
{}
virtual void updateContext()
{
defaultAction()->setSelectionContext(selectionContext());
if (selectionContext().isValid()) {
defaultAction()->setEnabled(isEnabled(selectionContext()));
defaultAction()->setVisible(isVisible(selectionContext()));
defaultAction()->setCheckable(true);
QmlItemNode itemNode = QmlItemNode(selectionContext().currentSingleSelectedNode());
if (itemNode.isValid()) {
bool flag = false;
if (itemNode.modelNode().hasProperty(m_propertyName)
|| itemNode.propertyAffectedByCurrentState(m_propertyName))
flag = itemNode.modelValue(m_propertyName).toBool();
defaultAction()->setChecked(flag);
} else {
defaultAction()->setEnabled(false);
}
}
}
protected:
PropertyName m_propertyName;
};
class FillWidthModelNodeAction : public FillLayoutModelNodeAction
{
public:
FillWidthModelNodeAction(const QString &description, const QByteArray &category, int priority,
ModelNodeOperations::SelectionAction action,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
FillLayoutModelNodeAction(description, category, priority, action, enabled, visibility)
{
m_propertyName = "Layout.fillWidth";
}
};
class FillHeightModelNodeAction : public FillLayoutModelNodeAction
{
public:
FillHeightModelNodeAction(const QString &description, const QByteArray &category, int priority,
ModelNodeOperations::SelectionAction action,
SelectionContextFunction enabled = &SelectionContextFunctors::always,
SelectionContextFunction visibility = &SelectionContextFunctors::always) :
FillLayoutModelNodeAction(description, category, priority, action, enabled, visibility)
{
m_propertyName = "Layout.fillHeight";
}
};
class SelectionModelNodeAction : public MenuDesignerAction class SelectionModelNodeAction : public MenuDesignerAction
{ {
public: public:
@@ -328,9 +388,42 @@ bool selectionHasSameParentAndInBaseState(const SelectionContext &context)
return selectionHasSameParent(context) && inBaseState(context); return selectionHasSameParent(context) && inBaseState(context);
} }
bool isNotInLayout(const SelectionContext &context)
{
if (selectionNotEmpty(context)) {
ModelNode selectedModelNode = context.selectedModelNodes().first();
ModelNode parentModelNode;
if (selectedModelNode.hasParentProperty())
parentModelNode = selectedModelNode.parentProperty().parentModelNode();
if (parentModelNode.isValid() && parentModelNode.metaInfo().isValid())
return !parentModelNode.metaInfo().isLayoutable();
}
return true;
}
bool selectionCanBeLayouted(const SelectionContext &context) bool selectionCanBeLayouted(const SelectionContext &context)
{ {
return selectionHasSameParentAndInBaseState(context) && inBaseState(context); return selectionHasSameParentAndInBaseState(context)
&& inBaseState(context)
&& isNotInLayout(context);
}
bool hasQtQuickLayoutImport(const SelectionContext &context)
{
if (context.qmlModelView() && context.qmlModelView()->model()) {
Import import = Import::createLibraryImport(QLatin1String("QtQuick.Layouts"), QLatin1String("1.0"));
return context.qmlModelView()->model()->hasImport(import, true, true);
}
return false;
}
bool selectionCanBeLayoutedAndasQtQuickLayoutImport(const SelectionContext &context)
{
return selectionCanBeLayouted(context) && hasQtQuickLayoutImport(context);
} }
bool selectionNotEmptyAndHasZProperty(const SelectionContext &context) bool selectionNotEmptyAndHasZProperty(const SelectionContext &context)
@@ -350,6 +443,34 @@ bool selectionNotEmptyAndHasXorYProperty(const SelectionContext &context)
&& selectionHasProperty1or2(context, xProperty, yProperty); && selectionHasProperty1or2(context, xProperty, yProperty);
} }
bool singleSelectionAndInQtQuickLayout(const SelectionContext &context)
{
if (!singleSelection(context))
return false;
ModelNode currentSelectedNode = context.currentSingleSelectedNode();
if (!currentSelectedNode.isValid())
return false;
if (!currentSelectedNode.hasParentProperty())
return false;
ModelNode parentModelNode = currentSelectedNode.parentProperty().parentModelNode();
NodeMetaInfo metaInfo = parentModelNode.metaInfo();
if (!metaInfo.isValid())
return false;
return metaInfo.isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
}
bool layoutOptionVisible(const SelectionContext &context)
{
return multiSelectionAndInBaseState(context)
|| singleSelectionAndInQtQuickLayout(context);
}
void DesignerActionManager::createDefaultDesignerActions() void DesignerActionManager::createDefaultDesignerActions()
{ {
using namespace SelectionContextFunctors; using namespace SelectionContextFunctors;
@@ -387,15 +508,80 @@ void DesignerActionManager::createDefaultDesignerActions()
(anchorsResetDisplayName, anchorsCategory, 180, &anchorsReset, &singleSelectionItemIsAnchored)); (anchorsResetDisplayName, anchorsCategory, 180, &anchorsReset, &singleSelectionItemIsAnchored));
addDesignerAction(new MenuDesignerAction(layoutCategoryDisplayName, layoutCategory, addDesignerAction(new MenuDesignerAction(layoutCategoryDisplayName, layoutCategory,
priorityLayoutCategory, &multiSelectionAndInBaseState)); priorityLayoutCategory, &layoutOptionVisible));
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction
(layoutRowDisplayName, layoutCategory, 200, &layoutRow, &selectionCanBeLayouted)); (layoutRowPositionerDisplayName,
layoutCategory,
200,
&layoutRowPositioner,
&selectionCanBeLayouted,
selectionCanBeLayouted));
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction
(layoutColumnDisplayName, layoutCategory, 180, &layoutColumn, &selectionCanBeLayouted)); (layoutColumnPositionerDisplayName,
layoutCategory,
180,
&layoutColumnPositioner,
&selectionCanBeLayouted,
selectionCanBeLayouted));
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction
(layoutGridDisplayName, layoutCategory, 160, &layoutGrid, &selectionCanBeLayouted)); (layoutGridPositionerDisplayName,
layoutCategory,
160,
&layoutGridPositioner,
&selectionCanBeLayouted,
selectionCanBeLayouted));
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction
(layoutFlowDisplayName, layoutCategory, 140, &layoutFlow, &selectionCanBeLayouted)); (layoutFlowPositionerDisplayName,
layoutCategory,
140,
&layoutFlowPositioner,
&selectionCanBeLayouted,
selectionCanBeLayouted));
addDesignerAction(new SeperatorDesignerAction(layoutCategory, 120));
addDesignerAction(new ModelNodeAction
(layoutRowLayoutDisplayName,
layoutCategory,
100,
&layoutRowLayout,
&selectionCanBeLayoutedAndasQtQuickLayoutImport,
&selectionCanBeLayoutedAndasQtQuickLayoutImport));
addDesignerAction(new ModelNodeAction
(layoutColumnLayoutDisplayName,
layoutCategory,
80,
&layoutColumnLayout,
&selectionCanBeLayoutedAndasQtQuickLayoutImport,
&selectionCanBeLayoutedAndasQtQuickLayoutImport));
addDesignerAction(new ModelNodeAction
(layoutGridLayoutDisplayName,
layoutCategory,
60,
&layoutGridLayout,
&selectionCanBeLayoutedAndasQtQuickLayoutImport,
&selectionCanBeLayoutedAndasQtQuickLayoutImport));
addDesignerAction(new FillWidthModelNodeAction
(layoutFillWidthDisplayName,
layoutCategory,
40,
&setFillWidth,
singleSelectionAndInQtQuickLayout,
singleSelectionAndInQtQuickLayout));
addDesignerAction(new FillHeightModelNodeAction
(layoutFillHeightDisplayName,
layoutCategory,
20,
&setFillHeight,
singleSelectionAndInQtQuickLayout,
singleSelectionAndInQtQuickLayout));
addDesignerAction(new SeperatorDesignerAction(rootCategory, priorityTopLevelSeperator)); addDesignerAction(new SeperatorDesignerAction(rootCategory, priorityTopLevelSeperator));
addDesignerAction(new ModelNodeAction addDesignerAction(new ModelNodeAction

View File

@@ -245,6 +245,31 @@ void setVisible(const SelectionContext &selectionState)
} }
} }
void setFillWidth(const SelectionContext &selectionState)
{
if (!selectionState.qmlModelView()
|| selectionState.selectedModelNodes().isEmpty())
return;
try {
selectionState.selectedModelNodes().first().variantProperty("Layout.fillWidth") = selectionState.toggled();
} catch (RewritingException &e) { //better save then sorry
QMessageBox::warning(0, "Error", e.description());
}
}
void setFillHeight(const SelectionContext &selectionState)
{
if (!selectionState.qmlModelView()
|| selectionState.selectedModelNodes().isEmpty())
return;
try {
selectionState.selectedModelNodes().first().variantProperty("Layout.fillHeight") = selectionState.toggled();
} catch (RewritingException &e) { //better save then sorry
QMessageBox::warning(0, "Error", e.description());
}
}
void resetSize(const SelectionContext &selectionState) void resetSize(const SelectionContext &selectionState)
{ {
@@ -420,7 +445,7 @@ static inline QPoint getUpperLeftPosition(const QList<ModelNode> &modelNodeList)
return p; return p;
} }
void layoutRow(const SelectionContext &selectionState) void layoutRowPositioner(const SelectionContext &selectionState)
{ {
if (!selectionState.qmlModelView()) if (!selectionState.qmlModelView())
return; return;
@@ -465,7 +490,7 @@ void layoutRow(const SelectionContext &selectionState)
} }
} }
void layoutColumn(const SelectionContext &selectionState) void layoutColumnPositioner(const SelectionContext &selectionState)
{ {
if (!selectionState.qmlModelView()) if (!selectionState.qmlModelView())
return; return;
@@ -508,7 +533,7 @@ void layoutColumn(const SelectionContext &selectionState)
} }
} }
void layoutGrid(const SelectionContext &selectionState) void layoutGridPositioner(const SelectionContext &selectionState)
{ {
if (!selectionState.qmlModelView()) if (!selectionState.qmlModelView())
return; return;
@@ -552,7 +577,7 @@ void layoutGrid(const SelectionContext &selectionState)
} }
} }
void layoutFlow(const SelectionContext &selectionState) void layoutFlowPositioner(const SelectionContext &selectionState)
{ {
if (!selectionState.qmlModelView()) if (!selectionState.qmlModelView())
return; return;
@@ -595,6 +620,151 @@ void layoutFlow(const SelectionContext &selectionState)
} }
} }
void layoutRowLayout(const SelectionContext &selectionState)
{
if (!selectionState.qmlModelView()
|| selectionState.selectedModelNodes().isEmpty())
return;
static TypeName rowLayoutType = "QtQuick.Layouts.RowLayout";
if (!selectionState.qmlModelView()->model()->hasNodeMetaInfo(rowLayoutType))
return;
NodeMetaInfo rowMetaInfo = selectionState.qmlModelView()->model()->metaInfo(rowLayoutType);
QList<ModelNode> selectedNodeList = selectionState.selectedModelNodes();
QmlItemNode qmlItemNode = QmlItemNode(selectedNodeList.first());
if (qmlItemNode.isValid() && qmlItemNode.hasInstanceParentItem()) {
ModelNode rowNode;
{
RewriterTransaction transaction(selectionState.qmlModelView());
QmlItemNode parentNode = qmlItemNode.instanceParentItem();
rowNode = selectionState.qmlModelView()->createModelNode(rowLayoutType, rowMetaInfo.majorVersion(), rowMetaInfo.minorVersion());
reparentTo(rowNode, parentNode);
}
{
RewriterTransaction transaction(selectionState.qmlModelView());
QPoint upperLeftPosition = getUpperLeftPosition(selectedNodeList);
rowNode.variantProperty("x") = upperLeftPosition.x();
rowNode.variantProperty("y") = upperLeftPosition.y();
QList<ModelNode> sortedSelectedNodes = selectedNodeList;
qSort(sortedSelectedNodes.begin(), sortedSelectedNodes.end(), compareByX);
foreach (ModelNode selectedNode, sortedSelectedNodes) {
reparentTo(selectedNode, rowNode);
selectedNode.removeProperty("x");
selectedNode.removeProperty("y");
}
}
}
}
void layoutColumnLayout(const SelectionContext &selectionState)
{
if (!selectionState.qmlModelView()
|| selectionState.selectedModelNodes().isEmpty())
return;
static TypeName columnLayoutType = "QtQuick.Layouts.ColumnLayout";
if (!selectionState.qmlModelView()->model()->hasNodeMetaInfo(columnLayoutType))
return;
NodeMetaInfo columnMetaInfo = selectionState.qmlModelView()->model()->metaInfo(columnLayoutType);
QList<ModelNode> selectedNodeList = selectionState.selectedModelNodes();
QmlItemNode qmlItemNode = QmlItemNode(selectedNodeList.first());
if (qmlItemNode.isValid() && qmlItemNode.hasInstanceParentItem()) {
ModelNode columnNode;
{
RewriterTransaction transaction(selectionState.qmlModelView());
QmlItemNode parentNode = qmlItemNode.instanceParentItem();
columnNode = selectionState.qmlModelView()->createModelNode(columnLayoutType, columnMetaInfo.majorVersion(), columnMetaInfo.minorVersion());
reparentTo(columnNode, parentNode);
}
{
RewriterTransaction transaction(selectionState.qmlModelView());
QPoint upperLeftPosition = getUpperLeftPosition(selectedNodeList);
columnNode.variantProperty("x") = upperLeftPosition.x();
columnNode.variantProperty("y") = upperLeftPosition.y();
QList<ModelNode> sortedSelectedNodes = selectedNodeList;
qSort(sortedSelectedNodes.begin(), sortedSelectedNodes.end(), compareByY);
foreach (ModelNode selectedNode, sortedSelectedNodes) {
reparentTo(selectedNode, columnNode);
selectedNode.removeProperty("x");
selectedNode.removeProperty("y");
}
}
}
}
void layoutGridLayout(const SelectionContext &selectionState)
{
if (!selectionState.qmlModelView()
|| selectionState.selectedModelNodes().isEmpty())
return;
static TypeName gridLayoutType = "QtQuick.Layouts.GridLayout";
if (!selectionState.qmlModelView()->model()->hasNodeMetaInfo(gridLayoutType))
return;
NodeMetaInfo gridMetaInfo = selectionState.qmlModelView()->model()->metaInfo(gridLayoutType);
QList<ModelNode> selectedNodeList = selectionState.selectedModelNodes();
QmlItemNode qmlItemNode = QmlItemNode(selectedNodeList.first());
if (qmlItemNode.isValid() && qmlItemNode.hasInstanceParentItem()) {
ModelNode gridNode;
{
RewriterTransaction transaction(selectionState.qmlModelView());
QmlItemNode parentNode = qmlItemNode.instanceParentItem();
gridNode = selectionState.qmlModelView()->createModelNode(gridLayoutType, gridMetaInfo.majorVersion(), gridMetaInfo.minorVersion());
gridNode.variantProperty("columns") = int(sqrt(double(selectedNodeList.count())));
reparentTo(gridNode, parentNode);
}
{
RewriterTransaction transaction(selectionState.qmlModelView());
QPoint upperLeftPosition = getUpperLeftPosition(selectedNodeList);
gridNode.variantProperty("x") = upperLeftPosition.x();
gridNode.variantProperty("y") = upperLeftPosition.y();
QList<ModelNode> sortedSelectedNodes = selectedNodeList;
qSort(sortedSelectedNodes.begin(), sortedSelectedNodes.end(), compareByGrid);
foreach (ModelNode selectedNode, sortedSelectedNodes) {
reparentTo(selectedNode, gridNode);
selectedNode.removeProperty("x");
selectedNode.removeProperty("y");
}
}
}
}
} // namespace Mode } // namespace Mode
} //QmlDesigner } //QmlDesigner

View File

@@ -52,6 +52,8 @@ void paste(const SelectionContext &selectionState);
void undo(const SelectionContext &selectionState); void undo(const SelectionContext &selectionState);
void redo(const SelectionContext &selectionState); void redo(const SelectionContext &selectionState);
void setVisible(const SelectionContext &selectionState); void setVisible(const SelectionContext &selectionState);
void setFillWidth(const SelectionContext &selectionState);
void setFillHeight(const SelectionContext &selectionState);
void resetSize(const SelectionContext &selectionState); void resetSize(const SelectionContext &selectionState);
void resetPosition(const SelectionContext &selectionState); void resetPosition(const SelectionContext &selectionState);
void goIntoComponent(const SelectionContext &selectionState); void goIntoComponent(const SelectionContext &selectionState);
@@ -59,10 +61,14 @@ void setId(const SelectionContext &selectionState);
void resetZ(const SelectionContext &selectionState); void resetZ(const SelectionContext &selectionState);
void anchorsFill(const SelectionContext &selectionState); void anchorsFill(const SelectionContext &selectionState);
void anchorsReset(const SelectionContext &selectionState); void anchorsReset(const SelectionContext &selectionState);
void layoutRow(const SelectionContext &selectionState); void layoutRowPositioner(const SelectionContext &selectionState);
void layoutColumn(const SelectionContext &selectionState); void layoutColumnPositioner(const SelectionContext &selectionState);
void layoutGrid(const SelectionContext &selectionState); void layoutGridPositioner(const SelectionContext &selectionState);
void layoutFlow(const SelectionContext &selectionState); void layoutFlowPositioner(const SelectionContext &selectionState);
void layoutRowLayout(const SelectionContext &selectionState);
void layoutColumnLayout(const SelectionContext &selectionState);
void layoutGridLayout(const SelectionContext &selectionState);
} // namespace ModelNodeOperationso } // namespace ModelNodeOperationso
} //QmlDesigner } //QmlDesigner

View File

@@ -721,6 +721,9 @@ bool NodeMetaInfoPrivate::isPropertyEnum(const PropertyName &propertyName) const
if (!isValid()) if (!isValid())
return false; return false;
if (propertyType(propertyName).contains("Qt::"))
return true;
if (propertyName.contains('.')) { if (propertyName.contains('.')) {
const PropertyNameList parts = propertyName.split('.'); const PropertyNameList parts = propertyName.split('.');
const PropertyName objectName = parts.first(); const PropertyName objectName = parts.first();
@@ -748,6 +751,9 @@ QString NodeMetaInfoPrivate::propertyEnumScope(const PropertyName &propertyName)
if (!isValid()) if (!isValid())
return QString(); return QString();
if (propertyType(propertyName).contains("Qt::"))
return QLatin1String("Qt");
if (propertyName.contains('.')) { if (propertyName.contains('.')) {
const PropertyNameList parts = propertyName.split('.'); const PropertyNameList parts = propertyName.split('.');
const PropertyName objectName = parts.first(); const PropertyName objectName = parts.first();
@@ -1165,7 +1171,8 @@ QStringList NodeMetaInfo::propertyKeysForEnum(const PropertyName &propertyName)
QVariant NodeMetaInfo::propertyCastedValue(const PropertyName &propertyName, const QVariant &value) const QVariant NodeMetaInfo::propertyCastedValue(const PropertyName &propertyName, const QVariant &value) const
{ {
QVariant variant = value; const QVariant variant = value;
QVariant copyVariant = variant;
if (propertyIsEnumType(propertyName)) if (propertyIsEnumType(propertyName))
return variant; return variant;
@@ -1189,8 +1196,8 @@ QVariant NodeMetaInfo::propertyCastedValue(const PropertyName &propertyName, con
} else if (typeName == "alias") { } else if (typeName == "alias") {
// TODO: The QML compiler resolves the alias type. We probably should do the same. // TODO: The QML compiler resolves the alias type. We probably should do the same.
return variant; return variant;
} else if (variant.convert(typeId)) { } else if (copyVariant.convert(typeId)) {
return variant; return copyVariant;
} }
return Internal::PropertyParser::variantFromString(variant.toString()); return Internal::PropertyParser::variantFromString(variant.toString());
@@ -1294,8 +1301,9 @@ void NodeMetaInfo::clearCache()
bool NodeMetaInfo::isLayoutable() const bool NodeMetaInfo::isLayoutable() const
{ {
if (majorVersion() < 2) if (isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1))
return isSubclassOf("<cpp>.QDeclarativeBasePositioner", -1, -1); return true; //QtQuick 1
return isSubclassOf("QtQuick.Positioner", -1, -1) || isSubclassOf("QtQuick.Layouts.Layout", -1, -1); return isSubclassOf("QtQuick.Positioner", -1, -1) || isSubclassOf("QtQuick.Layouts.Layout", -1, -1);
} }

View File

@@ -65,6 +65,13 @@ static inline QStringList supportedVersionsList()
return list; return list;
} }
static inline QStringList globalQtEnums()
{
static QStringList list = QStringList() << QLatin1String("Horizontal") << QLatin1String("Vertical") << QLatin1String("AlignVCenter")
<< QLatin1String("AlignLeft") << QLatin1String("LeftToRight") << QLatin1String("RightToLeft");
return list;
}
static inline bool supportedQtQuickVersion(const QString &version) static inline bool supportedQtQuickVersion(const QString &version)
{ {
static QStringList supportedVersions = supportedVersionsList(); static QStringList supportedVersions = supportedVersionsList();
@@ -553,8 +560,15 @@ public:
return value; return value;
} }
QVariant convertToEnum(Statement *rhs, const QString &propertyPrefix, UiQualifiedId *propertyId) QVariant convertToEnum(Statement *rhs, const QString &propertyPrefix, UiQualifiedId *propertyId, const QString &astValue)
{ {
QStringList astValueList = astValue.split(QLatin1String("."));
if (astValueList.count() == 2 //Check for global Qt enums
&& astValueList.first() == QLatin1String("Qt")
&& globalQtEnums().contains(astValueList.last()))
return QVariant(astValueList.last());
ExpressionStatement *eStmt = cast<ExpressionStatement *>(rhs); ExpressionStatement *eStmt = cast<ExpressionStatement *>(rhs);
if (!eStmt || !eStmt->expression) if (!eStmt || !eStmt->expression)
return QVariant(); return QVariant();
@@ -1084,7 +1098,7 @@ QmlDesigner::PropertyName TextToModelMerger::syncScriptBinding(ModelNode &modelN
} }
} }
const QVariant enumValue = context->convertToEnum(script->statement, prefix, script->qualifiedId); const QVariant enumValue = context->convertToEnum(script->statement, prefix, script->qualifiedId, astValue);
if (enumValue.isValid()) { // It is a qualified enum: if (enumValue.isValid()) { // It is a qualified enum:
AbstractProperty modelProperty = modelNode.property(astPropertyName.toUtf8()); AbstractProperty modelProperty = modelNode.property(astPropertyName.toUtf8());
syncVariantProperty(modelProperty, enumValue, TypeName(), differenceHandler); // TODO: parse type syncVariantProperty(modelProperty, enumValue, TypeName(), differenceHandler); // TODO: parse type

View File

@@ -401,7 +401,7 @@ MetaInfo {
} }
Type { Type {
name: "QtQuick.Column" name: "QtQuick.Row"
icon: ":/qtquickplugin/images/item-icon16.png" icon: ":/qtquickplugin/images/item-icon16.png"
ItemLibraryEntry { ItemLibraryEntry {

View File

@@ -1,4 +1,5 @@
import qbs import qbs
import qbs.File
Project { Project {
name: "Sources" name: "Sources"
@@ -9,4 +10,28 @@ Project {
"plugins/plugins.qbs", "plugins/plugins.qbs",
"tools/tools.qbs" "tools/tools.qbs"
] ]
property bool qbsSubModuleExists: File.exists(qbsProject.qbsBaseDir + "/qbs.qbs")
property path qbs_build_dir: qbs.getenv("QBS_BUILD_DIR")
property path qbs_source_dir: qbs.getenv("QBS_SOURCE_DIR")
property bool useExternalQbs: qbs_build_dir && qbs_source_dir
Project {
name: "qbs"
id: qbsProject
property string qbsBaseDir: path + "/shared/qbs"
condition: qbsSubModuleExists && !useExternalQbs
property bool enableUnitTests: false
property bool installApiHeaders: false
property path libInstallDir: project.ide_library_path
property path libRPaths: qbs.targetOS.contains("osx")
? ["@loader_path/.."] : ["$ORIGIN/.."]
property path resourcesInstallDir: project.ide_data_path + "/qbs"
references: [
qbsBaseDir + "/src/lib/lib.qbs",
qbsBaseDir + "/src/plugins/plugins.qbs",
qbsBaseDir + "/share/share.qbs"
]
}
} }

View File

@@ -6,7 +6,7 @@ Application {
Depends { name: "cpp" } Depends { name: "cpp" }
cpp.defines: Defaults.defines(qbs) cpp.defines: Defaults.defines(qbs)
cpp.linkerFlags: { cpp.linkerFlags: {
if (qbs.buildVariant == "release" && (qbs.toolchain == "gcc" || qbs.toolchain == "mingw")) if (qbs.buildVariant == "release" && (qbs.toolchain.contains("gcc") || qbs.toolchain.contains("mingw")))
return ["-Wl,-s"] return ["-Wl,-s"]
} }

View File

@@ -5,11 +5,13 @@
:*Qt Creator.Events_QDockWidget {name='QmlProfilerEventsViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Events'} :*Qt Creator.Events_QDockWidget {name='QmlProfilerEventsViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Events'}
:*Qt Creator.Events_QTabBar {aboveWidget=':*Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Events_QTabBar {aboveWidget=':*Qt Creator.Events_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Find_Find::Internal::FindToolBar {name='Find__Internal__FindWidget' type='Find::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'} :*Qt Creator.Find_Find::Internal::FindToolBar {name='Find__Internal__FindWidget' type='Find::Internal::FindToolBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Find'}
:*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack {name='FormEditorStack' type='Designer::Internal::FormEditorStack' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Interrupt_Core::Internal::FancyToolButton {text='Interrupt' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Interrupt_Core::Internal::FancyToolButton {text='Interrupt' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.JavaScript_QDockWidget {name='QmlProfilerV8ProfileViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='JavaScript'} :*Qt Creator.JavaScript_QDockWidget {name='QmlProfilerV8ProfileViewDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='JavaScript'}
:*Qt Creator.JavaScript_QTabBar {aboveWidget=':*Qt Creator.JavaScript_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.JavaScript_QTabBar {aboveWidget=':*Qt Creator.JavaScript_QDockWidget' type='QTabBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Run_Core::Internal::FancyToolButton {text='Run' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Run_Core::Internal::FancyToolButton {text='Run' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Start Debugging_Core::Internal::FancyToolButton {text='Start Debugging' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.Start Debugging_Core::Internal::FancyToolButton {text='Start Debugging' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Widget Box_QDockWidget {name='WidgetBoxDockWidget' type='QDockWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Widget Box'}
:*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator.findEdit_Utils::FilterLineEdit {name='findEdit' type='Utils::FilterLineEdit' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator_Core::Internal::FancyToolButton {occurrence='3' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Core::Internal::FancyToolButton {occurrence='3' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :*Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::HelpViewer' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -61,7 +63,14 @@
:File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'} :File has been removed.Save_QPushButton {text='Save' type='QPushButton' unnamed='1' visible='1' window=':File has been removed_QMessageBox'}
:File has been removed_QMessageBox {text?='The file * removed*. Do you want to save it under a different name, or close the editor?' type='QMessageBox' unnamed='1' visible='1'} :File has been removed_QMessageBox {text?='The file * removed*. Do you want to save it under a different name, or close the editor?' type='QMessageBox' unnamed='1' visible='1'}
:Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'} :Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'}
:FormEditorStack.CheckBox_QCheckBox {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='checkBox' text='CheckBox' type='QCheckBox' visible='1'}
:FormEditorStack.PushButton_QPushButton {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='pushButton' text='PushButton' type='QPushButton' visible='1'}
:FormEditorStack.centralWidget_QDesignerWidget {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='centralWidget' type='QDesignerWidget' visible='1'}
:FormEditorStack_qdesigner_internal::FormWindow {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::FormWindow' unnamed='1' visible='1'}
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'} :Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:Go to slot.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Go to slot_QDialog'}
:Go to slot.Select signal_QGroupBox {name='groupBox' title='Select signal' type='QGroupBox' visible='1' window=':Go to slot_QDialog'}
:Go to slot_QDialog {name='SelectSignalDialog' type='QDialog' visible='1' windowTitle='Go to slot'}
:Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Installed Plugins.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'} :Installed Plugins.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'}
@@ -145,9 +154,11 @@
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'} :Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'} :RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'}
:Session Manager_ProjectExplorer::Internal::SessionDialog {name='ProjectExplorer__Internal__SessionDialog' type='ProjectExplorer::Internal::SessionDialog' visible='1' windowTitle='Session Manager'} :Session Manager_ProjectExplorer::Internal::SessionDialog {name='ProjectExplorer__Internal__SessionDialog' type='ProjectExplorer::Internal::SessionDialog' visible='1' windowTitle='Session Manager'}
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'} :Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'} :User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
:Widget Box_qdesigner_internal::WidgetBoxTreeWidget {container=':*Qt Creator.Widget Box_QDockWidget' type='qdesigner_internal::WidgetBoxTreeWidget' unnamed='1' visible='1'}
:WritePermissions_Core::Internal::ReadOnlyFilesDialog {name='Core__Internal__ReadOnlyFilesDialog' type='Core::Internal::ReadOnlyFilesDialog' visible='1' windowTitle='Files Without Write Permissions'} :WritePermissions_Core::Internal::ReadOnlyFilesDialog {name='Core__Internal__ReadOnlyFilesDialog' type='Core::Internal::ReadOnlyFilesDialog' visible='1' windowTitle='Files Without Write Permissions'}
:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'} :addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
:fileNameEdit_QLineEdit {buddy=':Open File.File name:_QLabel' name='fileNameEdit' type='QLineEdit' visible='1'} :fileNameEdit_QLineEdit {buddy=':Open File.File name:_QLabel' name='fileNameEdit' type='QLineEdit' visible='1'}
@@ -156,6 +167,7 @@
:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'} :headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'} :popupFrame_Proposal_QListView {container=':popupFrame_TextEditor::GenericProposalWidget' type='QListView' unnamed='1' visible='1'}
:popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'} :popupFrame_TextEditor::GenericProposalWidget {name='m_popupFrame' type='TextEditor::GenericProposalWidget' visible='1'}
:qdesigner_internal::WidgetBoxCategoryListView {container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' occurrence='3' type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'}
:qmakeCallEdit {container=':Qt Creator.scrollArea_QScrollArea' text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1'} :qmakeCallEdit {container=':Qt Creator.scrollArea_QScrollArea' text?='<b>qmake:</b> qmake*' type='QLabel' unnamed='1' visible='1'}
:qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'} :qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='Core__Internal__GeneralSettings' type='QWidget' visible='1'}
:qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='CppTools__Internal__CompletionSettingsPage' type='QWidget' visible='1'} :qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget {container=':Options.qt_tabwidget_stackedwidget_QStackedWidget' name='CppTools__Internal__CompletionSettingsPage' type='QWidget' visible='1'}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProfiles> <!DOCTYPE QtCreatorProfiles>
<!-- Written by QtCreator 2.7.1, 2013-03-26T13:04:29. --> <!-- Written by QtCreator 2.8.0, 2013-07-12T18:17:23. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>Profile.0</variable> <variable>Profile.0</variable>
@@ -128,9 +128,29 @@
<value type="bool" key="PE.Profile.SDK">false</value> <value type="bool" key="PE.Profile.SDK">false</value>
</valuemap> </valuemap>
</data> </data>
<data>
<variable>Profile.6</variable>
<valuemap type="QVariantMap">
<value type="bool" key="PE.Profile.AutoDetected">false</value>
<valuemap type="QVariantMap" key="PE.Profile.Data">
<value type="QString" key="Android.GdbServer.Information"></value>
<value type="QString" key="Debugger.Information">/usr/bin/gdb</value>
<value type="QString" key="PE.Profile.Device">Desktop Device</value>
<value type="QByteArray" key="PE.Profile.DeviceType">Desktop</value>
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Gcc:{c3f59b87-6997-4bd8-8067-ee04dc536371}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
<value type="int" key="QtSupport.QtInformation">2</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
<value type="QString" key="PE.Profile.Id">{1dcb5509-1670-470d-80a5-8a988f36e4e2}</value>
<value type="QString" key="PE.Profile.Name">Desktop 480 GCC</value>
<value type="bool" key="PE.Profile.SDK">false</value>
</valuemap>
</data>
<data> <data>
<variable>Profile.Count</variable> <variable>Profile.Count</variable>
<value type="int">6</value> <value type="int">7</value>
</data> </data>
<data> <data>
<variable>Profile.Default</variable> <variable>Profile.Default</variable>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProfiles> <!DOCTYPE QtCreatorProfiles>
<!-- Written by QtCreator 2.7.1, 2013-03-22T16:13:19. --> <!-- Written by QtCreator 2.8.1, 2013-07-12T17:36:49. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>Profile.0</variable> <variable>Profile.0</variable>
@@ -131,9 +131,29 @@
<value type="bool" key="PE.Profile.SDK">false</value> <value type="bool" key="PE.Profile.SDK">false</value>
</valuemap> </valuemap>
</data> </data>
<data>
<variable>Profile.6</variable>
<valuemap type="QVariantMap">
<value type="bool" key="PE.Profile.AutoDetected">false</value>
<valuemap type="QVariantMap" key="PE.Profile.Data">
<value type="QString" key="Android.GdbServer.Information"></value>
<value type="QString" key="Debugger.Information">C:/QtSDK/pythongdb/python_2.7based/gdb-i686-pc-mingw32.exe</value>
<value type="QString" key="PE.Profile.Device">Desktop Device</value>
<value type="QByteArray" key="PE.Profile.DeviceType">Desktop</value>
<value type="QString" key="PE.Profile.SysRoot"></value>
<value type="QString" key="PE.Profile.ToolChain">ProjectExplorer.ToolChain.Mingw:{2729dd3e-84f5-42e1-aed1-6a27163346ce}</value>
<value type="QString" key="QtPM4.mkSpecInformation"></value>
<value type="int" key="QtSupport.QtInformation">3</value>
</valuemap>
<value type="QString" key="PE.Profile.Icon">:///DESKTOP///</value>
<value type="QString" key="PE.Profile.Id">{9dc9de67-fdc0-4ba6-877a-1463aacd3b3e}</value>
<value type="QString" key="PE.Profile.Name">Desktop 480 GCC</value>
<value type="bool" key="PE.Profile.SDK">false</value>
</valuemap>
</data>
<data> <data>
<variable>Profile.Count</variable> <variable>Profile.Count</variable>
<value type="int">6</value> <value type="int">7</value>
</data> </data>
<data> <data>
<variable>Profile.Default</variable> <variable>Profile.Default</variable>

View File

@@ -1,19 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorQtVersions> <!DOCTYPE QtCreatorQtVersions>
<!-- Written by QtCreator 2.7.1, 2013-03-22T16:13:19. --> <!-- Written by QtCreator 2.8.1, 2013-07-15T17:43:58. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>QtVersion.0</variable> <variable>QtVersion.0</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">1</value>
<value type="QString" key="Name">Qt 4.8 for Desktop - MSVC2008 (Qt SDK)</value>
<value type="QString" key="QMakePath">C:/QtSDK/Desktop/Qt/4.8.0/msvc2008/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.1</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">2</value> <value type="int" key="Id">2</value>
<value type="QString" key="Name">Qt 4.8 for Desktop - MSVC2010 (Qt SDK)</value> <value type="QString" key="Name">Qt 4.8 for Desktop - MSVC2010 (Qt SDK)</value>
@@ -23,7 +13,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.2</variable> <variable>QtVersion.1</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">3</value> <value type="int" key="Id">3</value>
<value type="QString" key="Name">Qt 4.8 for Desktop - MinGW (Qt SDK)</value> <value type="QString" key="Name">Qt 4.8 for Desktop - MinGW (Qt SDK)</value>
@@ -33,17 +23,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.3</variable> <variable>QtVersion.2</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">7</value>
<value type="QString" key="Name">Qt 4.7.4 for Desktop - MSVC2008 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/desktop/qt/4.7.4/msvc2008/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Desktop</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.4</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">8</value> <value type="int" key="Id">8</value>
<value type="QString" key="Name">Qt 4.7.4 for Desktop - MinGW 4.4 (Qt SDK)</value> <value type="QString" key="Name">Qt 4.7.4 for Desktop - MinGW 4.4 (Qt SDK)</value>
@@ -53,7 +33,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.5</variable> <variable>QtVersion.3</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">9</value> <value type="int" key="Id">9</value>
<value type="QString" key="Name">Simulator Qt for MinGW 4.4 (Qt SDK)</value> <value type="QString" key="Name">Simulator Qt for MinGW 4.4 (Qt SDK)</value>
@@ -63,17 +43,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.6</variable> <variable>QtVersion.4</variable>
<valuemap type="QVariantMap">
<value type="int" key="Id">10</value>
<value type="QString" key="Name">Simulator Qt for Visual Studio 2008 (Qt SDK)</value>
<value type="QString" key="QMakePath">c:/qtsdk/simulator/qt/msvc2008/bin/qmake.exe</value>
<value type="QString" key="QtVersion.Type">Qt4ProjectManager.QtVersion.Simulator</value>
<value type="bool" key="isAutodetected">false</value>
</valuemap>
</data>
<data>
<variable>QtVersion.7</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">15</value> <value type="int" key="Id">15</value>
<value type="QString" key="Name">Harmattan Target (Qt SDK)</value> <value type="QString" key="Name">Harmattan Target (Qt SDK)</value>
@@ -83,7 +53,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.8</variable> <variable>QtVersion.5</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">16</value> <value type="int" key="Id">16</value>
<value type="QString" key="Name">Qt for Fremantle PR1.3 Devices (Qt SDK)</value> <value type="QString" key="Name">Qt for Fremantle PR1.3 Devices (Qt SDK)</value>
@@ -93,7 +63,7 @@
</valuemap> </valuemap>
</data> </data>
<data> <data>
<variable>QtVersion.9</variable> <variable>QtVersion.6</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="int" key="Id">18</value> <value type="int" key="Id">18</value>
<value type="QString" key="Name">Desktop Qt 5.0.1 (msvc2010)</value> <value type="QString" key="Name">Desktop Qt 5.0.1 (msvc2010)</value>

View File

@@ -32,16 +32,17 @@ import operator
# for easier re-usage (because Python hasn't an enum type) # for easier re-usage (because Python hasn't an enum type)
class Targets: class Targets:
DESKTOP_474_GCC = 1 DESKTOP_474_GCC = 1
SIMULATOR = 2 DESKTOP_480_GCC = 2
MAEMO5 = 4 SIMULATOR = 4
HARMATTAN = 8 MAEMO5 = 8
EMBEDDED_LINUX = 16 HARMATTAN = 16
DESKTOP_480_MSVC2010 = 32 EMBEDDED_LINUX = 32
DESKTOP_501_DEFAULT = 64 DESKTOP_480_MSVC2010 = 64
DESKTOP_501_DEFAULT = 128
@staticmethod @staticmethod
def desktopTargetClasses(): def desktopTargetClasses():
desktopTargets = Targets.DESKTOP_474_GCC | Targets.DESKTOP_501_DEFAULT desktopTargets = Targets.DESKTOP_474_GCC | Targets.DESKTOP_480_GCC | Targets.DESKTOP_501_DEFAULT
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
desktopTargets |= Targets.DESKTOP_480_MSVC2010 desktopTargets |= Targets.DESKTOP_480_MSVC2010
return desktopTargets return desktopTargets
@@ -50,6 +51,8 @@ class Targets:
def getStringForTarget(target): def getStringForTarget(target):
if target == Targets.DESKTOP_474_GCC: if target == Targets.DESKTOP_474_GCC:
return "Desktop 474 GCC" return "Desktop 474 GCC"
if target == Targets.DESKTOP_480_GCC:
return "Desktop 480 GCC"
elif target == Targets.MAEMO5: elif target == Targets.MAEMO5:
return "Fremantle" return "Fremantle"
elif target == Targets.SIMULATOR: elif target == Targets.SIMULATOR:
@@ -77,8 +80,8 @@ class Targets:
@staticmethod @staticmethod
def intToArray(targets): def intToArray(targets):
available = [Targets.DESKTOP_474_GCC, Targets.SIMULATOR, Targets.MAEMO5, Targets.HARMATTAN, available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.SIMULATOR, Targets.MAEMO5,
Targets.EMBEDDED_LINUX, Targets.DESKTOP_480_MSVC2010, Targets.HARMATTAN, Targets.EMBEDDED_LINUX, Targets.DESKTOP_480_MSVC2010,
Targets.DESKTOP_501_DEFAULT] Targets.DESKTOP_501_DEFAULT]
return filter(lambda x: x & targets == x, available) return filter(lambda x: x & targets == x, available)

View File

@@ -290,8 +290,8 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
available = availableTargets available = availableTargets
else: else:
# following targets depend on the build environment - added for further/later tests # following targets depend on the build environment - added for further/later tests
available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_501_DEFAULT, Targets.MAEMO5, available = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT,
Targets.EMBEDDED_LINUX, Targets.SIMULATOR, Targets.HARMATTAN] Targets.MAEMO5, Targets.EMBEDDED_LINUX, Targets.SIMULATOR, Targets.HARMATTAN]
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
available.remove(Targets.EMBEDDED_LINUX) available.remove(Targets.EMBEDDED_LINUX)
available.append(Targets.DESKTOP_480_MSVC2010) available.append(Targets.DESKTOP_480_MSVC2010)
@@ -481,6 +481,7 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
result = [] result = []
if 'Desktop' in supports: if 'Desktop' in supports:
result.append(Targets.DESKTOP_474_GCC) result.append(Targets.DESKTOP_474_GCC)
result.append(Targets.DESKTOP_480_GCC)
result.append(Targets.DESKTOP_501_DEFAULT) result.append(Targets.DESKTOP_501_DEFAULT)
if platform.system() in ("Linux", "Darwin"): if platform.system() in ("Linux", "Darwin"):
result.append(Targets.EMBEDDED_LINUX) result.append(Targets.EMBEDDED_LINUX)
@@ -494,8 +495,8 @@ def __getSupportedPlatforms__(text, getAsStrings=False):
result.append(Targets.SIMULATOR) result.append(Targets.SIMULATOR)
elif 'Platform independent' in text: elif 'Platform independent' in text:
# MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not # MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not
result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_501_DEFAULT, Targets.MAEMO5, result = [Targets.DESKTOP_474_GCC, Targets.DESKTOP_480_GCC, Targets.DESKTOP_501_DEFAULT,
Targets.SIMULATOR, Targets.HARMATTAN] Targets.MAEMO5, Targets.SIMULATOR, Targets.HARMATTAN]
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010) result.append(Targets.DESKTOP_480_MSVC2010)
else: else:

View File

@@ -23,3 +23,9 @@
"4.2" "4.8" "linux-g++" "~/QtSDK/src/creator-test-data/Squish4.2_32" "4.2" "4.8" "linux-g++" "~/QtSDK/src/creator-test-data/Squish4.2_32"
"4.2" "4.8" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish4.2_64" "4.2" "4.8" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish4.2_64"
"4.2" "4.8" "macx-g++" "~/QtSDK/src/creator-test-data/Squish4.2_Mac" "4.2" "4.8" "macx-g++" "~/QtSDK/src/creator-test-data/Squish4.2_Mac"
"5.0" "4.7" "macx-g++" "~/QtSDK/src/creator-test-data/Squish5_47_Mac"
"5.0" "4.7" "linux-g++" "~/QtSDK/src/creator-test-data/Squish5_47_Linux32"
"5.0" "4.7" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish5_47_Linux64"
"5.0" "4.8" "macx-g++" "~/QtSDK/src/creator-test-data/Squish5_48_Mac"
"5.0" "4.8" "linux-g++" "~/QtSDK/src/creator-test-data/Squish5_48_Linux32"
"5.0" "4.8" "linux-g++-64" "~/QtSDK/src/creator-test-data/Squish5_48_Linux64"
1 squishversion qtversion mkspec path
23 4.2 4.8 linux-g++ ~/QtSDK/src/creator-test-data/Squish4.2_32
24 4.2 4.8 linux-g++-64 ~/QtSDK/src/creator-test-data/Squish4.2_64
25 4.2 4.8 macx-g++ ~/QtSDK/src/creator-test-data/Squish4.2_Mac
26 5.0 4.7 macx-g++ ~/QtSDK/src/creator-test-data/Squish5_47_Mac
27 5.0 4.7 linux-g++ ~/QtSDK/src/creator-test-data/Squish5_47_Linux32
28 5.0 4.7 linux-g++-64 ~/QtSDK/src/creator-test-data/Squish5_47_Linux64
29 5.0 4.8 macx-g++ ~/QtSDK/src/creator-test-data/Squish5_48_Mac
30 5.0 4.8 linux-g++ ~/QtSDK/src/creator-test-data/Squish5_48_Linux32
31 5.0 4.8 linux-g++-64 ~/QtSDK/src/creator-test-data/Squish5_48_Linux64

View File

@@ -41,10 +41,12 @@ def main():
type(editor, '<Up>') type(editor, '<Up>')
type(editor, '<Return>') type(editor, '<Return>')
typeLines(editor, ['Timer {', typeLines(editor, ['Timer {',
'property int runCount: 0',
'interval: 2000', 'interval: 2000',
'repeat: true', 'repeat: true',
'running: true', 'running: runCount < 2',
'onTriggered: {', 'onTriggered: {',
'runCount += 1;',
'var i;', 'var i;',
'for (i = 1; i < 2500; ++i) {', 'for (i = 1; i < 2500; ++i) {',
'var j = i * i;', 'var j = i * i;',
@@ -55,6 +57,9 @@ def main():
test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.") test.fatal("Haven't found a suitable Qt version (need Qt 4.7.4) - leaving without debugging.")
for kit, config in availableConfigs: for kit, config in availableConfigs:
qtVersion = selectBuildConfig(len(checkedTargets), kit, config)[0] qtVersion = selectBuildConfig(len(checkedTargets), kit, config)[0]
if qtVersion == "4.7.4":
test.xverify(False, "Skipping Qt 4.7.4 to avoid QTCREATORBUG-9185")
continue
test.log("Selected kit using Qt %s" % qtVersion) test.log("Selected kit using Qt %s" % qtVersion)
progressBarWait() # progress bars move buttons progressBarWait() # progress bars move buttons
verifyBuildConfig(len(checkedTargets), kit, True, enableQmlDebug=True) verifyBuildConfig(len(checkedTargets), kit, True, enableQmlDebug=True)
@@ -90,6 +95,7 @@ def main():
"Internal::QmlProfilerEventsMainView").model() "Internal::QmlProfilerEventsMainView").model()
if qtVersion.startswith("5."): if qtVersion.startswith("5."):
compareEventsTab(model, "events_qt50.tsv") compareEventsTab(model, "events_qt50.tsv")
numberOfMsRows = 4
else: else:
if qtVersion.startswith("4.8"): if qtVersion.startswith("4.8"):
compareEventsTab(model, "events_qt48.tsv") compareEventsTab(model, "events_qt48.tsv")
@@ -97,9 +103,10 @@ def main():
compareEventsTab(model, "events_qt47.tsv") compareEventsTab(model, "events_qt47.tsv")
test.verify(str(model.index(0, 8).data()).endswith(' ms')) test.verify(str(model.index(0, 8).data()).endswith(' ms'))
test.xverify(str(model.index(1, 8).data()).endswith(' ms')) # QTCREATORBUG-8996 test.xverify(str(model.index(1, 8).data()).endswith(' ms')) # QTCREATORBUG-8996
numberOfMsRows = 2
test.compare(dumpItems(model, column=2)[0], '100.00 %') test.compare(dumpItems(model, column=2)[0], '100.00 %')
for i in [3, 5, 6, 7]: for i in [3, 5, 6, 7]:
for item in dumpItems(model, column=i)[:4]: for item in dumpItems(model, column=i)[:numberOfMsRows]:
test.verify(item.endswith(' ms')) test.verify(item.endswith(' ms'))
deleteAppFromWinFW(workingDir, projectName, False) deleteAppFromWinFW(workingDir, projectName, False)
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")

View File

@@ -1,3 +1,4 @@
"0" "1" "4" "9" "0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program" "<program>" "Binding" "1" "Main Program"
"main.qml:14" "Signal" "2" "triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" "main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:14" "Binding" "2" "running: runCount < 2"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:14 main.qml:15 Signal 2 triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } } triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
4 main.qml:14 Binding 2 running: runCount < 2

View File

@@ -1,7 +1,8 @@
"0" "1" "4" "9" "0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program" "<program>" "Binding" "1" "Main Program"
"main.qml:14" "Signal" "2" "triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" "main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Create" "1" "main.qml" "main.qml:1" "Create" "1" "main.qml"
"main.qml:1" "Compile" "1" "main.qml" "main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")" "main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")"
"<bytecode>" "Binding" "2" "Source code not available." "<bytecode>" "Binding" "2" "Source code not available."
"main.qml:14" "Binding" "3" "running: runCount < 2"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:14 main.qml:15 Signal 2 triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } } triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
4 main.qml:1 Create 1 main.qml
5 main.qml:1 Compile 1 main.qml
6 main.qml:7 Binding 1 text: qsTr("Hello World")
7 <bytecode> Binding 2 Source code not available.
8 main.qml:14 Binding 3 running: runCount < 2

View File

@@ -1,7 +1,8 @@
"0" "1" "4" "9" "0" "1" "4" "9"
"<program>" "Binding" "1" "Main Program" "<program>" "Binding" "1" "Main Program"
"main.qml:1" "Create" "1" "main.qml" "main.qml:1" "Create" "1" "main.qml"
"main.qml:14" "Signal" "2" "triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" "main.qml:15" "Signal" "2" "triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }"
"main.qml:1" "Compile" "1" "main.qml" "main.qml:1" "Compile" "1" "main.qml"
"main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")" "main.qml:7" "Binding" "1" "text: qsTr(""Hello World"")"
"<bytecode>" "Binding" "2" "Source code not available." "<bytecode>" "Binding" "2" "Source code not available."
"main.qml:14" "Binding" "3" "running: runCount < 2"
1 0 1 4 9
2 <program> Binding 1 Main Program
3 main.qml:1 Create 1 main.qml
4 main.qml:14 main.qml:15 Signal 2 triggered(): { var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } } triggered(): { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }
5 main.qml:1 Compile 1 main.qml
6 main.qml:7 Binding 1 text: qsTr("Hello World")
7 <bytecode> Binding 2 Source code not available.
8 main.qml:14 Binding 3 running: runCount < 2

View File

@@ -46,7 +46,7 @@ def main():
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
suitableKits = Targets.DESKTOP_474_GCC suitableKits = Targets.DESKTOP_474_GCC | Targets.DESKTOP_480_GCC
if platform.system() in ('Windows', 'Microsoft'): if platform.system() in ('Windows', 'Microsoft'):
suitableKits |= Targets.DESKTOP_480_MSVC2010 suitableKits |= Targets.DESKTOP_480_MSVC2010
checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits) checkedTargets = openQmakeProject(SpeedCrunchPath, suitableKits)

View File

@@ -0,0 +1 @@
QT_PLATFORM_PLUGIN=nonesuch

View File

@@ -0,0 +1,12 @@
AUT=qtcreator
CLASS=
CLASSPATH=
CWD=
ENVVARS=envvars
HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_designer_goto_slot
VERSION=2
WRAPPERS=Qt

View File

@@ -0,0 +1,60 @@
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(tempDir(), "DesignerTestApp")
selectFromLocator("mainwindow.ui")
widgetIndex = "{container=':qdesigner_internal::WidgetBoxCategoryListView' text='%s' type='QModelIndex'}"
widgets = {"Push Button": 50,
"Check Box": 100}
for current in widgets.keys():
dragAndDrop(waitForObject(widgetIndex % current), 5, 5,
":FormEditorStack_qdesigner_internal::FormWindow", 20, widgets[current], Qt.CopyAction)
connections = []
for record in testData.dataset("connections.tsv"):
connections.append([testData.field(record, col) for col in ["widget", "signal", "slot"]])
for con in connections:
selectFromLocator("mainwindow.ui")
openContextMenu(waitForObject(con[0]), 5, 5, 0)
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
waitForObjectItem(":Select signal.signalList_QTreeWidget", con[1])
clickItem(":Select signal.signalList_QTreeWidget", con[1], 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject(":Go to slot.OK_QPushButton"))
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
type(editor, "<Up>")
type(editor, "<Up>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[2]', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[2]))
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")

View File

@@ -0,0 +1,4 @@
"widget" "signal" "slot"
":FormEditorStack.PushButton_QPushButton" "clicked()" "void MainWindow::on_pushButton_clicked()"
":FormEditorStack.CheckBox_QCheckBox" "toggled(bool)" "void MainWindow::on_checkBox_toggled(bool checked)"
":FormEditorStack.centralWidget_QDesignerWidget" "destroyed()" "void MainWindow::on_MainWindow_destroyed()"
1 widget signal slot
2 :FormEditorStack.PushButton_QPushButton clicked() void MainWindow::on_pushButton_clicked()
3 :FormEditorStack.CheckBox_QCheckBox toggled(bool) void MainWindow::on_checkBox_toggled(bool checked)
4 :FormEditorStack.centralWidget_QDesignerWidget destroyed() void MainWindow::on_MainWindow_destroyed()