Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. The Lounge
  4. Qt funs
Forum Updated to NodeBB v4.3 + New Features

Qt funs

Scheduled Pinned Locked Moved The Lounge
5 Posts 2 Posters 2.0k Views 1 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.
  • R Offline
    R Offline
    rst256
    wrote on last edited by
    #1

    Let us share the fun moments associated with Qt.

    From qmake language:
    illusive include
    @
    defineTest(ws_in) {
    include($$1)
    }
    ......
    ws_in(some_file)
    @
    all works? check variables in included file. they were left in local function contex.
    Very fun.
    Developers do you know principle of least astonishment?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      If you would like to discuss this with Qt developers you should rather post this on the interest mailing. You'll find there Qt developers/maintainers (this forum is more user oriented)

      However, it's not really surprising. It's a test function which should return true or false, it's not there that you take actions like include.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rst256
        wrote on last edited by
        #3

        But i`m totally agree with you. qmake in this case is working properly, it processes the inserted file in the local context of the function. A bug in the creator. It should not show the file in the project. But I do not consider this a serious bug. This is a good demonstration of a bottleneck in the system interaction creator - qmake. I think the reason the majority of claims to the creator qmake from users is in the system of semantic analysis .pro files creator.
        Yet from his qmake I got. Control variables i had to manual exported to global context use export function.
        Perfect going projects subdirs, sud-subdirs, sub-sub-... and no problem finding the header files, and connecting parts.

        @defineTest(ar_include1) {
        for(a, INCLUDEPATH_PRI){
        exists( $${a}/$$1 ){
        include( $${a}/$$1 )
        #export all variables that you need
        export(DESTDIR)
        export(LIBS)
        export(INCLUDEPATH)
        export(HEADERS)
        export(QT)
        export(CONFIG)
        export(EXAMPLE_FILES)
        return(true)
        }
        }
        message($$1 not found on path list $$INCLUDEPATH_PRI)
        return(false)

        I really wanted to add error location. but this impossible

        on this level. qmake I still want to rewrite.

        but now it is clear why not all qmake build errors has location

        }
        defineTest(ar_include2) { # use export list file in found dir
        for(a, INCLUDEPATH_PRI){
        exists( $${a}/$$1 ){
        include( $${a}/$$1 )
        exists( $${a}/export.pri ){
        include( $${a}/export.pri ) # use export list file
        return(true)
        }else{
        message(export file $${a}/export.pri not found)
        return(false)
        }
        }
        }
        message($$1 not found on path list $$INCLUDEPATH_PRI)
        return(false)
        }
        defineTest(ar_include3) { # use export list file passed as second arg
        !exists( $$2 ){
        message(export file $$2 not found)
        return(false)
        }
        for(a, INCLUDEPATH_PRI){
        exists( $${a}/$$1 ){
        include( $${a}/$$1 )
        include( $$2 ) # export list file
        return(true)
        }
        }
        message($$1 not found on path list $$INCLUDEPATH_PRI)
        return(false)
        }@

        "test project":https://drive.google.com/file/d/0B1uNXXiz7FliT2NZaWRiQmRIRGs/edit?usp=sharing

        Optimally shared c++ header files saved in directories of their projects, and to connect from other projects I have arranged a shared folder on one level higher than top subdirs projects, and recorded there header files such type:
        #include "path to really header/header.h"

        Now then builder work how i like.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rst256
          wrote on last edited by
          #4

          I almost forgot about. technically also include a test function. except for append code is completely identical to the function exists. Feeble capabilities built-in language even allow you to adjust the relative path to the source files defined in including pri file. Very interesting is why this functionality is not added. Probably because of the sensitive ecosystem framework?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            That's a question you should rather ask on the interest mailing list. You'll find there Qt's developers/maintainers (this forum use more user oriented)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

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