Post by Christian GagneraudPost by Eike ZillerPost by Szyk CechHi
What are advantages to have Core plugin over MainWindow?!?
I mean MainWindow class which handle whole app skeleton (located in main app exe module).
One reason for core plugin, from my point of view is that core plugin is shared object which can easily share its methods to other plugins - I think it is possible for exe (app exe module), but counter intuitive and cumbersome, and platform specific.
There are some more reasons for create Core plugin?
Handling it as just another plugin has the advantage that it uses the exact same startup, shutdown, building, linking, .... semantics as anything else. No need to invent something else :)
Really? like QtCreator's main() doesn't have special handling for the
core plugin...
Last time I checked, the core plugin was loaded explicitly and require
(lot of) hand-crafted initialisation. If Core plugin is "just" another
plugin, why it is not loaded as a result of being the root dependency
of every other plugins?
main() does not explicitly load the Core plugin, and does not do anything with the Core plugin except checking for its existence and that it loaded successfully after PluginManager::loadPlugins()
Yes, in that single way the Core plugin is special. But nevertheless the Core plugin is loaded because it is available in the plugin paths, not because of any special actions in main().
The special code in main() handles things that need to be done before creating a QApplication, or before using the PluginManager:
- setting up QSettings, since settings can also affect the plugin manager
- setting up plugin search paths
- setting application attributes that need to be set before creating a QApplication
- setting up translations
- passing command line arguments to an already running instance (instead of starting another instance) if -client is used
Post by Christian GagneraudI understand Eike's point of view, but I agree with Szyk, the 'Core'
plugin could very well be managed as a 'Core' Library.
We would need special handling for the “core” parts of Qt Creator of at least
- startup and shutdown
- delayed intialization
- versioning and checks if a plugin can be loaded for this version of Qt Creator
- command line arguments like “-color”, “-theme”, “-presentationMode”, and files to open
All this is done exactly like for any Qt Creator plugin.
Post by Christian GagneraudQtCreator will refuse to start without it. This IMHO contradicts the
very definition of a plugin.
Having say that, QtCreator is awesome, and it's even more awesome to
be able to study its source code (and criticise it! ;)), I believe
that many of us have learned a lot of things by studying it's
architecture, at least I did.
Thanks again.
Chris
PS: I remember reading some (old) slides that started with "QtCreator
is actually just a plugin loader" or something along these lines.
Post by Eike Ziller--
Eike Ziller
Principal Software Engineer
The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
http://qt.io <http://qt.io/>
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
_______________________________________________
Qt-creator mailing list
http://lists.qt-project.org/mailman/listinfo/qt-creator <http://lists.qt-project.org/mailman/listinfo/qt-creator>
--
Eike Ziller
Principal Software Engineer
The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
***@qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B