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. What is qt equalient of normal win32 window
QtWS25 Last Chance

What is qt equalient of normal win32 window

Scheduled Pinned Locked Moved General and Desktop
7 Posts 5 Posters 3.9k 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.
  • A Offline
    A Offline
    aashish.lg
    wrote on last edited by
    #1

    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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        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
        0
        • A Offline
          A Offline
          aashish.lg
          wrote on last edited by
          #4

          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
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            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
            0
            • A Offline
              A Offline
              aashish.lg
              wrote on last edited by
              #6

              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
              0
              • G Offline
                G Offline
                giesbert
                wrote on last edited by
                #7

                [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
                0

                • Login

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