QmlDesigner: reactivating subcomponent editing

This includes refactoring the DesignDocumentController.
In the ComponentTextMoifier I use replaced because it is not blocked by
beginEditBlock() of the text cursor.

I use the same pattern now for ComponentView like for all the other
views.
The view is created and controlled by DesignModeWidget because we
have only a single instance.

Change-Id: I7809b96f52f4d275f0231f3961c3c4bc2618ce89
Reviewed-on: http://codereview.qt.nokia.com/96
Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
This commit is contained in:
Thomas Hartmann
2011-05-24 18:47:33 +02:00
committed by Marco Bubke
parent e3842f9973
commit f950b8d7c7
9 changed files with 109 additions and 64 deletions

View File

@@ -44,6 +44,8 @@ QT_END_NAMESPACE
namespace QmlDesigner {
class ComponentAction;
class ComponentView : public AbstractView
{
Q_OBJECT
@@ -59,6 +61,8 @@ public:
void modelAttached(Model *model);
void modelAboutToBeDetached(Model *model);
ComponentAction *action();
void nodeCreated(const ModelNode &createdNode);
void nodeAboutToBeRemoved(const ModelNode &removedNode);
void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange);
@@ -107,13 +111,14 @@ signals:
private: //functions
void updateModel();
void searchForComponentAndAddToList(const ModelNode &node);
// void searchForComponentAndRemoveFromList(const ModelNode &node);
void searchForComponentAndRemoveFromList(const ModelNode &node);
void appendWholeDocumentAsComponent();
private:
QStringList m_componentList;
QStandardItemModel *m_standardItemModel;
bool m_listChanged;
ComponentAction *m_componentAction;
};
} // namespace QmlDesigner