Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Creator does not see examples; also can't build them, because of permissions.



  • I built Qt 5.15.0 and Qt Creator 4.13.0-beta1 (although I didn't know that I was building the beta), and I seem to have most things linked up. But Qt Creator doesn't see the examples, which are installed (per default) in /usr/local/Qt-5.15.0/examples.

    If I navigate there and open an example explicitly, I can't build it because of this:

    /usr/local/Qt-5.15.0/mkspecs/features/mac/sdk.prf:60: error: Cannot write cache file /usr/local/Qt-5.15.0/examples/serialport/enumerator/.qmake.stash: Permission denied

    This is under Mac OS 10.15.5.


  • Moderators

    @Stokestack said in Qt Creator does not see examples; also can't build them, because of permissions.:

    If I navigate there and open an example explicitly, I can't build it because of this:

    /usr/local/Qt-5.15.0/mkspecs/features/mac/sdk.prf:60: error: Cannot write cache file /usr/local/Qt-5.15.0/examples/serialport/enumerator/.qmake.stash: Permission denied

    Check if you have write permissions for /usr/local/Qt-5.15.0/examples/ and all its subdirectories.



  • Thanks for the reply.

    Undoubtedly I don't, but this raises the question: What is the expected user experience here? This is the default installation directory, so it seems that it would always present the same problem.

    And there's still the question of why Creator doesn't see the examples...


  • Moderators

    @Stokestack said in Qt Creator does not see examples; also can't build them, because of permissions.:

    And there's still the question of why Creator doesn't see the examples...

    Qt Creator needs to be told where to find your compiler and your Qt version(s).

    If you use the official installer, the installer sets this up for you. If you build from source, you set it up manually:

    (Simplistically, a "Kit" is a Qt version + a compiler)

    What is the expected user experience here? This is the default installation directory, so it seems that it would always present the same problem.

    I'm not familiar with the macOS way of doing things, so I'll let someone else comment on the expected user experience for macOS.

    On Windows, if I build Qt from source, I install it to a folder where I have full permissions (like C:\Qt\) and everything works fine.

    But anyway, I prefer to use the official installer which takes care of most of the initial setup for me.



  • @JKSH Thanks for the reply.

    The "official" installer is gone, per the Qt "company" for 5.15 and for the future. It's a nice FU to the open-source community.

    The Qt version is already linked up. The doc is wrong, but I filed a bug and that has been addressed for an upcoming release.

    I don't know what adding compilers and kits has to do with Qt Creator not seeing examples.


  • Moderators

    @Stokestack said in Qt Creator does not see examples; also can't build them, because of permissions.:

    The "official" installer is gone, per the Qt "company" for 5.15 and for the future. It's a nice FU to the open-source community.

    The offline installer yes, the online one should be still there for everyone!


    Just checked, in case the QtC pulled one over us
    Link
    5ab1b10c-a234-43f0-b224-e2cc024a9be3-image.png



  • @J-Hilk Yes, so any offline systems are screwed unless they build from source. That's why we need to get all the bugs ironed out with this process.


  • Moderators

    @Stokestack Use the online installer, copy paste the the folder to your offline system.

    Same way you deploy a Qt App.

    I'm not saying I like the new system, I'm saying you're not required to compile from source to use Qt/QtCreator even as a non commercial user!

    And if you want to contribute to the community and stick it to the QtC make an offline installer yourself and publish it for free on the new Qtmarketplace ! 😉🤓


    Edit: I have no idea if you can publish executables on the marketplace 🤔 Haven't used it yet myself


  • Moderators

    @Stokestack said in Qt Creator does not see examples; also can't build them, because of permissions.:

    I don't know what adding compilers and kits has to do with Qt Creator not seeing examples.

    See https://wiki.qt.io/Qt_Examples_in_Qt_Creator#Examples_from_registered_Qt_Versions

    Qt Creator queries the Qt versions that you add in order to find documentation and examples. When it knows where to find your Qt version, it calls qmake -query QT_INSTALL_DOCS to find the doc folder and then reads example-manifest.xml to find the examples.

    If you want to dig deeper, you can call qmake -query QT_INSTALL_DOCS yourself to see where it leads. Also, you can set the QTC_DEBUG_EXAMPLESMODEL environment variable to a non-zero value as described by the wiki and then run Qt Creator from the command line to see the debug output.

    Technically, Qt Creator only needs Qt versions to find examples but it doesn't need compilers and kits. However, having Qt/compiler/kit missing is a common problem so I listed it here. I did not know that you had already added your Qt version.

    The doc is wrong, but I filed a bug and that has been addressed for an upcoming release.

    What was the bug? Could you please link the bug report here?

    Perhaps the doc error was blocking Qt Creator from finding the examples.



  • @JKSH Great, thanks for taking the time to provide all that info. That qmake query returns:

    /usr/local/Qt-5.15.0/doc

    So that seems OK. But I don't find either of those manifest files anywhere below that. The only file whose name contains "manifest" is manifest-meta.qdocconf, which has some examples listed but doesn't seem complete. But this is perplexing:

    qmake -query QT_INSTALL_EXAMPLES

    returns

    /usr/local/Qt-5.15.0/examples

    Which is correct. Setting QTC_DEBUG_EXAMPLESMODEL and launching from the command line yields:

    Reading Help/InstalledExamples from settings: ()
    "Reading file ":/qtsupport/qtcreator_tutorials.xml"..."
    "Reading file ":/qtsupport/qtcreator_tutorials.xml"..."

    The bug report is here: https://bugreports.qt.io/browse/QTCREATORBUG-24138

    The problem was in the verbiage of the doc, not in the functionality of the doc system.



  • @J-Hilk said in Qt Creator does not see examples; also can't build them, because of permissions.:

    And if you want to contribute to the community and stick it to the QtC make an offline installer yourself and publish it for free on the new Qtmarketplace ! 😉🤓

    Exactly what I'm considering! Unfortunately/fortunately I still have regular job, though...


  • Lifetime Qt Champion

    @Stokestack

    Exactly what I'm considering! Unfortunately/fortunately I still have regular job, though...

    That applies to nearly everyone here ;)

    Having an "unofficial" offline installer would be nice. So far I used @J-Hilk's trick with copying after online installer once and it worked fine.

    Regards



  • @aha_1980 said in Qt Creator does not see examples; also can't build them, because of permissions.:

    Having an "unofficial" offline installer would be nice. So far I used @J-Hilk's trick with copying after online installer once and it worked fine.

    Good to know. What were the loose ends you had to tidy up manually after copying the whole thing?


  • Lifetime Qt Champion

    Hi @Stokestack,

    What were the loose ends you had to tidy up manually after copying the whole thing?

    At least for the Creator directory I didn't do anything special after copying, it just worked. I have not copied a whole Qt installation yet, but I assume that will work too if you use the exact same folder names.

    Regards



  • @aha_1980 Ah, OK. I thought you had copied all of Qt. I assume there'll be some paths to set and whatnot.


Log in to reply