Commit Graph

33 Commits

Author SHA1 Message Date
Thomas Hartmann
c4babe8c43 QmlDesigner: crash fix
The assert is wrong. We check the currentModel from QmlDesignerPlugin::hideDesigner()
and it can be null in case of a .ui/.qbs file.

Change-Id: Ifffa168f81bade757cc8d800150e4411c09915e7
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-29 14:34:56 +02:00
Thomas Hartmann
eeb0dc2d03 QmlDesigner: signal was renamed
Change-Id: Iddb2066372cdb9f1b80b8ab53ab88c69273634c1
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-12 18:08:27 +02:00
Thomas Hartmann
13033734a1 QmlDesigner: Fix crumble bar for infile components
CrumbleBarInfo contains the ModelNode to properly identify the node.
We cannot use the id, because no every component has an id.

If the crumble bar only contains one item it is hidden.

Change-Id: I4d421eaad8962aa9043567e1f27957b1aa089766
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-12 17:51:26 +02:00
Marco Bubke
7f66d8fe03 QmlDesigner: Raise exception for a invalid parent property
Change-Id: I0272b0aefc0598ad524aa1d9e6b434ef2dcd79a9
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-08-12 16:19:11 +02:00
Thomas Hartmann
934291077c QmlDesigner: remove DesignDocument::changeToExternalSubComponent()
This function did nothing but call EditorManager::openEditor(), so we can
call it directly instead. It was not used consistently anyway.

Change-Id: I639ef346164be9260e887faac5dc6651ccfd92c5
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-05 16:40:32 +02:00
Thomas Hartmann
b108f72bc7 QmlDesigner: remove DesignDocument::goIntoSelectedComponent()
This function is highly confusing as a member of DesignDocument
and the logic can be implemented directly in the ShortcutManager.

Change-Id: Id722dcb71b542b4780614c9f895f06150ccb67ca
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-05 16:40:25 +02:00
Thomas Hartmann
1175759f1c QmlDesigner: Do not use ModelNodeOperations outside of DesignerActions
The ModelNodeOperations are an implementation detail of our
DesignerActions and should not be used in other places.

Change-Id: I495bfd043a6b1dd89952b0e7d2318e429678640b
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-05 15:57:49 +02:00
Thomas Hartmann
0ea0c2f876 QmlDesigner.DesignDocument: simplifying the TextModifers
The TextModifers for the sub component and the document
are now assigned to the model. This simplfifies the code.

The member variables to the TextModifers are only kept for ownership.
The DesignDocument still owns the two TextModifers.

Change-Id: Idc84a2ba718666ce54683a67635a93352784dddd
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-08-01 13:20:02 +02:00
Marco Bubke
8143031599 QmlDesigner: Remove QmlModelView
And use NodeInstanceView directly. There is still more cleanup required
for the view handling.

Change-Id: I62417644ceefb25fb9f3bb93a894b71ae0929cb0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-07-31 16:21:20 +02:00
Marco Bubke
4b3e3aaa71 QmlDesigner: Remove operator from properties
To improve the readability of the source methods should be used.

Change-Id: I839e448369a03dc42b3649baed033daa20c4d49a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-07-31 11:12:52 +02:00
Marco Bubke
599b72a24a QmlDesigner: Use is valid functons instead of create a invalid node
Change-Id: I5f7cdcede593cdce2c577315ccead95e8841870e
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
2013-07-24 16:25:52 +02:00
Thomas Hartmann
ecb0470c30 QmlDesigner.DesignDocument: code cleanup
Change-Id: Ib71117cb5726662b4212f99a7c4136005273ae66
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-07-16 14:17:36 +02:00
Thomas Hartmann
3768e32f89 QmlDesigner.DesignDocument: getting rid of the magical StackedWidget
This StackedWidget is a leftover from the stand alone version.
In the context of Qt Creator this makes no sense anymore.

Change-Id: I6660dd4b43bdc12fa3329d333158fa759bee4d88
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-07-16 14:14:34 +02:00
Thomas Hartmann
a37fbaefa6 QmlDesigner: DesignDocument removing m_currentModel
We remove m_currentModel and replace it by currentModel().
If m_inFileComponentModel is nil the current model is the document
model, otherwise the current model is the inFileComponentModel.

No need to keep m_currentModel around explicitly.

Change-Id: I590e02dc03c2319cbf713b880cf43d740d64e942
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-07-16 13:57:25 +02:00
Eike Ziller
dd43d9908f Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.

Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 13:51:42 +02:00
Thomas Hartmann
0d92b468b7 QmlDesigner.DesignDocument: removing code called twice
This is already called in changeToSubComponentAndPushOnCrumblePath()

Change-Id: Ia101144cc33407b0c6268cf7c3717502211654c6
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-07-09 10:41:55 +02:00
Marco Bubke
f382197a5c QmlDesigner: Fix crash for in file component change
Change-Id: I666dd0ca2b7e50584ae2ad5577ec2f4c685fb209
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-06-19 12:43:38 +02:00
Eike Ziller
7c8db79817 Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
  IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
  instead
* Adapts the mode switching code in EditorManager to handle multiple
  windows, for example switching to edit mode should only happen if
  the editor/view is in the main window. Otherwise the editor window
  should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
  make the current editor visible by default, introducing
  DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
  used

One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.

Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-06-05 09:43:14 +02:00
Friedemann Kleint
ffbbf64e29 Clean headers in QML-Designer.
Ran script to remove inludes on a trial-and-error basis and
manually corrected it.

Change-Id: I8a2e9e35980198fc4162623db044c228bd209a0f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-04-30 14:09:58 +02:00
Friedemann Kleint
fdfb3cafcd Fix Krazy warnings about includes/header guards in QML designer.
Change-Id: I9adb43b9c9f2b2c97693ebb09ebef795d0206d1c
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-03-12 12:57:45 +01:00
Thomas Hartmann
ee4bf638ca QmlDesigner: Type of the propertyname is now PropertyName
And PropertyName is a typedef for QByteArray. Because we don't use the
features of QString and the source would be cluttered with QLatin1Strings
we changed the property name to QByteArray.

Change-Id: Ib70ef136bbc411504b450456bd9bb705ae93dd25
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-03-05 12:34:39 +01:00
Marco Bubke
e263417b91 QmlDesigner: Fix crash for creating a new project in the design mode
There is a hot fix, which is using a timer. This patch is using the
improved approach of testing if a document exists in the new project.

Change-Id: I16ac049c2cc4c0a21ab82fc854c8a062df037f55
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2013-02-20 17:37:37 +01:00
Marco Bubke
b3c63795bf QmlDesigner: Cleanup design document
Change-Id: Iba5a1ba44ec8dc9619eb8fcc93f8498c1d1f2f7f
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-12 12:53:29 +01:00
Marco Bubke
109669452f QmlDesigner: Use ScopedPointer instead of raw pointer
Change-Id: I2fb52fdb01c287fa1a4090b639f26521a3aabc6d
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-12 12:00:53 +01:00
Thomas Hartmann
a17f96d42a QmlDesigner: Fix crumble bar
Change-Id: I8eefba1b5b9839b28be5dbae379366714f40ed27
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-06 13:14:43 +01:00
Thomas Hartmann
a574edb312 QmlDesigner.DesignDocument: fixes delete and cut
For deleting Items we need a QmlModelView to delete
dangling property changes.
In the past we "missused" the FormEditorView.
For now VewManager will expose the form editor as
a QmlModelView.

I also cleaned some includes and removed debugs.

Task-number: QTCREATORBUG-8650
Change-Id: I22ca7c5f741324532e81918571be39babd12d2e4
Reviewed-by: Marco Bubke <marco.bubke@digia.com>
2013-02-05 16:08:25 +01:00
Marco Bubke
b0c9b26375 QmlDesigner: Rename function
Change-Id: I5f7ce747e112f2757a1d016b8a1cd9fb1d4f5827
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-05 15:19:37 +01:00
Marco Bubke
dc2b0c490f QmlDesigner: Fix crash for in document handling
Detach rewriter for document switching.

Change-Id: I4cc710990d01b30da25609961b81b07e785a26eb
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-04 16:01:23 +01:00
Thomas Hartmann
6956eb1d84 QmlDesigner: crash fix
The subcomponent manager populates the item library.
This means the ItemLibraryView has to be properly
initialized before we call m_subComponentManager->update().

I added a helper function and call it from activateAutoSynchronization(),
after all views have been attached.

Change-Id: Ie802f93c7d0a76b42160d4a92e8448e900380b71
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
2013-02-01 14:30:55 +01:00
Robert Loehning
a040424d2a Incremented year in copyright info
Change-Id: Ia11f4d7a94465de7f12cc390855e54e3256e5455
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-02-01 09:19:26 +01:00
Marco Bubke
1fda571654 QmlDesigner: Remvoe qDebug
Change-Id: Ie3803b6ea73fa41a4737987851fd5b695f5fe92a
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2013-01-24 15:24:59 +01:00
Marco Bubke
04db5c4479 QmlDesigner: Compile fix
Change-Id: I6e4a557ed1414a737a367ad1194a2e3608316ecc
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-01-23 15:45:13 +01:00
Marco Bubke
8d9710c074 Refactoring document handling
The document handling in the qml designer was complicated source
code, which was initially intended for a non creator application.
To integrate new views it has to be changed and cleaned up. This
is the first major step in that direction.

Change-Id: Ie26f0aad7a03946d18bdb4c0759b246c5439d922
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2013-01-23 14:53:28 +01:00