Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT_INSTALL_EXAMPLES] - more discussion please
Qt 6.11 is out! See what's new in the release blog

QT_INSTALL_EXAMPLES] - more discussion please

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    This has been discussed before , so this is sort of re-post.

    I am trying to learn about " make " and its derivatives. My learning style is sort of "in reverse " - in this case I know some stuff about make , however, when I find an item I do not understand and RTFM does not answer my concern I rather ask than guess or "spin my wheels".

    The reason for this post is to clarify "make" QT_INSTALL_EXAMPLES.
    I know what TARGET option does and if not being specified as "TARGET = project " it defaults to name of the project .pro file without the "extension" .pro:. (In this case TARGET = mdi )

    I like to know - where is symbol QT_INSTALL_EXAMPLES actually defined -as being part of the 'target " path. hence system depended.

    Here is the actual usage in mdi.pro:

    target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/mdi
    INSTALLS += target

    Actually TARGET is not assigned , only the path is - it defaults to "mdi".
    It seems redundant or is path really needed here ?
    And INSTALLS adds unassigned / default (mdi) TARGET to list?

    Here is the original discussion reference :

    https://forum.qt.io/topic/52831/what-is-target-path-qt_install_examples-widgets-mainwindows-mdi-in-pro

    JKSHJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      This has been discussed before , so this is sort of re-post.

      I am trying to learn about " make " and its derivatives. My learning style is sort of "in reverse " - in this case I know some stuff about make , however, when I find an item I do not understand and RTFM does not answer my concern I rather ask than guess or "spin my wheels".

      The reason for this post is to clarify "make" QT_INSTALL_EXAMPLES.
      I know what TARGET option does and if not being specified as "TARGET = project " it defaults to name of the project .pro file without the "extension" .pro:. (In this case TARGET = mdi )

      I like to know - where is symbol QT_INSTALL_EXAMPLES actually defined -as being part of the 'target " path. hence system depended.

      Here is the actual usage in mdi.pro:

      target.path = $$[QT_INSTALL_EXAMPLES]/widgets/mainwindows/mdi
      INSTALLS += target

      Actually TARGET is not assigned , only the path is - it defaults to "mdi".
      It seems redundant or is path really needed here ?
      And INSTALLS adds unassigned / default (mdi) TARGET to list?

      Here is the original discussion reference :

      https://forum.qt.io/topic/52831/what-is-target-path-qt_install_examples-widgets-mainwindows-mdi-in-pro

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @AnneRanch said in QT_INSTALL_EXAMPLES] - more discussion please:

      I like to know - where is symbol QT_INSTALL_EXAMPLES actually defined

      QT_INSTALL_EXAMPLES is a special symbol that is baked into qmake. See Line #61 of the source code: https://code.qt.io/cgit/qt/qtbase.git/tree/qmake/property.cpp?h=v5.15.2#n61 (the code also contains other special symbols)

      qmake reads the path string directly from the Qt libraries (by calling QLibraryInfo::location()), and replaces $$[QT_INSTALL_EXAMPLES] with that path string. You can read the same string from your C++ code:

      qDebug() << QLibraryInfo::location(QLibraryInfo::ExamplesPath);
      

      Note: You probably don't want to use this path in your own project, since you don't want to put your files into Qt's "examples" folder

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      A 1 Reply Last reply
      2
      • JKSHJ JKSH

        @AnneRanch said in QT_INSTALL_EXAMPLES] - more discussion please:

        I like to know - where is symbol QT_INSTALL_EXAMPLES actually defined

        QT_INSTALL_EXAMPLES is a special symbol that is baked into qmake. See Line #61 of the source code: https://code.qt.io/cgit/qt/qtbase.git/tree/qmake/property.cpp?h=v5.15.2#n61 (the code also contains other special symbols)

        qmake reads the path string directly from the Qt libraries (by calling QLibraryInfo::location()), and replaces $$[QT_INSTALL_EXAMPLES] with that path string. You can read the same string from your C++ code:

        qDebug() << QLibraryInfo::location(QLibraryInfo::ExamplesPath);
        

        Note: You probably don't want to use this path in your own project, since you don't want to put your files into Qt's "examples" folder

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #3

        @JKSH said in QT_INSTALL_EXAMPLES] - more discussion please:

        qDebug() << QLibraryInfo::location(QLibraryInfo::ExamplesPath);

        Thanks I guess my next search will be for qMake documentation....

        Am I correct to say QtCreator really uses "qMake" and not "make" ?

        This part of software development - usage of make /makefile/qMake etc. _ still eludes me.
        I guess I am a "victim" of assembly "language" coding where passing the ones and zeroes to the "computer" was much simpler.

        JKSHJ 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @JKSH said in QT_INSTALL_EXAMPLES] - more discussion please:

          qDebug() << QLibraryInfo::location(QLibraryInfo::ExamplesPath);

          Thanks I guess my next search will be for qMake documentation....

          Am I correct to say QtCreator really uses "qMake" and not "make" ?

          This part of software development - usage of make /makefile/qMake etc. _ still eludes me.
          I guess I am a "victim" of assembly "language" coding where passing the ones and zeroes to the "computer" was much simpler.

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by JKSH
          #4

          @AnneRanch said in QT_INSTALL_EXAMPLES] - more discussion please:

          Am I correct to say QtCreator really uses "qMake" and not "make" ?

          No, it uses both.

          • qmake uses the contents of your .pro file to generate a Makefile.
          • make uses the contents of the Makefile to run the tools to build your project (e.g. compiler and linker)

          This part of software development - usage of make /makefile/qMake etc. _ still eludes me.

          make has existed since 1976, and it is still widely involved in software development globally. It is significant enough to win its inventor an ACM Software System Award in 2003.

          I suggest you set aside some time to understand how Makefiles work. It will crystallize many things for you.

          I guess my next search will be for qMake documentation....

          https://doc.qt.io/qt-5/qmake-manual.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          3

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved