Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. where to add PrintSupport in Qt6 CMakeLists.txt
Qt 6.11 is out! See what's new in the release blog

where to add PrintSupport in Qt6 CMakeLists.txt

Scheduled Pinned Locked Moved Unsolved Qt 6
3 Posts 3 Posters 2.4k 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.
  • Habib123H Offline
    Habib123H Offline
    Habib123
    wrote on last edited by
    #1

    Hello

    I want to add PrintSupport in Qt6 application, now where i can add the module in CMakeLists.txt,
    there are two find_package(), in the first one or in the second one ?

    find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widget )
    find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
    
    J 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Depending on what you do with then, both.

      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
      • Habib123H Habib123

        Hello

        I want to add PrintSupport in Qt6 application, now where i can add the module in CMakeLists.txt,
        there are two find_package(), in the first one or in the second one ?

        find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widget )
        find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
        
        J Offline
        J Offline
        josecharry
        wrote on last edited by
        #3

        @Habib123
        you should put:
        find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets PrintSupport)

        and link with the finded library:

        target_link_libraries(Test PRIVATE Qt${QT_VERSION_MAJOR}::Widgets PRIVATE Qt${QT_VERSION_MAJOR}::PrintSupport)

        1 Reply Last reply
        1

        • Login

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