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. Private headers access
Forum Updated to NodeBB v4.3 + New Features

Private headers access

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 2.1k Views
  • 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
    AlexMaly
    wrote on last edited by
    #1

    I am trying to integrate TCL and Qt5 event loops and hitting a problem related to access to private headers.
    To do such integration I need to inherit from system specific subclasses of QAbstractEventDispatcher.

    For example for Windows I need to subclass QEventDispatcherWin32, cause I do not need
    To get access to header file I had to add the full path to include to my cmake file.
    SET(QT_PRIVATE_INCLUDES_CORE "c:/Qt/5.15.1/msvc2019_64/include/QtCore/5.15.1/QtCore")
    This seems kills the purpose of find_package(Qt5 5.15.1...

    On top the whole directory structure for private headers is weird:
    c:/Qt/5.15.1/msvc2019_64/include/QtCore/5.15.1/QtCore/private/

    What is the purpose of path in bold?
    why it can't be c:\Qt\5.15.1\msvc2019_64\include\QtCore\private\ ?

    I understand that you do not want typically expose private headers,
    But this would be perfectly ok if you designed the class, so nobody needs to subclass it.
    In case of QEventDispatcherWin32 I have no choice unless I want to write my subclass from scratch, which does not make any sense.

    Is there another ways to access private headers I am not aware off?

    VRoninV 1 Reply Last reply
    0
    • A AlexMaly

      I am trying to integrate TCL and Qt5 event loops and hitting a problem related to access to private headers.
      To do such integration I need to inherit from system specific subclasses of QAbstractEventDispatcher.

      For example for Windows I need to subclass QEventDispatcherWin32, cause I do not need
      To get access to header file I had to add the full path to include to my cmake file.
      SET(QT_PRIVATE_INCLUDES_CORE "c:/Qt/5.15.1/msvc2019_64/include/QtCore/5.15.1/QtCore")
      This seems kills the purpose of find_package(Qt5 5.15.1...

      On top the whole directory structure for private headers is weird:
      c:/Qt/5.15.1/msvc2019_64/include/QtCore/5.15.1/QtCore/private/

      What is the purpose of path in bold?
      why it can't be c:\Qt\5.15.1\msvc2019_64\include\QtCore\private\ ?

      I understand that you do not want typically expose private headers,
      But this would be perfectly ok if you designed the class, so nobody needs to subclass it.
      In case of QEventDispatcherWin32 I have no choice unless I want to write my subclass from scratch, which does not make any sense.

      Is there another ways to access private headers I am not aware off?

      VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by VRonin
      #2

      @AlexMaly said in Private headers access:

      This seems kills the purpose of find_package(Qt5 5.15.1...

      There is a find_package for private headers too. find_package(Qt COMPONENTS Core REQUIRED)/target_link_libraries(MyApp Qt::Core Qt::CorePrivate)

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      A 1 Reply Last reply
      2
      • VRoninV VRonin

        @AlexMaly said in Private headers access:

        This seems kills the purpose of find_package(Qt5 5.15.1...

        There is a find_package for private headers too. find_package(Qt COMPONENTS Core REQUIRED)/target_link_libraries(MyApp Qt::Core Qt::CorePrivate)

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

        @VRonin said in Private headers access:

        CorePrivate

        Thanks,

        But
        find_package(Qt5 5.15.1 HINTS ${EFFLX_QTDIR} COMPONENTS Core CorePrivate Widgets REQUIRED)
        fails with:

        CMake Error at C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package):
        1> [CMake] Could not find a package configuration file provided by "Qt5CorePrivate"
        1> [CMake] with any of the following names:
        1> [CMake]
        1> [CMake] Qt5CorePrivateConfig.cmake
        1> [CMake] qt5coreprivate-config.cmake
        1> [CMake]

        And I installed everything related to this version package

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          My bad, you don't need the find_package corrected the post above

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          1
          • A Offline
            A Offline
            AlexMaly
            wrote on last edited by
            #5

            @VRonin said in Private headers access:

            Qt::CorePrivate

            I am not sure I understand how linking directive can help to find header during compilation, but it did.
            Thanks, I would never look at target_link_libraries for such option

            VRoninV 1 Reply Last reply
            0
            • A AlexMaly

              @VRonin said in Private headers access:

              Qt::CorePrivate

              I am not sure I understand how linking directive can help to find header during compilation, but it did.
              Thanks, I would never look at target_link_libraries for such option

              VRoninV Offline
              VRoninV Offline
              VRonin
              wrote on last edited by VRonin
              #6

              @AlexMaly said in Private headers access:

              I am not sure I understand how linking directive can help to find header during compilation

              In CMake, target_link_libraries with a package doesn't mean only linker targets, it takes everything in the INTERFACE_ of that package (notably links, includes and compile definitions)

              "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
              ~Napoleon Bonaparte

              On a crusade to banish setIndexWidget() from the holy land of Qt

              1 Reply Last reply
              2

              • Login

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