Re: [Interest] QMake contains and include

2020-05-22 Thread Jérôme Godbout
The filter make it slightly better, still see the .pri and those part clear, I 
still have to dig them to see if they are used. I would love to see the .pri 
and folder grey out if nothing is used into it.
Thanks for the info all.

-Original Message-
From: Interest  On Behalf Of Christian Kandeler
Sent: May 22, 2020 3:34 AM
To: interest@qt-project.org
Subject: Re: [Interest] QMake contains and include

On Thu, 21 May 2020 13:35:08 +
Jérôme Godbout  wrote:

> It would be nice to see the .pri grey out or something more obvious. Or even 
> better an option to show/hide them.

The project tree filter has an option "Hide disabled files".


Christian
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-22 Thread Christian Kandeler
On Wed, 20 May 2020 18:44:19 -0700
Thiago Macieira  wrote:

> The Qt Creator ProParser code has some different error recovery mechanisms 
> than qmake. Obviously it's going to be non-fatal to interact with a 
> repository 
> that is missing. It will also not run $$system() and do some other things 
> that 
> qmake would.

Actually, it does run system(), in order to provide correct project information 
for constructs such as
   system(...): SOURCES += ...


Christian
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-22 Thread Christian Kandeler
On Thu, 21 May 2020 13:35:08 +
Jérôme Godbout  wrote:

> It would be nice to see the .pri grey out or something more obvious. Or even 
> better an option to show/hide them.

The project tree filter has an option "Hide disabled files".


Christian
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-21 Thread Jérôme Godbout
I understand your point, but I would love to see a different UX for non include 
.pri to be quickly different from the one included (now I have to dig to the 
resources, headers or sources to see the difference). It would be nice to see 
the .pri grey out or something more obvious. Or even better an option to 
show/hide them.

-Original Message-
From: André Pönitz  
Sent: May 21, 2020 12:02 AM
To: Jérôme Godbout 
Cc: gm...@ratijas.tk; interest@qt-project.org
Subject: Re: [Interest] QMake contains and include

On Wed, May 20, 2020 at 04:30:41PM +, Jérôme Godbout wrote:
>It kinda work, it’s really weird, but all the project get display, the
>.pri and the include/source no matter the condition, but they are grey
>out if the include condition is false, so it does scan the .pri no
>matter what but doesn’t really include them to be used only for
>display!?! So I got all the optional part display but not really used.
>The compile seem to work. This leave an horrible UX view for developer
>to see part that aren’t used but source is display and searchable for
>the project!
> 
> 
>I think I can live with it but this is an horrible UX to display those
>include no matter the condition that include them or not, here what it
>does (image in attachment) with:

I guess you also would prefer refactorings, searches for occurences of symbols 
and translatable strings not to happen in branches of your project that are 
currently not active.

That's not the case for everybody.

Andre'
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-21 Thread Jérôme Godbout
Thanks Thiago, it clear up. It does make more sense to me now.

My use case is my projects use a subrepository that have a core code mandatory 
and some optional parts. Many projects use that subrepos and inlclude or not 
the optional part based on the application need. It look like this:

MyApp1.pro
MySubreposMandatory.pri
MySubreposOption1.pri (included)
MySubreposOption2.pri (not inlcuded)

MyApp2.pro
MySubreposMandatory.pri
MySubreposOption1.pri (included)
MySubreposOption2.pri (inlcuded)

This is a simpler use case but this is how we do reuse many code part between 
our applications with generic code. When I'm doing app2 it make sens to edit 
the  Option2, but when I do work in app1 I do not use the option2, I won't edit 
it. It ain't that bad, I was more confuse about that behavior. 

This is only my own opinion on the behavior:

Pro:
-I can see the available options project that I can include in my applications
-Search also fetch code from unused parts (replace API less chance to forget a 
code into optional part)

Cons:
-Clutter the UI with unsued parts and confuse my junior dev about what is used 
into the projects. We have to open the module and look if the source is grey 
out or not to known if that module is used into the application or look 
directly into the .pro
-Search also fetch code from unused parts (unwanted used code into application)

I do something like this into my app to easily add or remove stuff from it:


// MyApp.pro
AMOTUS_SUBREPOS_NAMES = Amotus_CPP Amotus_Qt Amotus_Qml Amotus_Style
AMOTUS_SUBREPOS_OPTIONAL_NAMES = i18n Amotus_Qt_FileSystem Amotus_Qt_OAuth 
Amotus_Qt_Network Amotus_Qt_Bluetooth Amotus_Qt_GUI 

for(a, AMOTUS_SUBREPOS_NAMES){
!include($${AMOTUS_SUBREPOS_PATH}/$${a}/pri/$${a}.pri){
error(Cannot find the sub repos 
$${AMOTUS_SUBREPOS_PATH}/$${a}/pri/$${a}.pri)
}
}


// Amotus_Qt.pri
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n){
include(i18n.pri)
HEADERS += $$AMOTUS_Qt_PATH/i18n.h
SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
}
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_FileSystem){
include(Amotus_Qt_FileSystem.pri)
}
...

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: May 20, 2020 9:44 PM
To: interest@qt-project.org
Subject: Re: [Interest] QMake contains and include

On Wednesday, 20 May 2020 10:39:50 PDT Jérôme Godbout wrote:
> If I may, why I want that in QtCreator exactly? what is the use case 
> for this? If my project doesn't use a part, why is it parsed at all? 
> What will happen if that unused .pri make a failure for something 
> missing? Will it failed to load the project and stop? let's say I have 
> an option that require an interaction with another subrepos, one 
> project might not need that part and not have it checkout, the .pri 
> that interact with it would not be include, how would QtCreator react to this?

Are those two source files not part of your project? If they are, then they 
should be included in the file listing. I assume you sometimes edit them.

The Qt Creator ProParser code has some different error recovery mechanisms than 
qmake. Obviously it's going to be non-fatal to interact with a repository that 
is missing. It will also not run $$system() and do some other things that qmake 
would.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread André Pönitz
On Wed, May 20, 2020 at 04:30:41PM +, Jérôme Godbout wrote:
>It kinda work, it’s really weird, but all the project get display, the
>.pri and the include/source no matter the condition, but they are grey
>out if the include condition is false, so it does scan the .pri no
>matter what but doesn’t really include them to be used only for
>display!?! So I got all the optional part display but not really used.
>The compile seem to work. This leave an horrible UX view for developer
>to see part that aren’t used but source is display and searchable for
>the project!
> 
> 
>I think I can live with it but this is an horrible UX to display those
>include no matter the condition that include them or not, here what it
>does (image in attachment) with:

I guess you also would prefer refactorings, searches for occurences of
symbols and translatable strings not to happen in branches of your
project that are currently not active.

That's not the case for everybody.

Andre'
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread Thiago Macieira
On Wednesday, 20 May 2020 10:39:50 PDT Jérôme Godbout wrote:
> If I may, why I want that in QtCreator exactly? what is the use case for
> this? If my project doesn't use a part, why is it parsed at all? What will
> happen if that unused .pri make a failure for something missing? Will it
> failed to load the project and stop? let's say I have an option that
> require an interaction with another subrepos, one project might not need
> that part and not have it checkout, the .pri that interact with it would
> not be include, how would QtCreator react to this?

Are those two source files not part of your project? If they are, then they 
should be included in the file listing. I assume you sometimes edit them.

The Qt Creator ProParser code has some different error recovery mechanisms 
than qmake. Obviously it's going to be non-fatal to interact with a repository 
that is missing. It will also not run $$system() and do some other things that 
qmake would.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread Jérôme Godbout
Sorry about that, yeah it's QtCreator, I figure out it was displaying the 
unused .pri along all the file inclusion of it. At first I was thinking it was 
including the .pri straight since I could see it, then I realized the source, 
headers and resources files was gray out, which seem to indicate it won't be 
used. The compiler seem to do the right thing. It was very confusing to see the 
non included .pri showing up along their content.

If I may, why I want that in QtCreator exactly? what is the use case for this? 
If my project doesn't use a part, why is it parsed at all? What will happen if 
that unused .pri make a failure for something missing? Will it failed to load 
the project and stop? let's say I have an option that require an interaction 
with another subrepos, one project might not need that part and not have it 
checkout, the .pri that interact with it would not be include, how would 
QtCreator react to this?

Thanks,

-Original Message-
From: Interest  On Behalf Of Thiago Macieira
Sent: May 20, 2020 1:23 PM
To: interest@qt-project.org
Subject: Re: [Interest] QMake contains and include

On Wednesday, 20 May 2020 09:30:41 PDT Jérôme Godbout wrote:
> It kinda work, it’s really weird, but all the project get display, the 
> .pri and the include/source no matter the condition, but they are grey 
> out if the include condition is false, so it does scan the .pri no 
> matter what but doesn’t really include them to be used only for 
> display!?! So I got all the optional part display but not really used. 
> The compile seem to work. This leave an horrible UX view for developer 
> to see part that aren’t used but source is display and searchable for the 
> project!

Are you talking about qmake or about Qt Creator's .pro file parsing?

Qt Creator evaluates all conditions, including false ones, so it can gather all 
dependencies and all possibilities. For example, if you had:

contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n): \
SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
else: \
SOURCES += $$AMOTUS_Qt_PATH/no-i18n.cpp

Then Qt Creator should display both files in your file listing. You *want* that.

But qmake will follow only one code path when generating your Makefile.

So please be precise: are you talking about Qt Creator or are you talking about 
the actual build?
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread Thiago Macieira
On Wednesday, 20 May 2020 09:30:41 PDT Jérôme Godbout wrote:
> It kinda work, it’s really weird, but all the project get display, the .pri
> and the include/source no matter the condition, but they are grey out if
> the include condition is false, so it does scan the .pri no matter what but
> doesn’t really include them to be used only for display!?! So I got all the
> optional part display but not really used. The compile seem to work. This
> leave an horrible UX view for developer to see part that aren’t used but
> source is display and searchable for the project!

Are you talking about qmake or about Qt Creator's .pro file parsing?

Qt Creator evaluates all conditions, including false ones, so it can gather 
all dependencies and all possibilities. For example, if you had:

contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n): \
SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
else: \
SOURCES += $$AMOTUS_Qt_PATH/no-i18n.cpp

Then Qt Creator should display both files in your file listing. You *want* 
that.

But qmake will follow only one code path when generating your Makefile.

So please be precise: are you talking about Qt Creator or are you talking 
about the actual build?
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread Jérôme Godbout
It kinda work, it’s really weird, but all the project get display, the .pri and 
the include/source no matter the condition, but they are grey out if the 
include condition is false, so it does scan the .pri no matter what but doesn’t 
really include them to be used only for display!?! So I got all the optional 
part display but not really used. The compile seem to work. This leave an 
horrible UX view for developer to see part that aren’t used but source is 
display and searchable for the project!

I think I can live with it but this is an horrible UX to display those include 
no matter the condition that include them or not, here what it does (image in 
attachment) with:
if(true) {
include(Amotus_Qt_GUI.pri)
}
if(false){
include(Amotus_Qt_Commands.pri)
}


From: gm...@ratijas.tk 
Sent: May 20, 2020 11:41 AM
To: Jérôme Godbout ; interest@qt-project.org
Subject: Re: [Interest] QMake contains and include

qmake is strange, it implements custom syntax and grammar. Don't search for any 
deep logic there. It will be superseded by CMake soon anyway.

About your issue, I looked it up on DuckDuckGo, and the first result is the 
discussion on StackOverflow which looks like it:
https://stackoverflow.com/questions/46078270/qmake-scope-syntax-with-contains-function

Hope that helps somehow~

20.05.2020, 18:29, "Jérôme Godbout" 
mailto:godbo...@amotus.ca>>:

Sorry for the noise, but I did found a way simpler example to test this:



if(false){

  message(“Pass here”)

  include(“myfile.pri”)

}



myfile.pri is always included no matter what, but the message is not printed! 
this is really counter intuitive. Any way to make a conditional include?!?





From: Interest 
mailto:interest-boun...@qt-project.org>> On 
Behalf Of Jérôme Godbout
Sent: May 20, 2020 11:17 AM
To: interest@qt-project.org<mailto:interest@qt-project.org>
Subject: [Interest] QMake contains and include



Hi,

QMAKE question: anybody manage to use an include inside a contains(){} into 
QMake? the include is processed no matter what!?!

message("list: '$$AMOTUS_SUBREPOS_OPTIONAL_NAMES' ")
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n){
message("Using i18n...")
HEADERS += $$AMOTUS_Qt_PATH/i18n.h
SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
include(i18n.pri)
}contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_Network){
message("Using Amotus_Qt_Network...")
include(Amotus_Qt_Network.pri)
}

If I put AMOTUS_SUBREPOS_OPTIONAL_NAMES = i18n
The message print:

Project MESSAGE: list: 'i18n'
Project MESSAGE: Using i18n...

The message is correct. But I get both the i18n.pri and the 
Amotus_Qt_Network.pri include anyway!? if I remove the i18n entry from the 
variable AMOTUS_SUBREPOS_OPTIONAL_NAMES =
I get the following:

Project MESSAGE: list: ''

The include for i18n.pri and Amotus_Qt_Network.pri are still included, but the 
i18n.h and i18n.cpp are grey out which seem to work for HEADERS and SOURCES but 
not include!?! is include special or parsed without any consideration of the 
scope?! I did try to close QtCreator and reopen without luck (using QtCreator 
4.12.0 on Mac OS)


,

___
Interest mailing list
Interest@qt-project.org<mailto:Interest@qt-project.org>
https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread gmail
qmake is strange, it implements custom syntax and grammar. Don't search for any deep logic there. It will be superseded by CMake soon anyway. About your issue, I looked it up on DuckDuckGo, and the first result is the discussion on StackOverflow which looks like it:https://stackoverflow.com/questions/46078270/qmake-scope-syntax-with-contains-function Hope that helps somehow~ 20.05.2020, 18:29, "Jérôme Godbout" :Sorry for the noise, but I did found a way simpler example to test this: if(false){  message(“Pass here”)  include(“myfile.pri”)} myfile.pri is always included no matter what, but the message is not printed! this is really counter intuitive. Any way to make a conditional include?!?  From: Interest  On Behalf Of Jérôme GodboutSent: May 20, 2020 11:17 AMTo: interest@qt-project.orgSubject: [Interest] QMake contains and include Hi,QMAKE question: anybody manage to use an include inside a contains(){} into QMake? the include is processed no matter what!?!message("list: '$$AMOTUS_SUBREPOS_OPTIONAL_NAMES' ")contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n){    message("Using i18n...")    HEADERS += $$AMOTUS_Qt_PATH/i18n.h    SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp    include(i18n.pri)}contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_Network){    message("Using Amotus_Qt_Network...")    include(Amotus_Qt_Network.pri)}If I put AMOTUS_SUBREPOS_OPTIONAL_NAMES = i18nThe message print:Project MESSAGE: list: 'i18n'Project MESSAGE: Using i18n...The message is correct. But I get both the i18n.pri and the Amotus_Qt_Network.pri include anyway!? if I remove the i18n entry from the variable AMOTUS_SUBREPOS_OPTIONAL_NAMES =I get the following:Project MESSAGE: list: '' The include for i18n.pri and Amotus_Qt_Network.pri are still included, but the i18n.h and i18n.cpp are grey out which seem to work for HEADERS and SOURCES but not include!?! is include special or parsed without any consideration of the scope?! I did try to close QtCreator and reopen without luck (using QtCreator 4.12.0 on Mac OS) ,___Interest mailing listInterest@qt-project.orghttps://lists.qt-project.org/listinfo/interest___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] QMake contains and include

2020-05-20 Thread Jérôme Godbout
Sorry for the noise, but I did found a way simpler example to test this:

if(false){
  message("Pass here")
  include("myfile.pri")
}

myfile.pri is always included no matter what, but the message is not printed! 
this is really counter intuitive. Any way to make a conditional include?!?


From: Interest  On Behalf Of Jérôme Godbout
Sent: May 20, 2020 11:17 AM
To: interest@qt-project.org
Subject: [Interest] QMake contains and include

Hi,
QMAKE question: anybody manage to use an include inside a contains(){} into 
QMake? the include is processed no matter what!?!
message("list: '$$AMOTUS_SUBREPOS_OPTIONAL_NAMES' ")
contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, i18n){
message("Using i18n...")
HEADERS += $$AMOTUS_Qt_PATH/i18n.h
SOURCES += $$AMOTUS_Qt_PATH/i18n.cpp
include(i18n.pri)
}contains(AMOTUS_SUBREPOS_OPTIONAL_NAMES, Amotus_Qt_Network){
message("Using Amotus_Qt_Network...")
include(Amotus_Qt_Network.pri)
}
If I put AMOTUS_SUBREPOS_OPTIONAL_NAMES = i18n
The message print:
Project MESSAGE: list: 'i18n'
Project MESSAGE: Using i18n...
The message is correct. But I get both the i18n.pri and the 
Amotus_Qt_Network.pri include anyway!? if I remove the i18n entry from the 
variable AMOTUS_SUBREPOS_OPTIONAL_NAMES =
I get the following:
Project MESSAGE: list: ''
The include for i18n.pri and Amotus_Qt_Network.pri are still included, but the 
i18n.h and i18n.cpp are grey out which seem to work for HEADERS and SOURCES but 
not include!?! is include special or parsed without any consideration of the 
scope?! I did try to close QtCreator and reopen without luck (using QtCreator 
4.12.0 on Mac OS)

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest