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. [SOLVED] Embed qwidget in QML
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Embed qwidget in QML

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 6 Posters 11.9k 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.
  • X Offline
    X Offline
    xcoder
    wrote on last edited by
    #1

    Hello everyone,

    Is it possible to embed QWidget in QML design?
    That would be awesome, because I need this HWND Id for mplayer library.
    I already know how to implement the other way, QML in QWidget.
    I would like to do some animations with QWidget, more specifically flip animation.

    Best regards
    Raivis.

    Only a biker knows why a dog sticks his head out of a car window.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

      Try to use search on DevNet. This problem was raised couple of times.
      As a quick answer look "here":http://doc.qt.nokia.com/4.7/declarative-cppextensions-qwidgets.html

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xcoder
        wrote on last edited by
        #3

        Thanks for reply,

        However, I'm doing something wrong. Because, I get this when I try to launch my app @file:///home/user/Desktop/Bizness/simple_gui/myqml.qml:2:1: module "qmlam" plugin "qmlqwidgetsplugin" not found import "qmlam" 1.0 ^ @

        Should I include something more in the pro file, or I have to install some kind of plugin?

        Only a biker knows why a dog sticks his head out of a car window.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mlong
          wrote on last edited by
          #4

          Without knowing what you're doing, it's hard to tell. The example that Denis pointed to creates a plugin which has the embedded widget in it.

          How are you trying to integrate your widget into your app?

          Do you have any minimal example code?

          Software Engineer
          My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

          1 Reply Last reply
          0
          • X Offline
            X Offline
            xcoder
            wrote on last edited by
            #5

            Okay, I found another example, I believe a bit better to understand this QWidget embedding!

            "Here is the other example":http://doc.qt.nokia.com/4.7-snapshot/declarative-tutorials-extending-chapter1-basics.html

            Oh and I know what didn't do I never registered my class for QML to use.

            qmlRegisterType<PieChart>("Charts", 1, 0, "PieChart");

            Only a biker knows why a dog sticks his head out of a car window.

            1 Reply Last reply
            0
            • R Offline
              R Offline
              renyt
              wrote on last edited by
              #6

              But the PieChart derives from "QDeclarativeItem", which is not a real widget, how can I embeded a QWidget in my qml?

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

                Hi,

                see "this tutorial":http://developer.qt.nokia.com/doc/qt-4.8/declarative-cppextensions-qwidgets.html

                "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

                • Linu...
                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  froncer
                  wrote on last edited by
                  #8

                  Since QDeclarative is marked as deprecated in Qt5 you can use QQuickPaintedItem to draw QWidgets in 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