The dark side of .pro file
-
One thing that is strange is why are you calling qmake -project when trying to build one of the examples since they already have .pro files ?
@SGaist It was just one of N trials I did to solve the problem
-
Can you provide a link to that example ?
-
@SGaist said in The dark side of .pro file:
Can you provide a link to that example ?
I believe it's https://doc.qt.io/qt-5/qtdatavisualization-surface-example.html. I just tested it with Qt 5.15.2 and the *.pro file works fine.
-
@SGaist said in The dark side of .pro file:
Can you provide a link to that example ?
I believe it's https://doc.qt.io/qt-5/qtdatavisualization-surface-example.html. I just tested it with Qt 5.15.2 and the *.pro file works fine.
-
@SGaist said in The dark side of .pro file:
Can you provide a link to that example ?
I believe it's https://doc.qt.io/qt-5/qtdatavisualization-surface-example.html. I just tested it with Qt 5.15.2 and the *.pro file works fine.
@JKSH I am using Manjaro linux 64 bit xfce. When I select the "Surface example" a window pops-up asking is I want "copy and open" or "keep project and open". If I select "keep project and open", as next step I have to push "configure project" (I select Qt 5.10.1). Then the generated pro file is:
android|ios|winrt {
error( "This example is not supported for android, ios, or winrt." )
}!include( ../examples.pri ) {
error( "Couldn't find the examples.pri file!" )
}SOURCES += main.cpp
surfacegraph.cppHEADERS += surfacegraph.h
QT += widgets
requires(qtConfig(combobox))RESOURCES += surface.qrc
OTHER_FILES += doc/src/*
doc/images/*Of course that is the end of the experience. The same happen in the other choice. Maybe there is some error in my linux distro.
-
So my idea was correct, you are missing the examples.pri file.
Don't you have the warning shown when building the project ?
-
I find the issue "/example.pri" only in the choice "copy and open". I solved by manually copying that file, but the pro file remained unchanged and one again the experience end
-
I find the issue "/example.pri" only in the choice "copy and open". I solved by manually copying that file, but the pro file remained unchanged and one again the experience end
@MMonty1960 said in The dark side of .pro file:
but the pro file remained unchanged and one again the experience end
The pro file should remain unchanged since it is correct.
What do you mean "the experience end"? What happens when you use Qt Creator to build and run the project?
-
@MMonty1960 said in The dark side of .pro file:
but the pro file remained unchanged and one again the experience end
The pro file should remain unchanged since it is correct.
What do you mean "the experience end"? What happens when you use Qt Creator to build and run the project?
@JKSH The pro file is not correct because is missing for QT+=datavisualization so compilation fails.
Now I know the solution, thus if I add manually that line the compilation runs correctly.
In any case I would like to thank both SGaist and JKSH because I learned a lot by your answers. Many thanks!!!! -
@MMonty1960 said in The dark side of .pro file:
The pro file is not correct because is missing for QT+=datavisualization so compilation fails.
As @SGaist already told you examples.pri contains more stuff. When you take a look into it you will notice a 'QT += datavisualization' line so the pro file is correct.
-
@JKSH The pro file is not correct because is missing for QT+=datavisualization so compilation fails.
Now I know the solution, thus if I add manually that line the compilation runs correctly.
In any case I would like to thank both SGaist and JKSH because I learned a lot by your answers. Many thanks!!!!@MMonty1960 said in The dark side of .pro file:
@JKSH The pro file is not correct because is missing for QT+=datavisualization so compilation fails.
The pro file is correct. You just need to make sure that examples.pri is in the folder above surfaces.pro so that
QT += datavisualizationis included viainclude(../examples.pri). You don't need to modify surfaces.pro.But anyway, you have highlighted a weakness in the way examples are loaded so I opened a bug report: https://bugreports.qt.io/browse/QTCREATORBUG-25191
-
@MMonty1960 said in The dark side of .pro file:
@JKSH The pro file is not correct because is missing for QT+=datavisualization so compilation fails.
The pro file is correct. You just need to make sure that examples.pri is in the folder above surfaces.pro so that
QT += datavisualizationis included viainclude(../examples.pri). You don't need to modify surfaces.pro.But anyway, you have highlighted a weakness in the way examples are loaded so I opened a bug report: https://bugreports.qt.io/browse/QTCREATORBUG-25191
@JKSH Of course I copied example.pri in the folder above surface.pro, but there is no effect on the pro file and compilation crashed. Maybe the reason is that the pro file is composed before I applied the correction and after that is not more refreshed. In any case I failed to compile and run the example.
-
@JKSH Of course I copied example.pri in the folder above surface.pro, but there is no effect on the pro file and compilation crashed. Maybe the reason is that the pro file is composed before I applied the correction and after that is not more refreshed. In any case I failed to compile and run the example.
@MMonty1960 said in The dark side of .pro file:
Maybe the reason is that the pro file is composed before I applied the correction and after that is not more refreshed.
Yes, you're right. You can force a refresh by clicking Build > Run qmake. That should let you compile and run the example.