Merge remote-tracking branch 'origin/2.7'

Conflicts:
	src/plugins/pythoneditor/tools/lexical/pythonformattoken.h

Change-Id: I7b921cd975aa755166a80d219ed5e8b69888aeb0
This commit is contained in:
Eike Ziller
2013-04-18 09:22:19 +02:00
53 changed files with 2556 additions and 5803 deletions

View File

@@ -16,6 +16,10 @@
\l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels} \l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels}
{What is API Level?}. {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 \note The android-4 API level does not support multitouch. If your
application needs multitouch, select a higher API level. application needs multitouch, select a higher API level.

View File

@@ -242,6 +242,25 @@
\endtable \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 \section1 Setting the Symbol Server in Windows
To obtain debugging information for the operating system libraries for To obtain debugging information for the operating system libraries for

View File

@@ -79,8 +79,23 @@
\section2 File Encoding \section2 File Encoding
To define the default file encoding, select the desired encoding in To define the default file encoding, select a suitable option in
\gui {Default encoding}. By default, \QC uses the file encoding \gui {Default encoding}.
used by your system.
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.
*/ */

View File

@@ -48,11 +48,16 @@
press \key {Alt+Left}. press \key {Alt+Left}.
\li To check that the application code can be compiled and linked for a \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. device.
\image qtcreator-gs-build-example-kit-selector.png "Selecting a kit to build with" \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 \li Click
\inlineimage qtcreator-run.png \inlineimage qtcreator-run.png
(\gui Run) to build and run the application. (\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 \li To see the compilation progress, press \key{Alt+4} to open the
\gui {Compile Output} pane. \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 The \gui Build progress bar on the toolbar turns green when the
project is successfully built. The application opens on the device. project is successfully built. The application opens on the device.

View File

@@ -162,7 +162,6 @@ Project {
Depends { name: "Qt"; submodules: ["widgets", "network"] } Depends { name: "Qt"; submodules: ["widgets", "network"] }
Depends { name: "Utils" } Depends { name: "Utils" }
Depends { name: "ExtensionSystem" } Depends { name: "ExtensionSystem" }
Depends { name: "Core" }
files: [ files: [
"src/app/main.cpp", "src/app/main.cpp",

File diff suppressed because it is too large Load Diff

View File

@@ -49,28 +49,27 @@ AnchorChangesNodeInstance::Pointer AnchorChangesNodeInstance::create(QObject *ob
return instance; 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(); return QVariant();
} }
void AnchorChangesNodeInstance::resetProperty(const QString &/*name*/) void AnchorChangesNodeInstance::resetProperty(const PropertyName &/*name*/)
{ {
} }
void AnchorChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &/*oldParentInstance*/,
void AnchorChangesNodeInstance::reparent(const ServerNodeInstance &/*oldParentInstance*/, const PropertyName &/*oldParentProperty*/,
const QString &/*oldParentProperty*/, const ObjectNodeInstance::Pointer &/*newParentInstance*/,
const ServerNodeInstance &/*newParentInstance*/, const PropertyName &/*newParentProperty*/)
const QString &/*newParentProperty*/)
{ {
} }

View File

@@ -52,16 +52,15 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
virtual void setPropertyVariant(const QString &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
virtual void setPropertyBinding(const QString &name, const QString &expression); void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
virtual QVariant property(const QString &name) const; QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
virtual void resetProperty(const QString &name); void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around void reparent(const ObjectNodeInstance::Pointer &oldParentInstance,
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty,
const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance,
const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
const QString &newParentProperty);
protected: protected:
AnchorChangesNodeInstance(QObject *object); AnchorChangesNodeInstance(QObject *object);

View File

@@ -45,12 +45,12 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
void setPropertyVariant(const PropertyName &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
void setPropertyBinding(const PropertyName &name, const QString &expression); void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
QVariant property(const PropertyName &name) const; QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
void resetProperty(const PropertyName &name); void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
private: private:
bool m_isEnabled; bool m_isEnabled;

View File

@@ -47,9 +47,9 @@ public:
ComponentNodeInstance(QQmlComponent *component); ComponentNodeInstance(QQmlComponent *component);
static Pointer create(QObject *objectToBeWrapped); 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 private: //function
QQmlComponent *component() const; QQmlComponent *component() const;

View File

@@ -42,10 +42,6 @@ DummyNodeInstance::Pointer DummyNodeInstance::create()
return Pointer(new DummyNodeInstance); return Pointer(new DummyNodeInstance);
} }
void DummyNodeInstance::paint(QPainter * /*painter*/)
{
}
QRectF DummyNodeInstance::boundingRect() const QRectF DummyNodeInstance::boundingRect() const
{ {
return QRectF(); return QRectF();
@@ -71,11 +67,11 @@ double DummyNodeInstance::opacity() const
return 0.0; 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(); return QVariant();
} }
QStringList DummyNodeInstance::properties()
{
return QStringList();
}
QStringList DummyNodeInstance::localProperties()
{
return QStringList();
}
void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/) void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/)
{ {

View File

@@ -45,20 +45,16 @@ public:
static Pointer create(); 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; void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
QPointF position() const; void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
QSizeF size() const; void setId(const QString &id) Q_DECL_OVERRIDE;
QTransform transform() const; QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
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 initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance); void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance);

View File

@@ -431,6 +431,10 @@ QVariant ObjectNodeInstance::fixResourcePaths(const QVariant &value)
return value; return value;
} }
void ObjectNodeInstance::updateDirtyNodeRecursive()
{
}
void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value) void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVariant &value)
{ {
QQmlProperty property(object(), name, context()); QQmlProperty property(object(), name, context());
@@ -1097,11 +1101,12 @@ void ObjectNodeInstance::setResetValue(const PropertyName &propertyName, const Q
m_resetValueHash.insert(propertyName, value); 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(); return QImage();
} }

View File

@@ -82,8 +82,8 @@ public:
void setNodeInstanceServer(NodeInstanceServer *server); void setNodeInstanceServer(NodeInstanceServer *server);
virtual void initializePropertyWatcher(const Pointer &objectNodeInstance); virtual void initializePropertyWatcher(const Pointer &objectNodeInstance);
virtual void initialize(const Pointer &objectNodeInstance); virtual void initialize(const Pointer &objectNodeInstance);
virtual void paint(QPainter *painter);
virtual QImage renderImage() const; virtual QImage renderImage() const;
virtual QImage renderPreviewImage(const QSize &previewImageSize) const;
virtual QObject *parent() const; virtual QObject *parent() const;
@@ -178,6 +178,8 @@ public:
static QVariant fixResourcePaths(const QVariant &value); static QVariant fixResourcePaths(const QVariant &value);
virtual void updateDirtyNodeRecursive();
protected: protected:
void doResetProperty(const PropertyName &propertyName); void doResetProperty(const PropertyName &propertyName);
void removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty); void removeFromOldProperty(QObject *object, QObject *oldParent, const PropertyName &oldParentProperty);

View File

@@ -47,14 +47,14 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
void setPropertyVariant(const PropertyName &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
void setPropertyBinding(const PropertyName &name, const QString &expression); 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: protected:
PositionerNodeInstance(QQuickBasePositioner *item); PositionerNodeInstance(QQuickBasePositioner *item);

View File

@@ -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(); changesObject()->detachFromState();
ObjectNodeInstance::reparent(oldParentInstance.internalInstance(), oldParentProperty, newParentInstance.internalInstance(), newParentProperty); ObjectNodeInstance::reparent(oldParentInstance, oldParentProperty, newParentInstance, newParentProperty);
changesObject()->attachToState(); changesObject()->attachToState();
} }

View File

@@ -54,13 +54,12 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
virtual void setPropertyVariant(const PropertyName &name, const QVariant &value); virtual void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
virtual void setPropertyBinding(const PropertyName &name, const QString &expression); virtual void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
virtual QVariant property(const PropertyName &name) const; virtual QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
virtual void resetProperty(const PropertyName &name); virtual void resetProperty(const PropertyName &name) Q_DECL_OVERRIDE;
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty) Q_DECL_OVERRIDE;
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
protected: protected:
QmlPropertyChangesNodeInstance(QQuickPropertyChanges *object); QmlPropertyChangesNodeInstance(QQuickPropertyChanges *object);

View File

@@ -48,15 +48,15 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
void setPropertyVariant(const PropertyName &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
void setPropertyBinding(const PropertyName &name, const QString &expression); void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
void activateState(); void activateState() Q_DECL_OVERRIDE;
void deactivateState(); void deactivateState() Q_DECL_OVERRIDE;
bool updateStateVariant(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &value); 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); 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); bool resetStateProperty(const ObjectNodeInstance::Pointer &target, const PropertyName &propertyName, const QVariant &resetValue) Q_DECL_OVERRIDE;
protected: protected:

View File

@@ -47,9 +47,9 @@ public:
static Pointer create(QObject *objectToBeWrapped); 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: protected:
QQuickTransition *qmlTransition() const; QQuickTransition *qmlTransition() const;

View File

@@ -41,15 +41,15 @@ class Qt5InformationNodeInstanceServer : public Qt5NodeInstanceServer
public: public:
explicit Qt5InformationNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); explicit Qt5InformationNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
void reparentInstances(const ReparentInstancesCommand &command); void reparentInstances(const ReparentInstancesCommand &command) Q_DECL_OVERRIDE;
void clearScene(const ClearSceneCommand &command); void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
void createScene(const CreateSceneCommand &command); void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
void completeComponent(const CompleteComponentCommand &command); void completeComponent(const CompleteComponentCommand &command) Q_DECL_OVERRIDE;
void token(const TokenCommand &command); void token(const TokenCommand &command) Q_DECL_OVERRIDE;
void removeSharedMemory(const RemoveSharedMemoryCommand &command); void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
protected: protected:
void collectItemChangesAndSendChangeCommands(); void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
void sendChildrenChangedCommand(const QList<ServerNodeInstance> childList); void sendChildrenChangedCommand(const QList<ServerNodeInstance> childList);
void sendTokenBack(); void sendTokenBack();

View File

@@ -48,21 +48,21 @@ public:
Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); Qt5NodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
~Qt5NodeInstanceServer(); ~Qt5NodeInstanceServer();
QQuickView *quickView() const; QQuickView *quickView() const Q_DECL_OVERRIDE;
QQmlView *declarativeView() const; QQmlView *declarativeView() const Q_DECL_OVERRIDE;
QQmlEngine *engine() const; QQmlEngine *engine() const Q_DECL_OVERRIDE;
void refreshBindings(); void refreshBindings() Q_DECL_OVERRIDE;
DesignerSupport *designerSupport() const; DesignerSupport *designerSupport() const;
void createScene(const CreateSceneCommand &command); void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
void clearScene(const ClearSceneCommand &command); void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
protected: protected:
void initializeView(const QVector<AddImportContainer> &importVector); void initializeView(const QVector<AddImportContainer> &importVector) Q_DECL_OVERRIDE;
void resizeCanvasSizeToRootItemSize(); void resizeCanvasSizeToRootItemSize() Q_DECL_OVERRIDE;
void resetAllItems(); void resetAllItems();
QList<ServerNodeInstance> setupScene(const CreateSceneCommand &command); QList<ServerNodeInstance> setupScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
QList<QQuickItem*> allItems() const; QList<QQuickItem*> allItems() const;
private: private:

View File

@@ -65,7 +65,7 @@ void Qt5PreviewNodeInstanceServer::collectItemChangesAndSendChangeCommands()
{ {
static bool inFunction = false; static bool inFunction = false;
if (rootNodeInstance().internalSGItem() == 0) if (!rootNodeInstance().holdsQuickItem())
return; return;
if (!inFunction && nodeInstanceClient()->bytesToWrite() < 10000) { if (!inFunction && nodeInstanceClient()->bytesToWrite() < 10000) {
@@ -106,17 +106,14 @@ static void updateDirtyNodeRecursive(QQuickItem *parentItem)
QImage Qt5PreviewNodeInstanceServer::renderPreviewImage() QImage Qt5PreviewNodeInstanceServer::renderPreviewImage()
{ {
updateDirtyNodeRecursive(rootNodeInstance().internalSGItem()); rootNodeInstance().updateDirtyNodeRecursive();
QRectF boundingRect = rootNodeInstance().boundingRect(); QRectF boundingRect = rootNodeInstance().boundingRect();
QSize previewImageSize = boundingRect.size().toSize(); QSize previewImageSize = boundingRect.size().toSize();
previewImageSize.scale(QSize(100, 100), Qt::KeepAspectRatio); previewImageSize.scale(QSize(100, 100), Qt::KeepAspectRatio);
QImage previewImage; QImage previewImage = rootNodeInstance().renderPreviewImage(previewImageSize);
if (boundingRect.isValid() && rootNodeInstance().internalSGItem())
previewImage = designerSupport()->renderImageForItem(rootNodeInstance().internalSGItem(), boundingRect, previewImageSize);
previewImage = previewImage.convertToFormat(QImage::Format_ARGB32_Premultiplied); previewImage = previewImage.convertToFormat(QImage::Format_ARGB32_Premultiplied);

View File

@@ -40,15 +40,15 @@ class Qt5PreviewNodeInstanceServer : public Qt5NodeInstanceServer
public: public:
explicit Qt5PreviewNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); explicit Qt5PreviewNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
void createScene(const CreateSceneCommand &command); void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
void changeState(const ChangeStateCommand &command); void changeState(const ChangeStateCommand &command) Q_DECL_OVERRIDE;
void removeSharedMemory(const RemoveSharedMemoryCommand &command); void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
QImage renderPreviewImage(); QImage renderPreviewImage();
protected: protected:
void collectItemChangesAndSendChangeCommands(); void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
void startRenderTimer(); void startRenderTimer() Q_DECL_OVERRIDE;
private: private:
ServerNodeInstance m_actualState; ServerNodeInstance m_actualState;

View File

@@ -40,13 +40,13 @@ class Qt5RenderNodeInstanceServer : public Qt5NodeInstanceServer
public: public:
explicit Qt5RenderNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient); explicit Qt5RenderNodeInstanceServer(NodeInstanceClientInterface *nodeInstanceClient);
void createScene(const CreateSceneCommand &command); void createScene(const CreateSceneCommand &command) Q_DECL_OVERRIDE;
void clearScene(const ClearSceneCommand &command); void clearScene(const ClearSceneCommand &command) Q_DECL_OVERRIDE;
void completeComponent(const CompleteComponentCommand &command); void completeComponent(const CompleteComponentCommand &command) Q_DECL_OVERRIDE;
void removeSharedMemory(const RemoveSharedMemoryCommand &command); void removeSharedMemory(const RemoveSharedMemoryCommand &command) Q_DECL_OVERRIDE;
protected: protected:
void collectItemChangesAndSendChangeCommands(); void collectItemChangesAndSendChangeCommands() Q_DECL_OVERRIDE;
ServerNodeInstance findNodeInstanceForItem(QQuickItem *item) const; ServerNodeInstance findNodeInstanceForItem(QQuickItem *item) const;
private: private:

View File

@@ -218,6 +218,14 @@ void QuickItemNodeInstance::updateDirtyNodeRecursive(QQuickItem *parentItem) con
DesignerSupport::updateDirtyNode(parentItem); DesignerSupport::updateDirtyNode(parentItem);
} }
void QuickItemNodeInstance::updateAllDirtyNodeRecursive(QQuickItem *parentItem) const
{
foreach (QQuickItem *childItem, parentItem->childItems())
updateDirtyNodeRecursive(childItem);
DesignerSupport::updateDirtyNode(parentItem);
}
QImage QuickItemNodeInstance::renderImage() const QImage QuickItemNodeInstance::renderImage() const
{ {
updateDirtyNodeRecursive(quickItem()); updateDirtyNodeRecursive(quickItem());
@@ -231,6 +239,16 @@ QImage QuickItemNodeInstance::renderImage() const
return renderImage; 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 bool QuickItemNodeInstance::isMovable() const
{ {
if (isRootNodeInstance()) if (isRootNodeInstance())
@@ -661,6 +679,11 @@ void QuickItemNodeInstance::createEffectItem(bool createEffectItem)
s_createEffectItem = createEffectItem; s_createEffectItem = createEffectItem;
} }
void QuickItemNodeInstance::updateDirtyNodeRecursive()
{
updateAllDirtyNodeRecursive(quickItem());
}
} // namespace Internal } // namespace Internal
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -49,65 +49,68 @@ public:
~QuickItemNodeInstance(); ~QuickItemNodeInstance();
static Pointer create(QObject *objectToBeWrapped); 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; QRectF boundingRect() const Q_DECL_OVERRIDE;
QPointF position() const; QPointF position() const Q_DECL_OVERRIDE;
QSizeF size() const; QSizeF size() const Q_DECL_OVERRIDE;
QTransform transform() const; QTransform transform() const Q_DECL_OVERRIDE;
QTransform customTransform() const; QTransform customTransform() const Q_DECL_OVERRIDE;
QTransform sceneTransform() const; QTransform sceneTransform() const Q_DECL_OVERRIDE;
double opacity() const; double opacity() const Q_DECL_OVERRIDE;
QObject *parent() const; QObject *parent() const Q_DECL_OVERRIDE;
double rotation() const; double rotation() const Q_DECL_OVERRIDE;
double scale() const; double scale() const Q_DECL_OVERRIDE;
QPointF transformOriginPoint() const; QPointF transformOriginPoint() const Q_DECL_OVERRIDE;
double zValue() const; double zValue() const Q_DECL_OVERRIDE;
bool equalQuickItem(QQuickItem *item) const; 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; QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
bool isMovable() const; bool isMovable() const Q_DECL_OVERRIDE;
void setMovable(bool movable); void setMovable(bool movable);
void setPropertyVariant(const PropertyName &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value) Q_DECL_OVERRIDE;
void setPropertyBinding(const PropertyName &name, const QString &expression); void setPropertyBinding(const PropertyName &name, const QString &expression) Q_DECL_OVERRIDE;
QVariant property(const PropertyName &name) const; QVariant property(const PropertyName &name) const Q_DECL_OVERRIDE;
void resetProperty(const PropertyName &name); 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; bool hasAnchor(const PropertyName &name) const Q_DECL_OVERRIDE;
QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const; QPair<PropertyName, ServerNodeInstance> anchor(const PropertyName &name) const Q_DECL_OVERRIDE;
bool isAnchoredBySibling() const; bool isAnchoredBySibling() const Q_DECL_OVERRIDE;
bool isAnchoredByChildren() const; bool isAnchoredByChildren() const Q_DECL_OVERRIDE;
void doComponentComplete(); void doComponentComplete() Q_DECL_OVERRIDE;
bool isResizable() const; bool isResizable() const Q_DECL_OVERRIDE;
void setResizable(bool resizeable); void setResizable(bool resizeable);
void setHasContent(bool hasContent); 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; DesignerSupport *designerSupport() const;
Qt5NodeInstanceServer *qt5NodeInstanceServer() const; Qt5NodeInstanceServer *qt5NodeInstanceServer() const;
static void createEffectItem(bool createEffectItem); static void createEffectItem(bool createEffectItem);
void updateDirtyNodeRecursive() Q_DECL_OVERRIDE;
protected: protected:
QuickItemNodeInstance(QQuickItem*); QuickItemNodeInstance(QQuickItem*);
QQuickItem *quickItem() const; QQuickItem *quickItem() const;
@@ -116,6 +119,7 @@ protected:
void refresh(); void refresh();
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const; QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void updateDirtyNodeRecursive(QQuickItem *parentItem) const; void updateDirtyNodeRecursive(QQuickItem *parentItem) const;
void updateAllDirtyNodeRecursive(QQuickItem *parentItem) const;
static bool anyItemHasContent(QQuickItem *graphicsItem); static bool anyItemHasContent(QQuickItem *graphicsItem);
static bool childItemsHaveContent(QQuickItem *graphicsItem); static bool childItemsHaveContent(QQuickItem *graphicsItem);

View File

@@ -108,20 +108,16 @@ ServerNodeInstance &ServerNodeInstance::operator=(const ServerNodeInstance &othe
return *this; 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 QImage ServerNodeInstance::renderImage() const
{ {
return m_nodeInstance->renderImage(); return m_nodeInstance->renderImage();
} }
QImage ServerNodeInstance::renderPreviewImage(const QSize &previewImageSize) const
{
return m_nodeInstance->renderPreviewImage(previewImageSize);
}
bool ServerNodeInstance::isRootNodeInstance() const bool ServerNodeInstance::isRootNodeInstance() const
{ {
return isValid() && m_nodeInstance->isRootNodeInstance(); return isValid() && m_nodeInstance->isRootNodeInstance();
@@ -153,6 +149,16 @@ void ServerNodeInstance::setNodeSource(const QString &source)
m_nodeInstance->setNodeSource(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 bool ServerNodeInstance::isSubclassOf(const QString &superTypeName) const
{ {
return isSubclassOf(internalObject(), superTypeName.toUtf8()); return isSubclassOf(internalObject(), superTypeName.toUtf8());
@@ -552,13 +558,6 @@ QObject *ServerNodeInstance::internalObject() const
return m_nodeInstance->object(); 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() void ServerNodeInstance::activateState()
{ {
m_nodeInstance->activateState(); m_nodeInstance->activateState();

View File

@@ -96,8 +96,8 @@ public:
ServerNodeInstance(const ServerNodeInstance &other); ServerNodeInstance(const ServerNodeInstance &other);
ServerNodeInstance& operator=(const ServerNodeInstance &other); ServerNodeInstance& operator=(const ServerNodeInstance &other);
void paint(QPainter *painter);
QImage renderImage() const; QImage renderImage() const;
QImage renderPreviewImage(const QSize &previewImageSize) const;
ServerNodeInstance parent() const; ServerNodeInstance parent() const;
bool hasParent() const; bool hasParent() const;
@@ -196,11 +196,11 @@ private: // functions
void setNodeSource(const QString &source); void setNodeSource(const QString &source);
bool holdsQuickItem() const;
void updateDirtyNodeRecursive();
QObject *internalObject() const; // should be not used outside of the nodeinstances!!!! 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 private: // variables
QSharedPointer<Internal::ObjectNodeInstance> m_nodeInstance; QSharedPointer<Internal::ObjectNodeInstance> m_nodeInstance;

View File

@@ -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 QT += core-private qml-private quick-private gui-private script-private v8-private
!macx {
CONFIG += c++11
}
DEFINES += QWEAKPOINTER_ENABLE_ARROW DEFINES += QWEAKPOINTER_ENABLE_ARROW
include (../instances/instances.pri) include (../instances/instances.pri)

View File

@@ -49,28 +49,28 @@ AnchorChangesNodeInstance::Pointer AnchorChangesNodeInstance::create(QObject *ob
return instance; 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(); return QVariant();
} }
void AnchorChangesNodeInstance::resetProperty(const QString &/*name*/) void AnchorChangesNodeInstance::resetProperty(const PropertyName &/*name*/)
{ {
} }
void AnchorChangesNodeInstance::reparent(const ServerNodeInstance &/*oldParentInstance*/, void AnchorChangesNodeInstance::reparent(const ObjectNodeInstance::Pointer &/*oldParentInstance*/,
const QString &/*oldParentProperty*/, const PropertyName &/*oldParentProperty*/,
const ServerNodeInstance &/*newParentInstance*/, const ObjectNodeInstance::Pointer &/*newParentInstance*/,
const QString &/*newParentProperty*/) const PropertyName &/*newParentProperty*/)
{ {
} }

View File

@@ -53,16 +53,15 @@ public:
static Pointer create(QObject *objectToBeWrapped); static Pointer create(QObject *objectToBeWrapped);
virtual void setPropertyVariant(const QString &name, const QVariant &value); virtual void setPropertyVariant(const PropertyName &name, const QVariant &value);
virtual void setPropertyBinding(const QString &name, const QString &expression); virtual void setPropertyBinding(const PropertyName &name, const QString &expression);
virtual QVariant property(const QString &name) const; virtual QVariant property(const PropertyName &name) const;
virtual void resetProperty(const QString &name); virtual void resetProperty(const PropertyName &name);
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around void reparent(const ObjectNodeInstance::Pointer &oldParentInstance,
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty,
const QString &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance,
const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
const QString &newParentProperty);
protected: protected:
AnchorChangesNodeInstance(QObject *object); AnchorChangesNodeInstance(QObject *object);

View File

@@ -70,38 +70,25 @@ double DummyNodeInstance::opacity() const
return 0.0; 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*/) void DummyNodeInstance::setId(const QString &/*id*/)
{ {
} }
QVariant DummyNodeInstance::property(const QString &/*name*/) const QVariant DummyNodeInstance::property(const PropertyName &/*name*/) const
{ {
return QVariant(); return QVariant();
} }
QStringList DummyNodeInstance::properties()
{
return QStringList();
}
QStringList DummyNodeInstance::localProperties()
{
return QStringList();
}
void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/) void DummyNodeInstance::initializePropertyWatcher(const ObjectNodeInstance::Pointer &/*objectNodeInstance*/)
{ {
} }
} // namespace Internal } // namespace Internal

View File

@@ -53,12 +53,11 @@ public:
QTransform transform() const; QTransform transform() const;
double opacity() const; double opacity() const;
void setPropertyVariant(const QString &name, const QVariant &value); void setPropertyVariant(const PropertyName &name, const QVariant &value);
void setPropertyBinding(const QString &name, const QString &expression); void setPropertyBinding(const PropertyName &name, const QString &expression);
void setId(const QString &id); void setId(const QString &id);
QVariant property(const QString &name) const; QVariant property(const PropertyName &name) const;
QStringList properties();
QStringList localProperties();
void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance); void initializePropertyWatcher(const ObjectNodeInstance::Pointer &objectNodeInstance);

View File

@@ -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(); changesObject()->detachFromState();
ObjectNodeInstance::reparent(oldParentInstance.internalInstance(), oldParentProperty, newParentInstance.internalInstance(), newParentProperty); ObjectNodeInstance::reparent(oldParentInstance, oldParentProperty, newParentInstance, newParentProperty);
changesObject()->attachToState(); changesObject()->attachToState();
} }

View File

@@ -60,8 +60,7 @@ public:
virtual QVariant property(const PropertyName &name) const; virtual QVariant property(const PropertyName &name) const;
virtual void resetProperty(const PropertyName &name); virtual void resetProperty(const PropertyName &name);
using ObjectNodeInstance::reparent; // keep the virtual reparent(...) method around void reparent(const ObjectNodeInstance::Pointer &oldParentInstance, const PropertyName &oldParentProperty, const ObjectNodeInstance::Pointer &newParentInstance, const PropertyName &newParentProperty);
void reparent(const ServerNodeInstance &oldParentInstance, const PropertyName &oldParentProperty, const ServerNodeInstance &newParentInstance, const PropertyName &newParentProperty);
protected: protected:
QmlPropertyChangesNodeInstance(QDeclarativePropertyChanges *object); QmlPropertyChangesNodeInstance(QDeclarativePropertyChanges *object);

View File

@@ -36,6 +36,7 @@
#include "androidpackagecreationstep.h" #include "androidpackagecreationstep.h"
#include "androidtoolchain.h" #include "androidtoolchain.h"
#include <coreplugin/documentmanager.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/target.h> #include <projectexplorer/target.h>
@@ -235,17 +236,22 @@ bool AndroidManager::ensureIconAttribute(ProjectExplorer::Target *target)
QString AndroidManager::targetSDK(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)) if (!createAndroidTemplatesIfNecessary(target))
return AndroidConfigurations::instance().bestMatch(QLatin1String("android-8")); return AndroidConfigurations::instance().bestMatch(fallback);
QFile file(defaultPropertiesPath(target).toString()); QFile file(defaultPropertiesPath(target).toString());
if (!file.open(QIODevice::ReadOnly)) if (!file.open(QIODevice::ReadOnly))
return AndroidConfigurations::instance().bestMatch(QLatin1String("android-8")); return AndroidConfigurations::instance().bestMatch(fallback);
while (!file.atEnd()) { while (!file.atEnd()) {
QByteArray line = file.readLine(); QByteArray line = file.readLine();
if (line.startsWith("target=")) if (line.startsWith("target="))
return QString::fromLatin1(line.trimmed().mid(7)); 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) bool AndroidManager::setTargetSDK(ProjectExplorer::Target *target, const QString &sdk)
@@ -534,12 +540,18 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
if (!androidFiles.isEmpty()) if (!androidFiles.isEmpty())
qt4Project->rootProjectNode()->addFiles(ProjectExplorer::UnknownFileType, androidFiles); 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()) { if (sdks.isEmpty()) {
raiseError(tr("No Qt for Android SDKs were found.\nPlease install at least one SDK.")); raiseError(tr("No Qt for Android SDKs were found.\nPlease install at least one SDK."));
return false; return false;
} }
updateTarget(target, AndroidConfigurations::instance().sdkTargets().at(0));
updateTarget(target, AndroidConfigurations::instance().sdkTargets(minApiLevel).at(0));
QStringList apps = availableTargetApplications(target); QStringList apps = availableTargetApplications(target);
if (!apps.isEmpty()) if (!apps.isEmpty())
setTargetApplication(target, apps.at(0)); setTargetApplication(target, apps.at(0));
@@ -899,6 +911,7 @@ bool AndroidManager::openManifest(ProjectExplorer::Target *target, QDomDocument
bool AndroidManager::saveManifest(ProjectExplorer::Target *target, QDomDocument &doc) bool AndroidManager::saveManifest(ProjectExplorer::Target *target, QDomDocument &doc)
{ {
Core::FileChangeBlocker blocker(manifestPath(target).toString());
return saveXmlFile(target, doc, manifestPath(target)); return saveXmlFile(target, doc, manifestPath(target));
} }

View File

@@ -49,6 +49,8 @@
#include <QFileDialog> #include <QFileDialog>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QMessageBox> #include <QMessageBox>
#include <qtsupport/baseqtversion.h>
#include <qtsupport/qtkitinformation.h>
namespace Android { namespace Android {
namespace Internal { namespace Internal {
@@ -277,7 +279,13 @@ void AndroidPackageCreationWidget::updateAndroidProjectInfo()
ProjectExplorer::Target *target = m_step->target(); ProjectExplorer::Target *target = m_step->target();
const QString packageName = AndroidManager::packageName(target); const QString packageName = AndroidManager::packageName(target);
m_ui->targetSDKComboBox->clear(); 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->addItems(targets);
m_ui->targetSDKComboBox->setCurrentIndex(targets.indexOf(AndroidManager::targetSDK(target))); m_ui->targetSDKComboBox->setCurrentIndex(targets.indexOf(AndroidManager::targetSDK(target)));
m_ui->packageNameLineEdit->setText(packageName); m_ui->packageNameLineEdit->setText(packageName);

View File

@@ -432,7 +432,10 @@ void BookmarkManager::toggleBookmark(const QString &fileName, int lineNumber)
void BookmarkManager::updateBookmark(Bookmark *bookmark) 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())); emit dataChanged(index(idx, 0, QModelIndex()), index(idx, 2, QModelIndex()));
saveBookmarks(); saveBookmarks();
} }

View File

@@ -2283,7 +2283,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_attachToRemoteServerAction->setEnabled(true); m_attachToRemoteServerAction->setEnabled(true);
m_attachToRunningApplication->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 isCore = engine->startParameters().startMode == AttachCore;
const bool stopped = state == InferiorStopOk; const bool stopped = state == InferiorStopOk;

View File

@@ -167,7 +167,7 @@ IFindSupport::Result TreeViewFind::find(const QString &searchTxt,
Qt::CaseInsensitive)); Qt::CaseInsensitive));
if (searchExpr.indexIn(text) != -1 if (searchExpr.indexIn(text) != -1
&& d->m_view->model()->flags(index) & Qt::ItemIsSelectable && d->m_view->model()->flags(index) & Qt::ItemIsSelectable
&& currentRow != index.row()) && (index.row() != currentRow || index.parent() != currentIndex.parent()))
resultIndex = index; resultIndex = index;
} else { } else {
QTextDocument doc(text); QTextDocument doc(text);
@@ -175,7 +175,7 @@ IFindSupport::Result TreeViewFind::find(const QString &searchTxt,
flags & (Find::FindCaseSensitively | flags & (Find::FindCaseSensitively |
Find::FindWholeWords)).isNull() Find::FindWholeWords)).isNull()
&& d->m_view->model()->flags(index) & Qt::ItemIsSelectable && d->m_view->model()->flags(index) & Qt::ItemIsSelectable
&& currentRow != index.row()) && (index.row() != currentRow || index.parent() != currentIndex.parent()))
resultIndex = index; resultIndex = index;
} }
} }
@@ -203,33 +203,35 @@ QModelIndex TreeViewFind::nextIndex(const QModelIndex &idx, bool *wrapped) const
if (!idx.isValid()) if (!idx.isValid())
return model->index(0, 0); 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) { // tree views have their children attached to first column
// node with children // make sure we are at first column
return idx.child(0, 0); 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 nextIndex;
QModelIndex current = idx;
while (!nextIndex.isValid()) { while (!nextIndex.isValid()) {
int row = current.row(); int row = current.row();
int column = current.column();
current = current.parent(); current = current.parent();
if (column + 1 < model->columnCount(current)) { if (row + 1 < model->rowCount(current)) {
nextIndex = model->index(row, column + 1, current); // Same parent has another child
nextIndex = model->index(row + 1, 0, current);
} else { } else {
if (row + 1 < model->rowCount(current)) { // go up one parent
// Same parent has another child if (!current.isValid()) {
nextIndex = model->index(row + 1, 0, current); // we start from the beginning
} else { if (wrapped)
// go up one parent *wrapped = true;
if (!current.isValid()) { nextIndex = model->index(0, 0);
// 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) if (wrapped)
*wrapped = false; *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; QModelIndex current = idx;
bool checkForChildren = true; bool checkForChildren = true;
QAbstractItemModel *model = d->m_view->model();
if (current.isValid()) { if (current.isValid()) {
int row = current.row(); int row = current.row();
int column = current.column(); if (row > 0) {
if (column > 0) { current = model->index(row - 1, 0, current.parent());
current = model->index(row, column - 1, current.parent());
} else { } else {
if (row > 0) { current = current.parent();
current = model->index(row - 1, model->columnCount(current.parent()) - 1, checkForChildren = !current.isValid();
current.parent()); if (checkForChildren && wrapped) {
} else { // we start from the end
current = current.parent(); *wrapped = true;
checkForChildren = !current.isValid();
if (checkForChildren && wrapped) {
// we start from the end
*wrapped = true;
}
} }
} }
} }
if (checkForChildren) { if (checkForChildren) {
// traverse down the hierarchy // traverse down the hierarchy
while (int rc = model->rowCount(current)) { 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; return current;
} }

View File

@@ -75,8 +75,10 @@ QbsBuildStep::QbsBuildStep(ProjectExplorer::BuildStepList *bsl, const QbsBuildSt
QbsBuildStep::~QbsBuildStep() QbsBuildStep::~QbsBuildStep()
{ {
cancel(); cancel();
m_job->deleteLater(); if (m_job) {
m_job = 0; m_job->deleteLater();
m_job = 0;
}
delete m_parser; delete m_parser;
} }

View File

@@ -72,8 +72,10 @@ QbsCleanStep::QbsCleanStep(ProjectExplorer::BuildStepList *bsl, const QbsCleanSt
QbsCleanStep::~QbsCleanStep() QbsCleanStep::~QbsCleanStep()
{ {
cancel(); cancel();
m_job->deleteLater(); if (m_job) {
m_job = 0; m_job->deleteLater();
m_job = 0;
}
} }
bool QbsCleanStep::init() bool QbsCleanStep::init()

View File

@@ -53,13 +53,13 @@ const char PROFILE_LIST[] = "preferences.qtcreator.kit.";
const char PROFILES_PREFIX[] = "profiles."; const char PROFILES_PREFIX[] = "profiles.";
// Qt related settings: // Qt related settings:
const char QTCORE_BINPATH[] = ".qt.core.binPath"; const char QTCORE_BINPATH[] = ".Qt.core.binPath";
const char QTCORE_INCPATH[] = ".qt.core.incPath"; const char QTCORE_INCPATH[] = ".Qt.core.incPath";
const char QTCORE_LIBPATH[] = ".qt.core.libPath"; const char QTCORE_LIBPATH[] = ".Qt.core.libPath";
const char QTCORE_VERSION[] = ".qt.core.version"; const char QTCORE_VERSION[] = ".Qt.core.version";
const char QTCORE_NAMESPACE[] = ".qt.core.namespace"; const char QTCORE_NAMESPACE[] = ".Qt.core.namespace";
const char QTCORE_LIBINFIX[] = ".qt.core.libInfix"; const char QTCORE_LIBINFIX[] = ".Qt.core.libInfix";
const char QTCORE_MKSPEC[] = ".qt.core.mkspecPath"; const char QTCORE_MKSPEC[] = ".Qt.core.mkspecPath";
// Toolchain related settings: // Toolchain related settings:

View File

@@ -462,7 +462,7 @@ void ModelManager::updateProjectInfo(const ProjectInfo &pinfo)
// dump builtin types if the shipped definitions are probably outdated and the // dump builtin types if the shipped definitions are probably outdated and the
// Qt version ships qmlplugindump // 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); m_pluginDumper->loadBuiltinTypes(pinfo);
emit projectInfoUpdated(pinfo); emit projectInfoUpdated(pinfo);

View File

@@ -266,6 +266,8 @@ Core::FeatureSet BaseQtVersion::availableFeatures() const
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_1_1); features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_1_1);
if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0)) if (qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
features |= Core::FeatureSet(QtSupport::Constants::FEATURE_QT_QUICK_2); 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; return features;
} }

View File

@@ -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[] = "QtSupport.Wizards.FeatureQtQuick.1";
const char FEATURE_QT_QUICK_1_1[] = "QtSupport.Wizards.FeatureQtQuick.1.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_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_WEBKIT[] = "QtSupport.Wizards.FeatureQtWebkit";
const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole"; const char FEATURE_QT_CONSOLE[] = "QtSupport.Wizards.FeatureQtConsole";
const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego"; const char FEATURE_QTQUICK_COMPONENTS_MEEGO[] = "QtSupport.Wizards.FeatureQtQuickComponentsMeego";

View File

@@ -11,7 +11,7 @@ QtcPlugin {
Depends { name: "ProjectExplorer" } Depends { name: "ProjectExplorer" }
Depends { name: "CPlusPlus" } Depends { name: "CPlusPlus" }
Depends { name: "CppTools" } Depends { name: "CppTools" }
Depends { name: "QmlJs" } Depends { name: "QmlJS" }
files: [ files: [
"constants.h", "constants.h",

View File

@@ -10,6 +10,7 @@ SUBDIRS += \
environment \ environment \
generichighlighter \ generichighlighter \
profilewriter \ profilewriter \
treeviewfind \
ioutils \ ioutils \
qtcprocess \ qtcprocess \
utils \ utils \

View File

@@ -31,7 +31,7 @@
#include <QtTest> #include <QtTest>
QT_BEGIN_NAMESPACE namespace Utils {
bool operator==(const Utils::FileSearchResult &r1, const Utils::FileSearchResult &r2) bool operator==(const Utils::FileSearchResult &r1, const Utils::FileSearchResult &r2)
{ {
return r1.fileName == r2.fileName return r1.fileName == r2.fileName
@@ -41,7 +41,7 @@ bool operator==(const Utils::FileSearchResult &r1, const Utils::FileSearchResult
&& r1.matchLength == r2.matchLength && r1.matchLength == r2.matchLength
&& r1.regexpCapturedTexts == r2.regexpCapturedTexts; && r1.regexpCapturedTexts == r2.regexpCapturedTexts;
} }
QT_END_NAMESPACE } // Utils
class tst_FileSearch : public QObject class tst_FileSearch : public QObject
{ {

View 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

View 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"

View File

@@ -284,7 +284,7 @@ def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
test.fail("Failed to check target '%s'." % Targets.getStringForTarget(current)) test.fail("Failed to check target '%s'." % Targets.getStringForTarget(current))
else: else:
# Simulator has been added without knowing whether configured or not - so skip warning here? # 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)) test.warning("Target '%s' is not set up correctly." % Targets.getStringForTarget(current))
return checkedTargets return checkedTargets