[Qt-creator] Help with plugins
Ziller Eike
Eike.Ziller at digia.com
Tue Oct 29 10:01:21 CET 2013
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
--
Eike Ziller, Senior Software Engineer - Digia, Qt
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
More information about the Qt-creator
mailing list