[Qt-creator] Custom wizard vs qmake's wizards

Christian Gagneraud chgans at gmail.com
Tue Apr 30 02:02:24 CEST 2019


On Mon, 29 Apr 2019 at 21:50, Eike Ziller <Eike.Ziller at qt.io> wrote:
> > On 29. Apr 2019, at 09:43, 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),
>
> Calling setVisible instead of setEnabled for these actions would of course be possible, but it would probably be better to try and not duplicate all the work.

I think that was the wrong track, i should ignore all these "Qt4" qmake things.
This "Add Library" is to add a dependency, and at this stage, i can
manage that manually.
I just want helpers that would create qbs skeleton code for a
"composite" project.
I wrote a "Qbs Subdir Project" custom wizard, I now just need to be
able to chain that.

> >> 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...
>
> That might be the way to go, but I also can’t really tell how much work that would be. E.g. would it make sense to share (parts of) the actual wizard?

AFAIU, it should be managed in the ProjectExplorer::ProjectNode implementation.
https://github.com/qt-creator/qt-creator/blob/master/src/plugins/projectexplorer/projectnodes.h#L63
https://github.com/qt-creator/qt-creator/blob/master/src/plugins/projectexplorer/projectnodes.h#L326

It is hooked up on the context menu "New Subproject...". "Add new..."
is already supported by qbs project manager, ...

The difficulty is to add support for editing the "references" property
of a Project item:
https://github.com/qbs/qbs/blob/master/src/lib/corelib/api/project.h#L159

I quickly hacked the QtCreator side (easiest part), and added stubs to
the Qbs API. the "New subproject..." is now enabled and gives me the
"New project" wizard, it seems that the list of available "Custom
Wizard" based items is filtered by "supported build system", this is
pretty cool so far. I can even see my custom "Qbs Subdir Project"
wizard.

Christian, any thoughts on adding this capability to Qbs core API? How
hard is it to handle adding/removing references?
Given https://github.com/qbs/qbs/blob/master/src/lib/corelib/api/project.cpp#L496,
this doesn't look trivial to me, but shouldn't be that hard for
someone who knows the internals very well... ;)

Chris

Attached are a diff for Qtc that just enable the feature and forward
stuff to Qbs API and another one for Qbs that just add stubs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qbs-add-support-for-updating-project-references.patch
Type: text/x-patch
Size: 4370 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20190430/83f7685e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qtc-add-support-for-subproject-to-qbs.patch
Type: text/x-patch
Size: 4618 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20190430/83f7685e/attachment-0003.bin>


More information about the Qt-creator mailing list