Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qwidgets in QML
QtWS25 Last Chance

Qwidgets in QML

Scheduled Pinned Locked Moved QML and Qt Quick
11 Posts 6 Posters 13.2k 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.
  • J Offline
    J Offline
    Jupiter
    wrote on last edited by
    #1

    Hi,

    is it somehow possible to use Native QtWidgets (like a QCombobox) in a QDeclarativeItem? I know about the labs projects and things about QML controls. but I need a stable solution.

    thanks

    1 Reply Last reply
    0
    • frankcyblogic.deF Offline
      frankcyblogic.deF Offline
      frankcyblogic.de
      wrote on last edited by
      #2

      I think mixing QML and QWidget is not easy, nor future prove. But using it side by side is easy. You can easily control your QWidget based application from QML by declaring your own items which emit/receive signals.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thisisbhaskar
        wrote on last edited by
        #3

        There are couple of things..

        1. Do you want to create instances of native qt widgets inside qml or
        2. You want to make a concrete native qt widget create in C++ class and make it available inside qml??

        The second one is easy and make sense to do it. But first method is bit hard as mostly not all useful properties/methods are exposed to meta system via Q_PROPERTY/Q_INVOKABLE, so are not available inside qml.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jupiter
          wrote on last edited by
          #4

          i want do use a ComboBox inside QML, but it seems too complicated for me to make a qml combobox.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dialingo
            wrote on last edited by
            #5

            Qt comes with an example that shows how to embedded widgets in qml:
            examples/declarative/cppextensions/qwidgets

            There are a couple of problems though:
            You can not nest widgets with QML easily.
            There is a clash of philosophies. In C++ you keep pointers to widgets to manipulate them. In QML visual items adapt to property changes. Having pointers to widgets breaks the separation between C++ (back end) and qml (front end).

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Jupiter
              wrote on last edited by
              #6

              i dont have the folder you mentioned in my qtsdk folder ? arent there all examples in the sdk?

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thisisbhaskar
                wrote on last edited by
                #7

                you can refer to http://doc.qt.nokia.com/4.7/qdeclarativeexamples.html#c-extensions

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  Jupiter
                  wrote on last edited by
                  #8

                  thanks that helps

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    njeisecke
                    wrote on last edited by
                    #9

                    I've had all kind of troubles (painting artefacts, bad performance, ...) with embedding QWidgets in QML scenes. It just does not work very well.

                    I guess the Qml Desktop Components won't become official/stable before Qt 5 so for desktop applications that must have a native look and feel I would recommend using the classic QWidget approach.

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dialingo
                      wrote on last edited by
                      #10

                      Another warning: Font hinting is also a problem with embedded widgets. Do not expect fonts to appear as clean as they do on QML Text elements or on non-embedded widgets.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        Dmitriy V. Shmykov
                        wrote on last edited by
                        #11

                        That's it http://developer.blackberry.com/native/documentation/cascades/dev/integrating_cpp_qml/

                        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