Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    What is qt equalient of normal win32 window

    General and Desktop
    5
    7
    3591
    Loading More Posts
    • 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.
    • A
      aashish.lg last edited by

      Hi,

      I am writting one dll using qt that I wanted to make it run ina cross plattform way(both windows and Linux).
      From this dll I am loading external adobe flash plugin dll(.so in LINUX). My question is I have to pass a HWND to adobe flash plugin from my dll, earlier I was doing it using RegisterWindow(), and CreateWindow() function and was paasing HWND to adobe flash plugin.
      SInce I am moving to make my dll work in both plattofrom, so what qt class will suit best for my window handling.
      Additionally , is it possible to subclass the wndproc of qt window so that I can get the messages posted to that window.?

      Regards
      Ashish

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        I think you can use QWidget::winId() for that. Check documentation for "QWidget":http://developer.qt.nokia.com/doc/qt-4.7/qwidget.html#id-9aaf347d-ee0d-451e-be64-0d82023e7c74.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • L
          lgeyer last edited by

          The equivalent is QWidget, which becomes a seperate window if it is shown without a parent. You might receive a native handle using winId() and native messages by reimplementing winEvent().

          1 Reply Last reply Reply Quote 0
          • A
            aashish.lg last edited by

            Hi,

            Thanks for your reply. I got the window showing just like a normal win32 window using QWidget, but I have one doubt here.

            To make this window work , First I have created one QApplication object. but I have not called exce() method on that QApplication object because it never returns.

            I am pretty confused from where I should make a call to exec() function.
            My working scenario is mentioned below.

            I wrote one dll, and this dll is getting loaded by Mozilla browser.
            There is some exposed function that is called by Mozilla first, there I am creating QApplication object instance using new. I declare pointer to QApplication as null as a global variable.

            after some function calls sequence goes on Mozilla calls SetWindow() function in my dll , from there I am creating QWidget.

            But I am not getting from where I should cal exec method on QApplication.

            Please help!!!

            Regards
            Ashish

            1 Reply Last reply Reply Quote 0
            • A
              andre last edited by

              The whole point of QApplication::exec() is that it doesn't return. It starts up the eventloop.

              However, I am not sure how to integrate that with writing a plugin for mozilla.

              1 Reply Last reply Reply Quote 0
              • A
                aashish.lg last edited by

                Hi,

                I wonder to see that how come I am getting the winEvent and paintEvent in my class that is derived from QWidget.

                As per documentation exec() will run the event loop and will dispatch the message to appropriate Widget , since I didnt call exec() methos neverthless I am getting this events.

                Any suggestions please share.
                Morever, if I will use getDC() function of QWidet to pass DC to some other app of QWidet to draw on widget, can we use same code for Linux also, since it is wriiten like this function is not portable. If not then what could be the other alternative.?

                1 Reply Last reply Reply Quote 0
                • G
                  giesbert last edited by

                  [quote author="Ashish Mittal" date="1322728419"]Hi,
                  Morever, if I will use getDC() function of QWidet to pass DC to some other app of QWidet to draw on widget, can we use same code for Linux also, since it is wriiten like this function is not portable. If not then what could be the other alternative.?
                  [/quote]

                  If you use stuff like getDC, winID etc, the code is not portable. This is platform specific stuff and must be implemented for each platform using #if

                  Nokia Certified Qt Specialist.
                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post