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.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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    Have a look at the qttools module, IIRC you'll find QtPropertyBrowser there

    Hope it helps

    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
      #3

      I pulled from https://git.gitorious.org/qt-solutions/qt-solutions.git

      located https://qt.gitorious.org/qt-solutions/qt-solutions/source/fd22bee22274975c56f1c10d87ee9fd2c0818f83:qtpropertybrowser

      This code uses depecrated functions. In fact, it appears it hasn't been changed in 4 years.

      I'm building my project with Qt5.2.1. As I type this I think i'm realizing i'm pulling from the wrong git.

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

        qttools is part of Qt 5

        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
          #5

          Does this come packaged with the qt download? If so, where? I have been unable to find it.

          Or will I have to clone the repository?

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

            Having downloaded and built qttools located "Here":https://qt.gitorious.org/qt/qttools/

            I am still unable to locate QtPropertyBrowser. What am I missing?

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

              The sources for it are in qttools/src/shared/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
                #8

                Thank you for all your help so far. Next question. It would appear this code is meant for static linkage. So I'm just throwing the files into my Visual Studio project using CMake.

                I call QT5_WRAP_CPP() and add the generated moc files directory to my include_directories().

                The problem is, when I build, the moc files are missing class definitions.

                Most if not all of the moc files are missing class definitions for the privately declared classes. Is there something i'm missing perhaps?

                Another question, the qtpropertybrowser code includes the moc files at the end of header files. Since I'm using Qt5 do I even need to do this anymore?

                I haven't had to include moc files for any of my custom widgets and classes.

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

                  Rethinking about it, qt-solution's QtPropertyBrowser can be built with Qt 5 without any problem and directly into a lib that you can re-use. So why not use it ?

                  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
                    #10

                    I think I tried that earlier and had issues. I don't remember what though. I'll see what I can do when I get home.

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

                      Oh, jeez. In my earlier post i stated it seemed like the qtpropertybrowser from qt-solutions was using deprecated functions and i didn't want to have to rewrite it. I'll try again.

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

                        I've cloned qt-solution and built it with Qt 5.3 but I've had no special warning about deprecated function

                        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
                          #13

                          I'm giving it a try now. I'm building with VS2012 in combination with CMake.

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

                            Attempting to build the code with my project.

                            qttreepropertybrowser.cpp 486: setMovable is not a member of QHeaderView

                            This is just one example.

                            qtvariantproperty.cpp 1652: 'qVariantValue' undeclared identifier

                            is another.

                            I'm also getting the errors that *_moc.cpp have undefined types because they are unable to see the definitions of private classes.

                            I will try and build with qt5 but when I linked to the qtpropertybrowser.dll for my project. QtDesigner wouldn't load my CustomWidget.dll. In fact, QtDesigner wouldn't even run because of some kind of dll load order with Qt5Widgets.dll.

                            I will report back.

                            1 Reply Last reply
                            0
                            • 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

                                          • Login

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