[Qt-creator] Help with plugins

Jochen Becher jochen_becher at gmx.de
Tue Oct 29 22:27:33 CET 2013


Thank you for the clear answers. I didn't know that the Design mode
supports adding more editors than the Widget and Qml designers. My
plugin is a simple modeling tool (no a full featured UML tool but
something that will help us documenting our software). Fits perfectly
into the Design metaphor so I will changed the plugin to use the Design
mode.

Regards, Jochen

Before you ask: yes, I plan to publish it under GPL later.


Am Dienstag, den 29.10.2013, 09:01 +0000 schrieb Ziller Eike:
> On Oct 28, 2013, at 7:30 PM, Jochen Becher <jochen_becher at gmx.de> wrote:
> 
> > Hi,
> > 
> > I am working on a complex plug-in which introduces a new mode for files
> > of a certain mime type.
> 
> Actually, 
> I suppose you want a mode instead of actually implementing an IEditor for that mime type because we want all available screen real estate?
> 
> If the "Design" metaphor would work at all for that "editor" mode, you might want to actually implement a design widget for that mime type for Design mode, instead of adding your own mode. We are usually trying to avoid the addition of modes, each and everyone is hotly discussed (already the "Design" mode is questionable, but the result of the editor manager not having any concept of editors that require "full screen").
> 
> See Core::DesignMode and its uses for the .ui designer and Qt Quick designer.
> 
> > I have some questions about implementing a few
> > features and I hope you can give me some links to source code files
> > where I can copy the behavior:
> > 
> > 1. When I open document of my mime type the file is usually opened in
> > Edit mode. Currently I show a simple "switch to the correct mode" label
> > because the file cannot be edited here (it is an xml format that makes
> > no sense to edit it manually). In Edit mode I can save the file (when it
> > has been changed used the new mode) or select "Save All" and some other
> > menu items. As soon as i switch to the new mode "Save" and "Save All"
> > are disabled. How do I have to set the right context to enable these
> > items in the new mode as well?
> > 
> > 2. What is the preferred way to switch to a new mode after opening the
> > document? Directly switch to the mode from the document's open() method
> > using the ModeManager does not work. I tried to make it asynchronous
> > using a signal from the document's open() method with
> > Qt::QuededConnection. This works better but it behaves in an unexpected
> > way. Isn't there a signal like "FileWasOpened" where I can connect to?
> > 
> > 3. How can I save the layout of the mode's main window or other dialogs?
> > Is there an official way to save such settings (properties of
> > MiniSplitter etc)?
> > 
> > Regards, Jochen
> > 
> > 
> > _______________________________________________
> > Qt-creator mailing list
> > Qt-creator at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/qt-creator
> 





More information about the Qt-creator mailing list