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. How to create header file for ui I downloaded?
Forum Updated to NodeBB v4.3 + New Features

How to create header file for ui I downloaded?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 882 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.
  • C Offline
    C Offline
    cerr
    wrote on 5 Jul 2019, 03:24 last edited by
    #1

    Hi,

    I found a Python project built with PyQt and I would like to use its UI but in a C++ application. How do I generate its .h file?

    J 1 Reply Last reply 5 Jul 2019, 03:58
    0
    • C cerr
      5 Jul 2019, 04:06

      Yeah, it's got a .ui file. But I need an .h file to create a makefile with cmake, don't I? So that my application can interface with the .ui... how do I establish the link otherwidse?
      Yeah, the project was licensed under GNU.

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 5 Jul 2019, 06:44 last edited by
      #5

      @cerr said in How to create header file for ui I downloaded?:

      But I need an .h file to create a makefile with cmake, don't I?

      Nope. You ask CMake to automatically convert the .ui file to a .h file.

      • https://doc.qt.io/qt-5.12/qtwidgets-cmake-qt5-wrap-ui.html
      • https://doc.qt.io/qt-5/cmake-manual.html

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

      C 1 Reply Last reply 6 Jul 2019, 01:50
      4
      • C cerr
        5 Jul 2019, 03:24

        Hi,

        I found a Python project built with PyQt and I would like to use its UI but in a C++ application. How do I generate its .h file?

        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 5 Jul 2019, 03:58 last edited by
        #2

        @cerr said in How to create header file for ui I downloaded?:

        I found a Python project built with PyQt and I would like to use its UI but in a C++ application.

        Is the UI implemented using Python code, or does it have a *.ui file? If it haas a *.ui file, you can copy the file straight into your C++ project.

        Remember to check the PyQt project license.

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

        1 Reply Last reply
        1
        • C Offline
          C Offline
          cerr
          wrote on 5 Jul 2019, 04:06 last edited by
          #3

          Yeah, it's got a .ui file. But I need an .h file to create a makefile with cmake, don't I? So that my application can interface with the .ui... how do I establish the link otherwidse?
          Yeah, the project was licensed under GNU.

          J J 2 Replies Last reply 5 Jul 2019, 05:08
          0
          • C cerr
            5 Jul 2019, 04:06

            Yeah, it's got a .ui file. But I need an .h file to create a makefile with cmake, don't I? So that my application can interface with the .ui... how do I establish the link otherwidse?
            Yeah, the project was licensed under GNU.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 5 Jul 2019, 05:08 last edited by
            #4

            @cerr said in How to create header file for ui I downloaded?:

            But I need an .h file

            It's generated by uic.exe tool during building your app.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            3
            • C cerr
              5 Jul 2019, 04:06

              Yeah, it's got a .ui file. But I need an .h file to create a makefile with cmake, don't I? So that my application can interface with the .ui... how do I establish the link otherwidse?
              Yeah, the project was licensed under GNU.

              J Offline
              J Offline
              JKSH
              Moderators
              wrote on 5 Jul 2019, 06:44 last edited by
              #5

              @cerr said in How to create header file for ui I downloaded?:

              But I need an .h file to create a makefile with cmake, don't I?

              Nope. You ask CMake to automatically convert the .ui file to a .h file.

              • https://doc.qt.io/qt-5.12/qtwidgets-cmake-qt5-wrap-ui.html
              • https://doc.qt.io/qt-5/cmake-manual.html

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

              C 1 Reply Last reply 6 Jul 2019, 01:50
              4
              • J JKSH
                5 Jul 2019, 06:44

                @cerr said in How to create header file for ui I downloaded?:

                But I need an .h file to create a makefile with cmake, don't I?

                Nope. You ask CMake to automatically convert the .ui file to a .h file.

                • https://doc.qt.io/qt-5.12/qtwidgets-cmake-qt5-wrap-ui.html
                • https://doc.qt.io/qt-5/cmake-manual.html
                C Offline
                C Offline
                cerr
                wrote on 6 Jul 2019, 01:50 last edited by
                #6

                @JKSH said in How to create header file for ui I downloaded?:

                @cerr said in How to create header file for ui I downloaded?:

                But I need an .h file to create a makefile with cmake, don't I?

                Nope. You ask CMake to automatically convert the .ui file to a .h file.

                • https://doc.qt.io/qt-5.12/qtwidgets-cmake-qt5-wrap-ui.html
                • https://doc.qt.io/qt-5/cmake-manual.html

                Ah, excellent, that's great! Thanks for this!

                1 Reply Last reply
                1

                1/6

                5 Jul 2019, 03:24

                • Login

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