[Qt-creator] Custom wizard vs qmake's wizards
Christian Gagneraud
chgans at gmail.com
Mon Apr 29 10:57:57 CEST 2019
On Mon, 29 Apr 2019 at 19:44, Christian Kandeler
<Christian.Kandeler at qt.io> wrote:
>
> On Mon, 29 Apr 2019 18:34:09 +1200
> Christian Gagneraud <chgans at gmail.com> wrote:
>
> > > If I register a new "Qbs.AddLibrary" action, i end up with duplicates
> > > in the context menu (qmake disabled, and qbs enabled), if instead if
> > > fetch the "Qt4.AddLibrary" and enable it, i get the (qmake) "Add
> > > library wizard", but when i go till the end of the wizard i get qmake
> > > stuff added to my qbs project file ... (that was funny, i expected a
> > > crash or something :))
> > >
> >
> > Actually, I just saw the supportsAction in the project node. That's a good
> > start. But there doesn't seem to be anything generic to handle adding
> > library, etc....
> > Maybe it's not hard to add, maybe not...
>
> I'll let people more knowledgeable about wizards answer the main question, but to provide some context:
> Keep in mind that Qt Creator started with only qmake support, and things were generalized one by one "on demand". What you are seeing here is something that's probably still in the original state.
Yes, I get that, and it's good to see things moving in the right direction.
> Note also that "New Subproject..." is quite weird these days because it only exists for qmake, yet most of the wizards that pop up let you choose the build system for the sub-project, which makes no sense. (Ok, in theory you could mix build systems, but let's not get too silly.)
True, i was thinking in the bus, what about adding a Qbs only entry to
the project pane context menu, like "Add a new Qbs Item...".
This would yield to a wizard alike of "add a new C++ class". Item type
being a list of the Qbs convenience items (and later on, with
possibility for custom item).
I like the generic (qbs-wise) approach, but there would be a need to
filter out the choice list (eg, cannot add a product to a product,
...)
Maybe the parameter action could help here (not familiar with that code).
Thinking loud really.
My use case is simple and easy to understand: right now if i start a
project from scratch, i need to create all the initial qbs skeletons
(just Project/Product w/ references). Then i can open the top qbs file
and start customising the whole thing, by editing Qbs files from
within QtC and use add new, add existing, ... I'm really after
something simple, just to bootstrap a "complex" project without having
to fire emacs.
I have virtually no use of the "Create an app/lib/whatever project",
most of the time, i want to create a "composite" project, with a
layout to my tastes (eg. w/ apps, libs, plugins, tests).
Would you accept a new "Subdirs Project" custom wizard template? It's
really just a few lines of json, along with "Project{}" as a qbs
template. Then i would have to check how to handle adding subprojects
and products.
I haven't figure out the Qbs file parser/writer, maybe that is the
blocking point, but QtC can already edit the files property of a
product, i have hope to find code that can do more than that.
Chris
More information about the Qt-creator
mailing list