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

Denis Shienkov scapig2 at yandex.ru
Tue Jul 30 17:12:04 CEST 2013


Thx, Tobias to your answer..

> Optimization settings should in my opinion be handled by Qbs. In fact it
> has settings in the cpp module for exactly that.

Yes. Of course from QBS. 

I simply want to add UI for display/change of parameters of the compiler/linker from *.qbs of the file of the current project.
In order that their appointment was clear to the user.

In principle yes, it is clear that I can edit these flags manually directly in *.qbs project file (as in *.pro for qmake) - but it 
IMHO isn't norm and not always (not for all) convenient! :)

In all others IDE's (Visual Studio, Code::Blocks and etc) is available opportunity to set build settings by means of UI and store its.


> I do not think that is the right approach: Those flags are compiler
> specific. Where do you get the options and their descriptions from (-Ox
> is gcc specific, MSVC uses something different IIRC)? Hardcoding values
> into creator makes no sense IMHO.


Yes, agree. These parameters depend on the current Toolchain.

But we can do in the project file rules of optimizations for each used toolchain like (pseudo code):

{
    Toolchain: MSVC
    Optimization: none (fast, debug) - common for QBS
    CxxFlags: /x /y /z (MSVC specific, misc)
    LinkerFlags: /a /b /c (MSVC specific, misc)
}

{
    Toolchain: GCC
    Optimization: none (fast, debug) - common for QBS
    CxxFlags: -x -y -z (GCC specific, misc)
    LinkerFlags: -a -b -c (GCC specific, misc)
}

Thus, it is possible to make a plug-in which parse the project and displays these options in QtCreator UI. 

More precisely, of course, do parsing is QBS himself. QtCrearot's plug-in only takes from the QBS a "raw" parsed build properties for current toolchain, 
interprets them and displays in UI. Perhaps even show hints for displayed properties :).

I.e. plugin should contain some database of build flags, depends on type of toolchain.

In principle, the Toolchains types quantity not so is a lot (MSVC, GCC, MINGW ..), and all their flags are known.
And for MCU development - it is even less: GCC, KEIL, IAR.

Unknown flags can be displayed "as is" to the "misc" element of the UI, e.g. in some line edit, text edit..

Thus, it is possible to try to make some plug-in for edit, display and interpretation of build settings (build flags)...


> Having a UI to set the qbs optimization setting (along with the other
> properties) is something I do want to see.

Yes, approximately I also speak about it. Only I preferred that this feature was flexible for customization of display of flags/settings 
for some specific toolchains (e.g. Keil, IAR).

For this opportunity, into QtCreator it is possible to enter a new class translator-interpreter-manager API with abstract factories for 
everyone toolchains, or like something this...

Into tasks of this object will enter only:

* getting build settings from project through QBS API (for desired toolchain)
* interpret settings to user-friendly form
* display settings into some UI
* possibility to edit settings from UI and store to project file through QBS API
* if project file has no build settings, then display default values


> Maybe you could define those optimization levels on the toolchains
> directly and offer only a combobox to select between the optimizations a
> tool chain offers? That still leaves the problem of making sure those
> flags will take effect in the different build systems.

I am not sure. 
And that if I use one and the same Toolchain for two projects at same time, but each of projects used different "build settings/flags". 
What then to do?


Best regards,
Denis





30.07.2013, 17:31, "Tobias Hunger" <tobias.hunger at digia.com>:
> On 30.07.2013 12:34, Denis Shienkov wrote:
>
>>  Hello QtCreator developers..
>>
>>  Whether it is planned to make available (through QBSPROJECTMANAGER_EXPORT) some classes of qbsprojectmanager plug-in?
>
> The usual approach is to keep things private till somebody needs them.
>
>>  For me interests access to classes qbsbuildconfiguration and qbsbuildconfigurationwidget. I would like to provide opportunity to insert into a page
>>  of "build settings" of the project a widget with the user-friendly display of used flags of an optimisations and so forth etc.
>
> Optimization settings should in my opinion be handled by Qbs. In fact it
> has settings in the cpp module for exactly that.
>
>>  I.e. something like this:
>>
>>  http://postimg.org/image/p157151fl/
>
> I do not think that is the right approach: Those flags are compiler
> specific. Where do you get the options and their descriptions from (-Ox
> is gcc specific, MSVC uses something different IIRC)? Hardcoding values
> into creator makes no sense IMHO.
>
> Having a UI to set the qbs optimization setting (along with the other
> properties) is something I do want to see.
>
>>  PS: I have thoughts to create a certain plug-in for QtCreator for embedded MCU projects (like as Keil, IAR, CooCox, etc IDE's.)
>>  And for this specifics it is desirable to have the user-friendly set of a tabs with display of settings of the compiler, etc
>>  (because it is so accepted and it is habitual way for a embedded MCU's developers).
>
> How those settings are applied depends a lot on the build system. I am
> not sure it makes sense to put those into the build settings in the
> first place.
>
> Maybe you could define those optimization levels on the toolchains
> directly and offer only a combobox to select between the optimizations a
> tool chain offers? That still leaves the problem of making sure those
> flags will take effect in the different build systems.
>
>>  Or, maybe, I am mistaken and exist other way to make it?
>
> If this is something qbs specific, then you can always implement it as
> part of the qbs plugin:-)
>
> Best Regards,
> Tobias
>
> --
> Tobias Hunger, 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. USt-IdNr: DE 286 306 868
> Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list