forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.7'
Conflicts: src/plugins/pythoneditor/tools/lexical/pythonformattoken.h Change-Id: I7b921cd975aa755166a80d219ed5e8b69888aeb0
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
\l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels}
|
||||
{What is API Level?}.
|
||||
|
||||
The minimum API level is android-4 for Necessitas and android-9 for Qt 5.
|
||||
\QC does not allow you to select an API level that the Qt version specified
|
||||
for the kit does not support.
|
||||
|
||||
\note The android-4 API level does not support multitouch. If your
|
||||
application needs multitouch, select a higher API level.
|
||||
|
||||
|
@@ -242,6 +242,25 @@
|
||||
|
||||
\endtable
|
||||
|
||||
\section1 Mapping Source Paths
|
||||
|
||||
To enable the debugger to step into the code and display the source code
|
||||
when using a copy of the source tree at a location different from the one
|
||||
at which the libraries where built, map the source paths to target paths:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \gui Tools > \gui Options > \gui Debugger > \gui General >
|
||||
\gui Add.
|
||||
|
||||
\li In the \gui {Source path} field, specify the source path in the
|
||||
debug information of the executable as reported by the debugger.
|
||||
|
||||
\li In the \gui {Target path} field, specify the actual location of the
|
||||
source tree on the local machine.
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Setting the Symbol Server in Windows
|
||||
|
||||
To obtain debugging information for the operating system libraries for
|
||||
|
@@ -79,8 +79,23 @@
|
||||
|
||||
\section2 File Encoding
|
||||
|
||||
To define the default file encoding, select the desired encoding in
|
||||
\gui {Default encoding}. By default, \QC uses the file encoding
|
||||
used by your system.
|
||||
To define the default file encoding, select a suitable option in
|
||||
\gui {Default encoding}.
|
||||
|
||||
Qt 5 requires UTF-8 encoded source files, and therefore the default
|
||||
encoding was changed from \gui System to \gui UTF-8 in \QC version 2.6.
|
||||
Detecting the correct encoding is tricky, so \QC will not try to do so.
|
||||
Instead, it displays the following error message when you try to edit a file
|
||||
that is not UTF-8 encoded: \gui {Error: Could not decode "filename" with
|
||||
"UTF-8"-encoding. Editing not possible.}
|
||||
|
||||
To resolve the issue, use a file conversion tool such as
|
||||
\l{http://recode.progiciels-bpi.ca/index.html}{Recode} to convert the file
|
||||
encoding to UTF-8 when developing Qt 5 applications. Otherwise, conversion
|
||||
of string constants to QStrings might not work as expected.
|
||||
|
||||
If you develop only Qt 4 applications or other than Qt applications, you
|
||||
can set other encoding options as the default encoding. Select the
|
||||
\gui System option to use the file encoding used by your system.
|
||||
|
||||
*/
|
||||
|
@@ -48,11 +48,16 @@
|
||||
press \key {Alt+Left}.
|
||||
|
||||
\li To check that the application code can be compiled and linked for a
|
||||
device, click the \gui {Kit Selector} and select a kit for the
|
||||
device, click the \gui {Kit Selector} and select a
|
||||
\l{glossary-buildandrun-kit}{kit} for the
|
||||
device.
|
||||
|
||||
\image qtcreator-gs-build-example-kit-selector.png "Selecting a kit to build with"
|
||||
|
||||
If you installed \QC as part of a Qt installation, it should have
|
||||
automatically detected the installed kit. If no kits are available,
|
||||
see \l{Adding Kits}.
|
||||
|
||||
\li Click
|
||||
\inlineimage qtcreator-run.png
|
||||
(\gui Run) to build and run the application.
|
||||
@@ -60,6 +65,10 @@
|
||||
\li To see the compilation progress, press \key{Alt+4} to open the
|
||||
\gui {Compile Output} pane.
|
||||
|
||||
If build errors occur, check that a \l{Adding Qt Versions}
|
||||
{Qt version} and \l{Adding Compilers}{compiler} are installed and
|
||||
configured and that the necessary kits are configured.
|
||||
|
||||
The \gui Build progress bar on the toolbar turns green when the
|
||||
project is successfully built. The application opens on the device.
|
||||
|
||||
|
@@ -162,7 +162,6 @@ Project {
|
||||
Depends { name: "Qt"; submodules: ["widgets", "network"] }
|
||||
Depends { name: "Utils" }
|
||||
Depends { name: "ExtensionSystem" }
|
||||
Depends { name: "Core" }
|
||||
|
||||
files: [
|
||||
"src/app/main.cpp",
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -49,28 +49,27 @@ AnchorChangesNodeInstance::Pointer AnchorChangesNodeInstance::create(QObject *ob
|
||||
return instance;
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::setPropertyVariant(const QString &/*name*/, const QVariant &/*value*/)
|
||||
void AnchorChangesNodeInstance::setPropertyVariant(const PropertyName &/*name*/, const QVariant &/*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::setPropertyBinding(const QString &/*name*/, const QString &/*expression*/)
|
||||
void AnchorChangesNodeInstance::setPropertyBinding(const PropertyName &/*name*/, const QString &/*expression*/)
|
||||
{
|
||||
}
|
||||
|
||||
QVariant AnchorChangesNodeInstance::property(const QString &/*name*/) const
|
||||
QVariant AnchorChangesNodeInstance::property(const PropertyName &/*name*/) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::resetProperty(const QString &/*name*/)
|
||||
void AnchorChangesNodeInstance::resetProperty(const PropertyName &/*name*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void AnchorChangesNodeInstance::reparent(const ServerNodeInstance &/*oldParentInstance*/,
|
||||
const QString &/*oldParentProperty*/,
|
||||
const ServerNodeInstance &/*newParentInstance*/,
|
||||
const QString &/*newParentProperty*/)
|
||||
void AnchorChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &/*oldParentInstance*/,
|
||||
const PropertyName &/*oldParentProperty*/,
|
||||
const ObjectNodeInstance::Pointer &/*newParentInstance*/,
|
||||
const PropertyName &/*newParentProperty*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -52,16 +52,15 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
virtual void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const QString &name, const QString &expression);
|
||||
virtual QVariant property(const QString &name) const;
|
||||
virtual void resetProperty(const QString &name);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
|
||||
|
||||
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
|
||||
void reparent(const ServerNodeInstance &oldParentInstance,
|
||||
const QString &oldParentProperty,
|
||||
const ServerNodeInstance &newParentInstance,
|
||||
const QString &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance,
|
||||
const PropertyName &oldParentProperty,
|
||||
const ObjectNodeInstance::Pointer &newParentInstance,
|
||||
const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
AnchorChangesNodeInstance(QObject *object);
|
||||
|
@@ -45,12 +45,12 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
|
||||
|
||||
QVariant property(const PropertyName &name) const;
|
||||
void resetProperty(const PropertyName &name);
|
||||
QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
bool m_isEnabled;
|
||||
|
@@ -47,9 +47,9 @@ public:
|
||||
ComponentNodeInstance(QQmlComponent *component);
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
bool hasContent() const;
|
||||
bool hasContent() const Q_DECL_OVERRIDE;
|
||||
|
||||
void setNodeSource(const QString &source);
|
||||
void setNodeSource(const QString &source) Q_DECL_OVERRIDE;
|
||||
|
||||
private: //function
|
||||
QQmlComponent *component() const;
|
||||
|
@@ -42,10 +42,6 @@ DummyNodeInstance::Pointer DummyNodeInstance::create()
|
||||
return Pointer(new DummyNodeInstance);
|
||||
}
|
||||
|
||||
void DummyNodeInstance::paint(QPainter * /*painter*/)
|
||||
{
|
||||
}
|
||||
|
||||
QRectF DummyNodeInstance::boundingRect() const
|
||||
{
|
||||
return QRectF();
|
||||
@@ -71,11 +67,11 @@ double DummyNodeInstance::opacity() const
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void DummyNodeInstance::setPropertyVariant(const QString &/*name*/, const QVariant &/*value*/)
|
||||
void DummyNodeInstance::setPropertyVariant(const PropertyName &/*name*/, const QVariant &/*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void DummyNodeInstance::setPropertyBinding(const QString &/*name*/, const QString &/*expression*/)
|
||||
void DummyNodeInstance::setPropertyBinding(const PropertyName &/*name*/, const QString &/*expression*/)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -85,21 +81,11 @@ void DummyNodeInstance::setId(const QString &/*id*/)
|
||||
|
||||
}
|
||||
|
||||
QVariant DummyNodeInstance::property(const QString &/*name*/) const
|
||||
QVariant DummyNodeInstance::property(const PropertyName &/*name*/) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QStringList DummyNodeInstance::properties()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList DummyNodeInstance::localProperties()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/)
|
||||
{
|
||||
|
||||
|
@@ -45,20 +45,16 @@ public:
|
||||
|
||||
static Pointer create();
|
||||
|
||||
void paint(QPainter *painter);
|
||||
QRectF boundingRect() const Q_DECL_OVERRIDE;
|
||||
QPointF position() const Q_DECL_OVERRIDE;
|
||||
QSizeF size() const Q_DECL_OVERRIDE;
|
||||
QTransform transform() const Q_DECL_OVERRIDE;
|
||||
double opacity() const Q_DECL_OVERRIDE;
|
||||
|
||||
QRectF boundingRect() const;
|
||||
QPointF position() const;
|
||||
QSizeF size() const;
|
||||
QTransform transform() const;
|
||||
double opacity() const;
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setId(const QString &id);
|
||||
QVariant property(const QString &name) const;
|
||||
QStringList properties();
|
||||
QStringList localProperties();
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
void setId(const QString &id) Q_DECL_OVERRIDE;
|
||||
QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
|
||||
void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance);
|
||||
|
||||
|
@@ -431,6 +431,10 @@ QVariant ObjectNodeInstance::fixResourcePaths(const QVariant &value)
|
||||
return value;
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::updateDirtyNodeRecursive()
|
||||
{
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
|
||||
{
|
||||
QQmlProperty property(object(), name, context());
|
||||
@@ -1097,11 +1101,12 @@ void ObjectNodeInstance::setResetValue(const PropertyName &propertyName, const Q
|
||||
m_resetValueHash.insert(propertyName, value);
|
||||
}
|
||||
|
||||
void ObjectNodeInstance::paint(QPainter * /*painter*/)
|
||||
QImage ObjectNodeInstance::renderImage() const
|
||||
{
|
||||
return QImage();
|
||||
}
|
||||
|
||||
QImage ObjectNodeInstance::renderImage() const
|
||||
QImage ObjectNodeInstance::renderPreviewImage(const QSize & /*previewImageSize*/) const
|
||||
{
|
||||
return QImage();
|
||||
}
|
||||
|
@@ -82,8 +82,8 @@ public:
|
||||
void setNodeInstanceServer(NodeInstanceServer *server);
|
||||
virtual void initializePropertyWatcher(const Pointer &objectNodeInstance);
|
||||
virtual void initialize(const Pointer &objectNodeInstance);
|
||||
virtual void paint(QPainter *painter);
|
||||
virtual QImage renderImage() const;
|
||||
virtual QImage renderPreviewImage(const QSize &previewImageSize) const;
|
||||
|
||||
virtual QObject *parent() const;
|
||||
|
||||
@@ -178,6 +178,8 @@ public:
|
||||
|
||||
static QVariant fixResourcePaths(const QVariant &value);
|
||||
|
||||
virtual void updateDirtyNodeRecursive();
|
||||
|
||||
protected:
|
||||
void doResetProperty(const PropertyName &propertyName);
|
||||
void removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty);
|
||||
|
@@ -47,14 +47,14 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
|
||||
bool isPositioner() const;
|
||||
bool isPositioner() const Q_DECL_OVERRIDE;
|
||||
|
||||
bool isResizable() const;
|
||||
bool isResizable() const Q_DECL_OVERRIDE;
|
||||
|
||||
void refreshPositioner();
|
||||
void refreshPositioner() Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
PositionerNodeInstance(QQuickBasePositioner *item);
|
||||
|
@@ -99,11 +99,11 @@ void QmlPropertyChangesNodeInstance::resetProperty(const PropertyName &name)
|
||||
}
|
||||
|
||||
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty)
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
changesObject()->detachFromState();
|
||||
|
||||
ObjectNodeInstance::reparent(oldParentInstance.internalInstance(), oldParentProperty, newParentInstance.internalInstance(), newParentProperty);
|
||||
ObjectNodeInstance::reparent(oldParentInstance, oldParentProperty, newParentInstance, newParentProperty);
|
||||
|
||||
changesObject()->attachToState();
|
||||
}
|
||||
|
@@ -54,13 +54,12 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
virtual QVariant property(const PropertyName &name) const;
|
||||
virtual void resetProperty(const PropertyName &name);
|
||||
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
virtual void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
virtual QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
virtual void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
|
||||
|
||||
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
QmlPropertyChangesNodeInstance(QQuickPropertyChanges *object);
|
||||
|
@@ -48,15 +48,15 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
|
||||
void activateState();
|
||||
void deactivateState();
|
||||
void activateState() Q_DECL_OVERRIDE;
|
||||
void deactivateState() Q_DECL_OVERRIDE;
|
||||
|
||||
bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value);
|
||||
bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QString &expression);
|
||||
bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &resetValue);
|
||||
bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
bool updateStateBinding(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QString &expression) Q_DECL_OVERRIDE;
|
||||
bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &resetValue) Q_DECL_OVERRIDE;
|
||||
|
||||
|
||||
protected:
|
||||
|
@@ -47,9 +47,9 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
|
||||
bool isTransition() const;
|
||||
bool isTransition() const Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
QQuickTransition *qmlTransition() const;
|
||||
|
@@ -41,15 +41,15 @@ class Qt5InformationNodeInstanceServer : public Qt5NodeInstanceServer
|
||||
public:
|
||||
explicit Qt5InformationNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
||||
|
||||
void reparentInstances(const ReparentInstancesCommand &command);
|
||||
void clearScene(const ClearSceneCommand &command);
|
||||
void createScene(const CreateSceneCommand &command);
|
||||
void completeComponent(const CompleteComponentCommand &command);
|
||||
void token(const TokenCommand &command);
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command);
|
||||
void reparentInstances(const ReparentInstancesCommand &command) Q_DECL_OVERRIDE;
|
||||
void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void completeComponent(const CompleteComponentCommand &command) Q_DECL_OVERRIDE;
|
||||
void token(const TokenCommand &command) Q_DECL_OVERRIDE;
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
void collectItemChangesAndSendChangeCommands();
|
||||
void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
|
||||
void sendChildrenChangedCommand(const QList<ServerNodeInstance> childList);
|
||||
void sendTokenBack();
|
||||
|
||||
|
@@ -48,21 +48,21 @@ public:
|
||||
Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
||||
~Qt5NodeInstanceServer();
|
||||
|
||||
QQuickView *quickView() const;
|
||||
QQmlView *declarativeView() const;
|
||||
QQmlEngine *engine() const;
|
||||
void refreshBindings();
|
||||
QQuickView *quickView() const Q_DECL_OVERRIDE;
|
||||
QQmlView *declarativeView() const Q_DECL_OVERRIDE;
|
||||
QQmlEngine *engine() const Q_DECL_OVERRIDE;
|
||||
void refreshBindings() Q_DECL_OVERRIDE;
|
||||
|
||||
DesignerSupport *designerSupport() const;
|
||||
|
||||
void createScene(const CreateSceneCommand &command);
|
||||
void clearScene(const ClearSceneCommand &command);
|
||||
void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
void initializeView(const QVector<AddImportContainer> &importVector);
|
||||
void resizeCanvasSizeToRootItemSize();
|
||||
void initializeView(const QVector<AddImportContainer> &importVector) Q_DECL_OVERRIDE;
|
||||
void resizeCanvasSizeToRootItemSize() Q_DECL_OVERRIDE;
|
||||
void resetAllItems();
|
||||
QList<ServerNodeInstance> setupScene(const CreateSceneCommand &command);
|
||||
QList<ServerNodeInstance> setupScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
QList<QQuickItem*> allItems() const;
|
||||
|
||||
private:
|
||||
|
@@ -65,7 +65,7 @@ void Qt5PreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
{
|
||||
static bool inFunction = false;
|
||||
|
||||
if (rootNodeInstance().internalSGItem() == 0)
|
||||
if (!rootNodeInstance().holdsQuickItem())
|
||||
return;
|
||||
|
||||
if (!inFunction && nodeInstanceClient()->bytesToWrite() < 10000) {
|
||||
@@ -106,17 +106,14 @@ static void updateDirtyNodeRecursive(QQuickItem *parentItem)
|
||||
|
||||
QImage Qt5PreviewNodeInstanceServer::renderPreviewImage()
|
||||
{
|
||||
updateDirtyNodeRecursive(rootNodeInstance().internalSGItem());
|
||||
rootNodeInstance().updateDirtyNodeRecursive();
|
||||
|
||||
QRectF boundingRect = rootNodeInstance().boundingRect();
|
||||
|
||||
QSize previewImageSize = boundingRect.size().toSize();
|
||||
previewImageSize.scale(QSize(100, 100), Qt::KeepAspectRatio);
|
||||
|
||||
QImage previewImage;
|
||||
|
||||
if (boundingRect.isValid() && rootNodeInstance().internalSGItem())
|
||||
previewImage = designerSupport()->renderImageForItem(rootNodeInstance().internalSGItem(), boundingRect, previewImageSize);
|
||||
QImage previewImage = rootNodeInstance().renderPreviewImage(previewImageSize);
|
||||
|
||||
previewImage = previewImage.convertToFormat(QImage::Format_ARGB32_Premultiplied);
|
||||
|
||||
|
@@ -40,15 +40,15 @@ class Qt5PreviewNodeInstanceServer : public Qt5NodeInstanceServer
|
||||
public:
|
||||
explicit Qt5PreviewNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
||||
|
||||
void createScene(const CreateSceneCommand &command);
|
||||
void changeState(const ChangeStateCommand &command);
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command);
|
||||
void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void changeState(const ChangeStateCommand &command) Q_DECL_OVERRIDE;
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
|
||||
|
||||
QImage renderPreviewImage();
|
||||
|
||||
protected:
|
||||
void collectItemChangesAndSendChangeCommands();
|
||||
void startRenderTimer();
|
||||
void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
|
||||
void startRenderTimer() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
ServerNodeInstance m_actualState;
|
||||
|
@@ -40,13 +40,13 @@ class Qt5RenderNodeInstanceServer : public Qt5NodeInstanceServer
|
||||
public:
|
||||
explicit Qt5RenderNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
|
||||
|
||||
void createScene(const CreateSceneCommand &command);
|
||||
void clearScene(const ClearSceneCommand &command);
|
||||
void completeComponent(const CompleteComponentCommand &command);
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command);
|
||||
void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
|
||||
void completeComponent(const CompleteComponentCommand &command) Q_DECL_OVERRIDE;
|
||||
void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
void collectItemChangesAndSendChangeCommands();
|
||||
void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
|
||||
ServerNodeInstance findNodeInstanceForItem(QQuickItem *item) const;
|
||||
|
||||
private:
|
||||
|
@@ -218,6 +218,14 @@ void QuickItemNodeInstance::updateDirtyNodeRecursive(QQuickItem *parentItem) con
|
||||
DesignerSupport::updateDirtyNode(parentItem);
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::updateAllDirtyNodeRecursive(QQuickItem *parentItem) const
|
||||
{
|
||||
foreach (QQuickItem *childItem, parentItem->childItems())
|
||||
updateDirtyNodeRecursive(childItem);
|
||||
|
||||
DesignerSupport::updateDirtyNode(parentItem);
|
||||
}
|
||||
|
||||
QImage QuickItemNodeInstance::renderImage() const
|
||||
{
|
||||
updateDirtyNodeRecursive(quickItem());
|
||||
@@ -231,6 +239,16 @@ QImage QuickItemNodeInstance::renderImage() const
|
||||
return renderImage;
|
||||
}
|
||||
|
||||
QImage QuickItemNodeInstance::renderPreviewImage(const QSize &previewImageSize) const
|
||||
{
|
||||
QRectF previewItemBoundingRect = boundingRect();
|
||||
|
||||
if (previewItemBoundingRect.isValid() && quickItem())
|
||||
return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
|
||||
|
||||
return QImage();
|
||||
}
|
||||
|
||||
bool QuickItemNodeInstance::isMovable() const
|
||||
{
|
||||
if (isRootNodeInstance())
|
||||
@@ -661,6 +679,11 @@ void QuickItemNodeInstance::createEffectItem(bool createEffectItem)
|
||||
s_createEffectItem = createEffectItem;
|
||||
}
|
||||
|
||||
void QuickItemNodeInstance::updateDirtyNodeRecursive()
|
||||
{
|
||||
updateAllDirtyNodeRecursive(quickItem());
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace QmlDesigner
|
||||
|
||||
|
@@ -49,65 +49,68 @@ public:
|
||||
~QuickItemNodeInstance();
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance);
|
||||
void initialize(const ObjectNodeInstance::Pointer &objectNodeInstance) Q_DECL_OVERRIDE;
|
||||
|
||||
bool isQuickItem() const;
|
||||
bool isQuickItem() const Q_DECL_OVERRIDE;
|
||||
|
||||
QRectF boundingRect() const;
|
||||
QPointF position() const;
|
||||
QSizeF size() const;
|
||||
QTransform transform() const;
|
||||
QTransform customTransform() const;
|
||||
QTransform sceneTransform() const;
|
||||
double opacity() const;
|
||||
QRectF boundingRect() const Q_DECL_OVERRIDE;
|
||||
QPointF position() const Q_DECL_OVERRIDE;
|
||||
QSizeF size() const Q_DECL_OVERRIDE;
|
||||
QTransform transform() const Q_DECL_OVERRIDE;
|
||||
QTransform customTransform() const Q_DECL_OVERRIDE;
|
||||
QTransform sceneTransform() const Q_DECL_OVERRIDE;
|
||||
double opacity() const Q_DECL_OVERRIDE;
|
||||
|
||||
QObject *parent() const;
|
||||
QObject *parent() const Q_DECL_OVERRIDE;
|
||||
|
||||
double rotation() const;
|
||||
double scale() const;
|
||||
QPointF transformOriginPoint() const;
|
||||
double zValue() const;
|
||||
double rotation() const Q_DECL_OVERRIDE;
|
||||
double scale() const Q_DECL_OVERRIDE;
|
||||
QPointF transformOriginPoint() const Q_DECL_OVERRIDE;
|
||||
double zValue() const Q_DECL_OVERRIDE;
|
||||
|
||||
bool equalQuickItem(QQuickItem *item) const;
|
||||
|
||||
bool hasContent() const;
|
||||
bool hasContent() const Q_DECL_OVERRIDE;
|
||||
|
||||
QList<ServerNodeInstance> childItems() const;
|
||||
QList<ServerNodeInstance> childItems() const Q_DECL_OVERRIDE;
|
||||
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
|
||||
|
||||
bool isMovable() const;
|
||||
bool isMovable() const Q_DECL_OVERRIDE;
|
||||
void setMovable(bool movable);
|
||||
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
|
||||
|
||||
QVariant property(const PropertyName &name) const;
|
||||
void resetProperty(const PropertyName &name);
|
||||
QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
|
||||
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
|
||||
|
||||
int penWidth() const;
|
||||
int penWidth() const Q_DECL_OVERRIDE;
|
||||
|
||||
bool hasAnchor(const PropertyName &name) const;
|
||||
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const;
|
||||
bool isAnchoredBySibling() const;
|
||||
bool isAnchoredByChildren() const;
|
||||
void doComponentComplete();
|
||||
bool hasAnchor(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const Q_DECL_OVERRIDE;
|
||||
bool isAnchoredBySibling() const Q_DECL_OVERRIDE;
|
||||
bool isAnchoredByChildren() const Q_DECL_OVERRIDE;
|
||||
void doComponentComplete() Q_DECL_OVERRIDE;
|
||||
|
||||
bool isResizable() const;
|
||||
bool isResizable() const Q_DECL_OVERRIDE;
|
||||
void setResizable(bool resizeable);
|
||||
|
||||
void setHasContent(bool hasContent);
|
||||
|
||||
QList<ServerNodeInstance> stateInstances() const;
|
||||
QList<ServerNodeInstance> stateInstances() const Q_DECL_OVERRIDE;
|
||||
|
||||
QImage renderImage() const;
|
||||
QImage renderImage() const Q_DECL_OVERRIDE;
|
||||
QImage renderPreviewImage(const QSize &previewImageSize) const Q_DECL_OVERRIDE;
|
||||
|
||||
DesignerSupport *designerSupport() const;
|
||||
Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
|
||||
|
||||
static void createEffectItem(bool createEffectItem);
|
||||
|
||||
void updateDirtyNodeRecursive() Q_DECL_OVERRIDE;
|
||||
|
||||
protected:
|
||||
QuickItemNodeInstance(QQuickItem*);
|
||||
QQuickItem *quickItem() const;
|
||||
@@ -116,6 +119,7 @@ protected:
|
||||
void refresh();
|
||||
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
|
||||
void updateDirtyNodeRecursive(QQuickItem *parentItem) const;
|
||||
void updateAllDirtyNodeRecursive(QQuickItem *parentItem) const;
|
||||
static bool anyItemHasContent(QQuickItem *graphicsItem);
|
||||
static bool childItemsHaveContent(QQuickItem *graphicsItem);
|
||||
|
||||
|
@@ -108,20 +108,16 @@ ServerNodeInstance &ServerNodeInstance::operator=(const ServerNodeInstance &othe
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Paints the NodeInstance with this painter.
|
||||
\param painter used QPainter
|
||||
*/
|
||||
void ServerNodeInstance::paint(QPainter *painter)
|
||||
{
|
||||
m_nodeInstance->paint(painter);
|
||||
}
|
||||
|
||||
QImage ServerNodeInstance::renderImage() const
|
||||
{
|
||||
return m_nodeInstance->renderImage();
|
||||
}
|
||||
|
||||
QImage ServerNodeInstance::renderPreviewImage(const QSize &previewImageSize) const
|
||||
{
|
||||
return m_nodeInstance->renderPreviewImage(previewImageSize);
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::isRootNodeInstance() const
|
||||
{
|
||||
return isValid() && m_nodeInstance->isRootNodeInstance();
|
||||
@@ -153,6 +149,16 @@ void ServerNodeInstance::setNodeSource(const QString &source)
|
||||
m_nodeInstance->setNodeSource(source);
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::holdsQuickItem() const
|
||||
{
|
||||
return m_nodeInstance->isQuickItem();
|
||||
}
|
||||
|
||||
void ServerNodeInstance::updateDirtyNodeRecursive()
|
||||
{
|
||||
m_nodeInstance->updateDirtyNodeRecursive();
|
||||
}
|
||||
|
||||
bool ServerNodeInstance::isSubclassOf(const QString &superTypeName) const
|
||||
{
|
||||
return isSubclassOf(internalObject(), superTypeName.toUtf8());
|
||||
@@ -552,13 +558,6 @@ QObject *ServerNodeInstance::internalObject() const
|
||||
return m_nodeInstance->object();
|
||||
}
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
QQuickItem *ServerNodeInstance::internalSGItem() const
|
||||
{
|
||||
return qobject_cast<QQuickItem*>(internalObject());
|
||||
}
|
||||
#endif
|
||||
|
||||
void ServerNodeInstance::activateState()
|
||||
{
|
||||
m_nodeInstance->activateState();
|
||||
|
@@ -96,8 +96,8 @@ public:
|
||||
ServerNodeInstance(const ServerNodeInstance &other);
|
||||
ServerNodeInstance& operator=(const ServerNodeInstance &other);
|
||||
|
||||
void paint(QPainter *painter);
|
||||
QImage renderImage() const;
|
||||
QImage renderPreviewImage(const QSize &previewImageSize) const;
|
||||
|
||||
ServerNodeInstance parent() const;
|
||||
bool hasParent() const;
|
||||
@@ -196,11 +196,11 @@ private: // functions
|
||||
|
||||
void setNodeSource(const QString &source);
|
||||
|
||||
bool holdsQuickItem() const;
|
||||
|
||||
void updateDirtyNodeRecursive();
|
||||
|
||||
QObject *internalObject() const; // should be not used outside of the nodeinstances!!!!
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
QQuickItem *internalSGItem() const;
|
||||
#endif
|
||||
|
||||
private: // variables
|
||||
QSharedPointer<Internal::ObjectNodeInstance> m_nodeInstance;
|
||||
|
@@ -6,6 +6,10 @@ QT += core gui widgets qml quick network v8
|
||||
|
||||
QT += core-private qml-private quick-private gui-private script-private v8-private
|
||||
|
||||
!macx {
|
||||
CONFIG += c++11
|
||||
}
|
||||
|
||||
DEFINES += QWEAKPOINTER_ENABLE_ARROW
|
||||
|
||||
include (../instances/instances.pri)
|
||||
|
@@ -49,28 +49,28 @@ AnchorChangesNodeInstance::Pointer AnchorChangesNodeInstance::create(QObject *ob
|
||||
return instance;
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::setPropertyVariant(const QString &/*name*/, const QVariant &/*value*/)
|
||||
void AnchorChangesNodeInstance::setPropertyVariant(const PropertyName &/*name*/, const QVariant &/*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::setPropertyBinding(const QString &/*name*/, const QString &/*expression*/)
|
||||
void AnchorChangesNodeInstance::setPropertyBinding(const PropertyName &/*name*/, const QString &/*expression*/)
|
||||
{
|
||||
}
|
||||
|
||||
QVariant AnchorChangesNodeInstance::property(const QString &/*name*/) const
|
||||
QVariant AnchorChangesNodeInstance::property(const PropertyName &/*name*/) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void AnchorChangesNodeInstance::resetProperty(const QString &/*name*/)
|
||||
void AnchorChangesNodeInstance::resetProperty(const PropertyName &/*name*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void AnchorChangesNodeInstance::reparent(const ServerNodeInstance &/*oldParentInstance*/,
|
||||
const QString &/*oldParentProperty*/,
|
||||
const ServerNodeInstance &/*newParentInstance*/,
|
||||
const QString &/*newParentProperty*/)
|
||||
void AnchorChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &/*oldParentInstance*/,
|
||||
const PropertyName &/*oldParentProperty*/,
|
||||
const ObjectNodeInstance::Pointer &/*newParentInstance*/,
|
||||
const PropertyName &/*newParentProperty*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -53,16 +53,15 @@ public:
|
||||
|
||||
static Pointer create(QObject *objectToBeWrapped);
|
||||
|
||||
virtual void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const QString &name, const QString &expression);
|
||||
virtual QVariant property(const QString &name) const;
|
||||
virtual void resetProperty(const QString &name);
|
||||
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
virtual void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
virtual QVariant property(const PropertyName &name) const;
|
||||
virtual void resetProperty(const PropertyName &name);
|
||||
|
||||
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
|
||||
void reparent(const ServerNodeInstance &oldParentInstance,
|
||||
const QString &oldParentProperty,
|
||||
const ServerNodeInstance &newParentInstance,
|
||||
const QString &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance,
|
||||
const PropertyName &oldParentProperty,
|
||||
const ObjectNodeInstance::Pointer &newParentInstance,
|
||||
const PropertyName &newParentProperty);
|
||||
|
||||
protected:
|
||||
AnchorChangesNodeInstance(QObject *object);
|
||||
|
@@ -70,38 +70,25 @@ double DummyNodeInstance::opacity() const
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void DummyNodeInstance::setPropertyVariant(const QString &/*name*/, const QVariant &/*value*/)
|
||||
void DummyNodeInstance::setPropertyVariant(const PropertyName &/*name*/, const QVariant &/*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void DummyNodeInstance::setPropertyBinding(const QString &/*name*/, const QString &/*expression*/)
|
||||
void DummyNodeInstance::setPropertyBinding(const PropertyName &/*name*/, const QString &/*expression*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DummyNodeInstance::setId(const QString &/*id*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QVariant DummyNodeInstance::property(const QString &/*name*/) const
|
||||
QVariant DummyNodeInstance::property(const PropertyName &/*name*/) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QStringList DummyNodeInstance::properties()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
QStringList DummyNodeInstance::localProperties()
|
||||
{
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -53,12 +53,11 @@ public:
|
||||
QTransform transform() const;
|
||||
double opacity() const;
|
||||
|
||||
void setPropertyVariant(const QString &name, const QVariant &value);
|
||||
void setPropertyBinding(const QString &name, const QString &expression);
|
||||
void setPropertyVariant(const PropertyName &name, const QVariant &value);
|
||||
void setPropertyBinding(const PropertyName &name, const QString &expression);
|
||||
void setId(const QString &id);
|
||||
QVariant property(const QString &name) const;
|
||||
QStringList properties();
|
||||
QStringList localProperties();
|
||||
QVariant property(const PropertyName &name) const;
|
||||
|
||||
|
||||
void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance);
|
||||
|
||||
|
@@ -99,11 +99,11 @@ void QmlPropertyChangesNodeInstance::resetProperty(const PropertyName &name)
|
||||
}
|
||||
|
||||
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty)
|
||||
void QmlPropertyChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty)
|
||||
{
|
||||
changesObject()->detachFromState();
|
||||
|
||||
ObjectNodeInstance::reparent(oldParentInstance.internalInstance(), oldParentProperty, newParentInstance.internalInstance(), newParentProperty);
|
||||
ObjectNodeInstance::reparent(oldParentInstance, oldParentProperty, newParentInstance, newParentProperty);
|
||||
|
||||
changesObject()->attachToState();
|
||||
}
|
||||
|
@@ -60,8 +60,7 @@ public:
|
||||
virtual QVariant property(const PropertyName &name) const;
|
||||
virtual void resetProperty(const PropertyName &name);
|
||||
|
||||
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around
|
||||
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
|
||||
void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty);
|
||||
|
||||
protected:
|
||||
QmlPropertyChangesNodeInstance(QDeclarativePropertyChanges *object);
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "androidpackagecreationstep.h"
|
||||
#include "androidtoolchain.h"
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/target.h>
|
||||
@@ -235,17 +236,22 @@ bool AndroidManager::ensureIconAttribute(ProjectExplorer::Target *target)
|
||||
|
||||
QString AndroidManager::targetSDK(ProjectExplorer::Target *target)
|
||||
{
|
||||
QString fallback = QLatin1String("android-8");
|
||||
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||
fallback = QLatin1String("android-9");
|
||||
|
||||
if (!createAndroidTemplatesIfNecessary(target))
|
||||
return AndroidConfigurations::instance().bestMatch(QLatin1String("android-8"));
|
||||
return AndroidConfigurations::instance().bestMatch(fallback);
|
||||
QFile file(defaultPropertiesPath(target).toString());
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
return AndroidConfigurations::instance().bestMatch(QLatin1String("android-8"));
|
||||
return AndroidConfigurations::instance().bestMatch(fallback);
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
if (line.startsWith("target="))
|
||||
return QString::fromLatin1(line.trimmed().mid(7));
|
||||
}
|
||||
return AndroidConfigurations::instance().bestMatch(QLatin1String("android-8"));
|
||||
return AndroidConfigurations::instance().bestMatch(fallback);
|
||||
}
|
||||
|
||||
bool AndroidManager::setTargetSDK(ProjectExplorer::Target *target, const QString &sdk)
|
||||
@@ -534,12 +540,18 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
|
||||
if (!androidFiles.isEmpty())
|
||||
qt4Project->rootProjectNode()->addFiles(ProjectExplorer::UnknownFileType, androidFiles);
|
||||
|
||||
QStringList sdks = AndroidConfigurations::instance().sdkTargets();
|
||||
int minApiLevel = 4;
|
||||
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||
minApiLevel = 9;
|
||||
|
||||
QStringList sdks = AndroidConfigurations::instance().sdkTargets(minApiLevel);
|
||||
if (sdks.isEmpty()) {
|
||||
raiseError(tr("No Qt for Android SDKs were found.\nPlease install at least one SDK."));
|
||||
return false;
|
||||
}
|
||||
updateTarget(target, AndroidConfigurations::instance().sdkTargets().at(0));
|
||||
|
||||
updateTarget(target, AndroidConfigurations::instance().sdkTargets(minApiLevel).at(0));
|
||||
QStringList apps = availableTargetApplications(target);
|
||||
if (!apps.isEmpty())
|
||||
setTargetApplication(target, apps.at(0));
|
||||
@@ -899,6 +911,7 @@ bool AndroidManager::openManifest(ProjectExplorer::Target *target, QDomDocument
|
||||
|
||||
bool AndroidManager::saveManifest(ProjectExplorer::Target *target, QDomDocument &doc)
|
||||
{
|
||||
Core::FileChangeBlocker blocker(manifestPath(target).toString());
|
||||
return saveXmlFile(target, doc, manifestPath(target));
|
||||
}
|
||||
|
||||
|
@@ -49,6 +49,8 @@
|
||||
#include <QFileDialog>
|
||||
#include <QFileSystemWatcher>
|
||||
#include <QMessageBox>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
@@ -277,7 +279,13 @@ void AndroidPackageCreationWidget::updateAndroidProjectInfo()
|
||||
ProjectExplorer::Target *target = m_step->target();
|
||||
const QString packageName = AndroidManager::packageName(target);
|
||||
m_ui->targetSDKComboBox->clear();
|
||||
QStringList targets = AndroidConfigurations::instance().sdkTargets();
|
||||
|
||||
int minApiLevel = 4;
|
||||
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||
minApiLevel = 9;
|
||||
|
||||
QStringList targets = AndroidConfigurations::instance().sdkTargets(minApiLevel);
|
||||
m_ui->targetSDKComboBox->addItems(targets);
|
||||
m_ui->targetSDKComboBox->setCurrentIndex(targets.indexOf(AndroidManager::targetSDK(target)));
|
||||
m_ui->packageNameLineEdit->setText(packageName);
|
||||
|
@@ -432,7 +432,10 @@ void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
|
||||
|
||||
void BookmarkManager::updateBookmark(Bookmark *bookmark)
|
||||
{
|
||||
int idx = m_bookmarksList.indexOf(bookmark);
|
||||
const int idx = m_bookmarksList.indexOf(bookmark);
|
||||
if (idx == -1)
|
||||
return;
|
||||
|
||||
emit dataChanged(index(idx, 0, QModelIndex()), index(idx, 2, QModelIndex()));
|
||||
saveBookmarks();
|
||||
}
|
||||
|
@@ -2283,7 +2283,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
m_attachToRemoteServerAction->setEnabled(true);
|
||||
m_attachToRunningApplication->setEnabled(true);
|
||||
|
||||
m_threadBox->setEnabled(state == InferiorStopOk);
|
||||
m_threadBox->setEnabled(state == InferiorStopOk || state == InferiorUnrunnable);
|
||||
|
||||
const bool isCore = engine->startParameters().startMode == AttachCore;
|
||||
const bool stopped = state == InferiorStopOk;
|
||||
|
@@ -167,7 +167,7 @@ IFindSupport::Result TreeViewFind::find(const QString &searchTxt,
|
||||
Qt::CaseInsensitive));
|
||||
if (searchExpr.indexIn(text) != -1
|
||||
&& d->m_view->model()->flags(index) & Qt::ItemIsSelectable
|
||||
&& currentRow != index.row())
|
||||
&& (index.row() != currentRow || index.parent() != currentIndex.parent()))
|
||||
resultIndex = index;
|
||||
} else {
|
||||
QTextDocument doc(text);
|
||||
@@ -175,7 +175,7 @@ IFindSupport::Result TreeViewFind::find(const QString &searchTxt,
|
||||
flags & (Find::FindCaseSensitively |
|
||||
Find::FindWholeWords)).isNull()
|
||||
&& d->m_view->model()->flags(index) & Qt::ItemIsSelectable
|
||||
&& currentRow != index.row())
|
||||
&& (index.row() != currentRow || index.parent() != currentIndex.parent()))
|
||||
resultIndex = index;
|
||||
}
|
||||
}
|
||||
@@ -203,33 +203,35 @@ QModelIndex TreeViewFind::nextIndex(const QModelIndex &idx, bool *wrapped) const
|
||||
if (!idx.isValid())
|
||||
return model->index(0, 0);
|
||||
|
||||
// same parent has more columns, go to next column
|
||||
if (idx.column() + 1 < model->columnCount(idx.parent()))
|
||||
return model->index(idx.row(), idx.column() + 1, idx.parent());
|
||||
|
||||
if (model->rowCount(idx) > 0) {
|
||||
// node with children
|
||||
return idx.child(0, 0);
|
||||
// tree views have their children attached to first column
|
||||
// make sure we are at first column
|
||||
QModelIndex current = model->index(idx.row(), 0, idx.parent());
|
||||
|
||||
// check for children
|
||||
if (model->rowCount(current) > 0) {
|
||||
return current.child(0, 0);
|
||||
}
|
||||
// leaf node
|
||||
|
||||
// no more children, go up and look for parent with more children
|
||||
QModelIndex nextIndex;
|
||||
QModelIndex current = idx;
|
||||
while (!nextIndex.isValid()) {
|
||||
int row = current.row();
|
||||
int column = current.column();
|
||||
current = current.parent();
|
||||
|
||||
if (column + 1 < model->columnCount(current)) {
|
||||
nextIndex = model->index(row, column + 1, current);
|
||||
if (row + 1 < model->rowCount(current)) {
|
||||
// Same parent has another child
|
||||
nextIndex = model->index(row + 1, 0, current);
|
||||
} else {
|
||||
if (row + 1 < model->rowCount(current)) {
|
||||
// Same parent has another child
|
||||
nextIndex = model->index(row + 1, 0, current);
|
||||
} else {
|
||||
// go up one parent
|
||||
if (!current.isValid()) {
|
||||
// we start from the beginning
|
||||
if (wrapped)
|
||||
*wrapped = true;
|
||||
nextIndex = model->index(0, 0);
|
||||
}
|
||||
// go up one parent
|
||||
if (!current.isValid()) {
|
||||
// we start from the beginning
|
||||
if (wrapped)
|
||||
*wrapped = true;
|
||||
nextIndex = model->index(0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -240,34 +242,34 @@ QModelIndex TreeViewFind::prevIndex(const QModelIndex &idx, bool *wrapped) const
|
||||
{
|
||||
if (wrapped)
|
||||
*wrapped = false;
|
||||
QAbstractItemModel *model = d->m_view->model();
|
||||
// if same parent has earlier columns, just move there
|
||||
if (idx.column() > 0)
|
||||
return model->index(idx.row(), idx.column() - 1, idx.parent());
|
||||
|
||||
QModelIndex current = idx;
|
||||
bool checkForChildren = true;
|
||||
QAbstractItemModel *model = d->m_view->model();
|
||||
if (current.isValid()) {
|
||||
int row = current.row();
|
||||
int column = current.column();
|
||||
if (column > 0) {
|
||||
current = model->index(row, column - 1, current.parent());
|
||||
if (row > 0) {
|
||||
current = model->index(row - 1, 0, current.parent());
|
||||
} else {
|
||||
if (row > 0) {
|
||||
current = model->index(row - 1, model->columnCount(current.parent()) - 1,
|
||||
current.parent());
|
||||
} else {
|
||||
current = current.parent();
|
||||
checkForChildren = !current.isValid();
|
||||
if (checkForChildren && wrapped) {
|
||||
// we start from the end
|
||||
*wrapped = true;
|
||||
}
|
||||
current = current.parent();
|
||||
checkForChildren = !current.isValid();
|
||||
if (checkForChildren && wrapped) {
|
||||
// we start from the end
|
||||
*wrapped = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (checkForChildren) {
|
||||
// traverse down the hierarchy
|
||||
while (int rc = model->rowCount(current)) {
|
||||
current = model->index(rc - 1, model->columnCount(current) - 1, current);
|
||||
current = model->index(rc - 1, 0, current);
|
||||
}
|
||||
}
|
||||
// set to last column
|
||||
current = model->index(current.row(), model->columnCount(current.parent()) - 1, current.parent());
|
||||
return current;
|
||||
}
|
||||
|
||||
|
@@ -75,8 +75,10 @@ QbsBuildStep::QbsBuildStep(ProjectExplorer::BuildStepList *bsl, const QbsBuildSt
|
||||
QbsBuildStep::~QbsBuildStep()
|
||||
{
|
||||
cancel();
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
if (m_job) {
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
}
|
||||
delete m_parser;
|
||||
}
|
||||
|
||||
|
@@ -72,8 +72,10 @@ QbsCleanStep::QbsCleanStep(ProjectExplorer::BuildStepList *bsl, const QbsCleanSt
|
||||
QbsCleanStep::~QbsCleanStep()
|
||||
{
|
||||
cancel();
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
if (m_job) {
|
||||
m_job->deleteLater();
|
||||
m_job = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool QbsCleanStep::init()
|
||||
|
@@ -53,13 +53,13 @@ const char PROFILE_LIST[] = "preferences.qtcreator.kit.";
|
||||
const char PROFILES_PREFIX[] = "profiles.";
|
||||
|
||||
// Qt related settings:
|
||||
const char QTCORE_BINPATH[] = ".qt.core.binPath";
|
||||
const char QTCORE_INCPATH[] = ".qt.core.incPath";
|
||||
const char QTCORE_LIBPATH[] = ".qt.core.libPath";
|
||||
const char QTCORE_VERSION[] = ".qt.core.version";
|
||||
const char QTCORE_NAMESPACE[] = ".qt.core.namespace";
|
||||
const char QTCORE_LIBINFIX[] = ".qt.core.libInfix";
|
||||
const char QTCORE_MKSPEC[] = ".qt.core.mkspecPath";
|
||||
const char QTCORE_BINPATH[] = ".Qt.core.binPath";
|
||||
const char QTCORE_INCPATH[] = ".Qt.core.incPath";
|
||||
const char QTCORE_LIBPATH[] = ".Qt.core.libPath";
|
||||
const char QTCORE_VERSION[] = ".Qt.core.version";
|
||||
const char QTCORE_NAMESPACE[] = ".Qt.core.namespace";
|
||||
const char QTCORE_LIBINFIX[] = ".Qt.core.libInfix";
|
||||
const char QTCORE_MKSPEC[] = ".Qt.core.mkspecPath";
|
||||
|
||||
|
||||
// Toolchain related settings:
|
||||
|
@@ -462,7 +462,7 @@ void ModelManager::updateProjectInfo(const ProjectInfo &pinfo)
|
||||
|
||||
// dump builtin types if the shipped definitions are probably outdated and the
|
||||
// Qt version ships qmlplugindump
|
||||
if (QtSupport::QtVersionNumber(pinfo.qtVersionString) >= QtSupport::QtVersionNumber(4, 8, 0))
|
||||
if (QtSupport::QtVersionNumber(pinfo.qtVersionString) > QtSupport::QtVersionNumber(4, 8, 5))
|
||||
m_pluginDumper->loadBuiltinTypes(pinfo);
|
||||
|
||||
emit projectInfoUpdated(pinfo);
|
||||
|
@@ -266,6 +266,8 @@ Core::FeatureSet BaseQtVersion::availableFeatures() const
|
||||
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_1_1);
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_2);
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(5, 1, 0))
|
||||
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_CONTROLS);
|
||||
|
||||
return features;
|
||||
}
|
||||
|
@@ -51,6 +51,7 @@ const char FEATURE_QMLPROJECT[] = "QtSupport.Wizards.FeatureQtQuickProject";
|
||||
const char FEATURE_QT_QUICK_1[] = "QtSupport.Wizards.FeatureQtQuick.1";
|
||||
const char FEATURE_QT_QUICK_1_1[] = "QtSupport.Wizards.FeatureQtQuick.1.1";
|
||||
const char FEATURE_QT_QUICK_2[] = "QtSupport.Wizards.FeatureQtQuick.2";
|
||||
const char FEATURE_QT_QUICK_CONTROLS[] = "QtSupport.Wizards.FeatureQtQuick.Controls";
|
||||
const char FEATURE_QT_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit";
|
||||
const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
|
||||
const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego";
|
||||
|
@@ -11,7 +11,7 @@ QtcPlugin {
|
||||
Depends { name: "ProjectExplorer" }
|
||||
Depends { name: "CPlusPlus" }
|
||||
Depends { name: "CppTools" }
|
||||
Depends { name: "QmlJs" }
|
||||
Depends { name: "QmlJS" }
|
||||
|
||||
files: [
|
||||
"constants.h",
|
||||
|
Submodule src/shared/qbs updated: 0c3b88d446...091dc267d3
@@ -10,6 +10,7 @@ SUBDIRS += \
|
||||
environment \
|
||||
generichighlighter \
|
||||
profilewriter \
|
||||
treeviewfind \
|
||||
ioutils \
|
||||
qtcprocess \
|
||||
utils \
|
||||
|
@@ -31,7 +31,7 @@
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Utils {
|
||||
bool operator==(const Utils::FileSearchResult &r1, const Utils::FileSearchResult &r2)
|
||||
{
|
||||
return r1.fileName == r2.fileName
|
||||
@@ -41,7 +41,7 @@ bool operator==(const Utils::FileSearchResult &r1, const Utils::FileSearchResult
|
||||
&& r1.matchLength == r2.matchLength
|
||||
&& r1.regexpCapturedTexts == r2.regexpCapturedTexts;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
} // Utils
|
||||
|
||||
class tst_FileSearch : public QObject
|
||||
{
|
||||
|
8
tests/auto/treeviewfind/treeviewfind.pro
Normal file
8
tests/auto/treeviewfind/treeviewfind.pro
Normal file
@@ -0,0 +1,8 @@
|
||||
include(../qttest.pri)
|
||||
|
||||
include($$IDE_SOURCE_TREE/src/plugins/find/find.pri)
|
||||
|
||||
LIBS *= -L$$IDE_LIBRARY_PATH/QtProject
|
||||
|
||||
SOURCES += \
|
||||
tst_treeviewfind.cpp
|
156
tests/auto/treeviewfind/tst_treeviewfind.cpp
Normal file
156
tests/auto/treeviewfind/tst_treeviewfind.cpp
Normal file
@@ -0,0 +1,156 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <find/treeviewfind.h>
|
||||
|
||||
#include <QtTest>
|
||||
|
||||
#include <QTreeWidget>
|
||||
|
||||
class tst_treeviewfind : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void wrapping();
|
||||
void columns();
|
||||
};
|
||||
|
||||
|
||||
void tst_treeviewfind::wrapping()
|
||||
{
|
||||
// set up tree
|
||||
// search for FOO in
|
||||
// * HEADER1
|
||||
// * FOO1
|
||||
// * HEADER2
|
||||
// * A
|
||||
// * HEADER3
|
||||
// * FOO2
|
||||
QTreeWidget *tree = new QTreeWidget;
|
||||
tree->setColumnCount(1);
|
||||
QList<QTreeWidgetItem *> toplevelitems;
|
||||
QTreeWidgetItem *item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER1"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("FOO1")));
|
||||
toplevelitems << item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER2"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("A")));
|
||||
toplevelitems << item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER3"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("FOO2")));
|
||||
toplevelitems << item;
|
||||
tree->addTopLevelItems(toplevelitems);
|
||||
|
||||
// set up
|
||||
Find::TreeViewFind *findSupport = new Find::TreeViewFind(tree);
|
||||
tree->setCurrentItem(toplevelitems.at(2)->child(0));
|
||||
QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("FOO2"));
|
||||
|
||||
// forward
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0));
|
||||
|
||||
// backward
|
||||
tree->setCurrentItem(toplevelitems.at(0)->child(0));
|
||||
QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("FOO1"));
|
||||
findSupport->findStep(QLatin1String("FOO"), Find::FindBackward);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0));
|
||||
|
||||
// clean up
|
||||
delete findSupport;
|
||||
delete tree;
|
||||
}
|
||||
|
||||
void tst_treeviewfind::columns()
|
||||
{
|
||||
// set up tree
|
||||
// search for FOO in
|
||||
// * HEADER1 | HEADER1
|
||||
// * FOO1 | A
|
||||
// * HEADER2 | FOOHEADER2
|
||||
// * FOO2 | FOO3
|
||||
// * HEADER3 | HEADER2
|
||||
// * A | FOO4
|
||||
QTreeWidget *tree = new QTreeWidget;
|
||||
tree->setColumnCount(2);
|
||||
QList<QTreeWidgetItem *> toplevelitems;
|
||||
QTreeWidgetItem *item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER1") << QLatin1String("HEADER1"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("FOO1") << QLatin1String("A")));
|
||||
toplevelitems << item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER2") << QLatin1String("FOOHEADER2"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("FOO2") << QLatin1String("FOO3")));
|
||||
toplevelitems << item;
|
||||
item = new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("HEADER3") << QLatin1String("HEADER3"));
|
||||
item->addChild(new QTreeWidgetItem((QTreeWidget *)0, QStringList() << QLatin1String("A") << QLatin1String("FOO4")));
|
||||
toplevelitems << item;
|
||||
tree->addTopLevelItems(toplevelitems);
|
||||
|
||||
// set up
|
||||
Find::TreeViewFind *findSupport = new Find::TreeViewFind(tree);
|
||||
tree->setCurrentItem(toplevelitems.at(0));
|
||||
QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("HEADER1"));
|
||||
|
||||
// find in first column
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0));
|
||||
// find in second column of node with children
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(1));
|
||||
// again find in first column
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(1)->child(0));
|
||||
// don't stay in item if multiple columns match, and find in second column
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0));
|
||||
// wrap
|
||||
findSupport->findStep(QLatin1String("FOO"), 0);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0));
|
||||
|
||||
// backwards
|
||||
tree->setCurrentItem(toplevelitems.at(2)->child(0));
|
||||
QCOMPARE(tree->currentItem()->text(0), QString::fromLatin1("A"));
|
||||
findSupport->findStep(QLatin1String("FOO"), Find::FindBackward);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(1)->child(0));
|
||||
findSupport->findStep(QLatin1String("FOO"), Find::FindBackward);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(1));
|
||||
findSupport->findStep(QLatin1String("FOO"), Find::FindBackward);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(0)->child(0));
|
||||
findSupport->findStep(QLatin1String("FOO"), Find::FindBackward);
|
||||
QCOMPARE(tree->currentItem(), toplevelitems.at(2)->child(0));
|
||||
|
||||
// clean up
|
||||
delete findSupport;
|
||||
delete tree;
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_treeviewfind)
|
||||
|
||||
#include "tst_treeviewfind.moc"
|
@@ -284,7 +284,7 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
|
||||
test.fail("Failed to check target '%s'." % Targets.getStringForTarget(current))
|
||||
else:
|
||||
# Simulator has been added without knowing whether configured or not - so skip warning here?
|
||||
if current != Targets.Targets.SIMULATOR:
|
||||
if current != Targets.SIMULATOR:
|
||||
test.warning("Target '%s' is not set up correctly." % Targets.getStringForTarget(current))
|
||||
return checkedTargets
|
||||
|
||||
|
Reference in New Issue
Block a user