[Qt-creator] [request] Share some classes of QBS project manager plugin.

Denis Shienkov scapig2 at yandex.ru
Tue Jul 30 21:24:51 CEST 2013


Tobias,

> So let's hammer down the scope:
>
> Are we discussing a generic infrastructure in Qt Creator that can be
> used to define all possible optimization levels of the different
> supported compilers and then pass them on to the different build
> system supported by QtC
>
> --or--
>
> are we discussing how to set the optimization property from qbs?
>
> My understanding after your first mail was that we are talking about
> the first. Now I think we are talking about the second.

Most likely it is a talk about pair of QBS & qbsprojectmanager...

Because I mean not only display of "standard" names of options of 
optimization (which "hard coded" in QBS at present), but also about CXX, 
C, ASM and LINKER flags. I.e. it is more global and complex issue.


> You can also set them via the command line and via the "Properties"
> field in the build settings of Qt Creator.

Yes, of course.

In principle, has no value where to enter these options: or in command 
line, or in the file of the project or somewhere. The main problem that 
the user shall "advanced skills" and perfectly know options/flags of the 
compiler which uses.


> I agree that this is not the ideal UI for setting all the different
> properties. We should get a list of all properties defined in the
> project (and the modules used by it) from Qbs, together with the set
> of possible values.

Agree.

But the set of possible values we can store/contain in "database" of 
qbsprojectmanager plugin . IMHO, we not need  to query possible values 
from QBS, we need to query only present settings from the current 
project (from *.qbs file).

Then, in case of coincidence of the current parameters from the project 
with available in a DB of QtCreator we display them in UI as "used" [x]. 
Others available parameters from DB we display as "still not used/not 
selected".

In case of a choice of any available parameter (or in case of its reset) 
from GUI, this change updates directly the file of the project (*.qbs) 
(or when we click on some "Apply" button).

This decision (with DB use) will allow to display also the description 
for the selected option/flag.
(or at least not for all possible, but only for the main often used 
options).


> We will need a nice UI to change this data.

Agree. :)

I suggest to enter a certain entity/class like "OptionsDisplayer" (for 
qbsprojectmanajer) which would have the virtual method

...
QWidget *OptionsDisplayer::createWidget() const = 0
...


  implementation of which would depend on type of used toolchain.

Then we can derive this class for desired toolchain, e.g.:

...
GccOptionsDisplayer : public OptionsDisplayer
{
...
QWidget *createWidget() { // specific implementation for GCC }
}

MsvcOptionsDisplayer : public OptionsDisplayer
{
...
QWidget *createWidget() { // specific implementation for MSVC}
}

and etc.

Then, when the user will select from QtCreator for the current project:

"Projects->Build&Run->Toolchain->Build->build settings"

we can load appropriate object of OptionsDisplayer and show desired 
options widget.

PS: Yes, I know that at present in qbsprojectmanager isn't implemented 
yet a display/showing of used tollchain (e.g. as for qt4projectmanager 
plugin) . But on future it will be implemented (I hope) ?


> This will allow to set "qbs.optimization" to "fast" or "space" or whatever.

Not only it, but is possible also set and other options...


> It will _not_ allow to specify settings at the granularity shown in
> your screenshot: You can just show the settings of qbs, not the exact
> flags that will end up in the call to the compiler.

Granulation of optimization options which I provided - only for an 
example (btw I take an example from Code::Blocks - there granulation). I 
simply wanted to show a place in which where I plan to insert OptionsWidget.


PS: I simply curious to know: what do you (and others) think about idea 
to add UI for display (in user-friendly form) of options of the 
compiler/linker. For qbsprojectmanager plugin of QtCreator.


Best Regads,
Denis



More information about the Qt-creator mailing list