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. [SOLVED] Qt5 Property Browser
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt5 Property Browser

Scheduled Pinned Locked Moved General and Desktop
24 Posts 3 Posters 21.3k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #15

    How did you try to build QtPropertyBrowser ?

    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
    • A Offline
      A Offline
      ASxa86
      wrote on last edited by
      #16

      In cmake, I added the *h/*cpp files to my list of source files.

      I called QT5_WRAP_CPP on the qtpropertybrowser header files.
      I added the generated moc files to add_library()

      Example:
      @
      set(TARGET_H
      qtpropertybrowser.h
      qttreepropertybrowser.h
      )

      set(TARGET_SRC
      qtpropertybrowser.cpp
      qtpropertybrowser.cpp
      )

      QT5_WRAP_CPP(QTPROPERTYBROWSER_MOC ${TARGET_H})

      add_library(${PROJECT_NAME} SHARED ${TARGET_SRC} ${QTPROPERTYBROWSER_MOC})
      @

      This is a sample of what i'm doing in my CMakelist.txt. Then I proceed to build with Visual Studio 2012

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

        Why don't you just follow the build instruction to create the QtPropertyBrowser library and use it in your project ?

        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
        • A Offline
          A Offline
          ASxa86
          wrote on last edited by
          #18

          I want to say I've tried that and had issues too. Though I don't remember what. I will give it another try once I get a chance.

          I'm pretty sure I can run:

          @
          conifure -library
          qmake
          nmake
          @

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ASxa86
            wrote on last edited by
            #19

            Success! Built and linked to the DLL without any issues. Created a custom widget interface and was able to pull it up in QtDesigner.

            I think my original issue with doing it this way was I didn't define QT_QTPROPERTYBROWSER_IMPORT. Which meant my dynamic widget was inheriting from a static class.

            Once again, thank you SGalst for taking time to help.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              ASxa86
              wrote on last edited by
              #20

              edit: solved

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

                You're welcome !

                If it's now working for you, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                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
                • L Offline
                  L Offline
                  lucatersi
                  wrote on last edited by
                  #22

                  Hi,
                  could you please summarize what you have done to solve the issue? With QT4 I managed to get a cmake version of qtpropertybrowser and to include it in my project, I cannot migrate to QT5 though...
                  Any help?
                  Thanks

                  EDIT: how can include qtpropertybrowser in my CMakeLists.txt?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ASxa86
                    wrote on last edited by
                    #23

                    First off, I was unsuccessful at including the qtpropertybrowser source into my CMake project and building. Just wouldn't work. So what I did was built QtPropertyBrowser as a stand alone dynamic library and then linked that into my CMake project.

                    Here's what I did step by step successfully on 3 different PCs.
                    Note: I'm running VS2012 and Qt5.2.1

                    1. Install Qt to C:\Qt
                    2. Set C:\Qt\Qt5.2.1\5.2.1\msvc2012_64_opengl\bin to your PATH
                    3. Download QtSolutions to C:\QtSolutions
                    4. Run the Native x64 command prompt (VS2012) and cd to C:\QtSolutions\QtProperyBrowser
                    5. Follow the given directions in QtPropertyBrowser
                      @
                      configure -library
                      qmake
                      nmake
                      @

                    This will build the dynamic library for you.

                    1. From here I wrote a simple Find QtPropertyBrowser for my CMake project.
                    2. Link to QtPropertyBrowser in CMake and ensure the import definition is defined (found in header file)
                      @
                      add_definitions(-DQT_QTPROPERTYBROWSER_IMPORT)
                      target_link_libraries(${PROJECT_NAME} ${QTPROPERTYBROWSER_LIBRARIES})
                      @

                    This was about all I did as far as I can remember. Hope this helps.

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lucatersi
                      wrote on last edited by
                      #24

                      Thanks you a lot, I finally managed to compile QtPropertyBrowser with Qt5 and cmake tweaking some functions in the code and the cmake configuration files found here: https://github.com/commontk/QtPropertyBrowser.
                      The libraries were successfully linked into my project.

                      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