Results 1 to 7 of 7

Thread: Porting QX11Embed* functionality

  1. #1
    Join Date
    Feb 2008
    Posts
    12

    Default Porting QX11Embed* functionality

    Hi,
    I really like the QX11Embed classes, however they are X11 only (of course). Since I didn't find any Windows/Mac equivalents, I wonder if anyone ever tried to develop some.

    In Windows, it should be easy - subclassing windows is done all the time in the winapi. It would require some digging into Qt internals, I suppose.

    As for OSX, I don't know (don't have one). Can somebody tell me if its hard to do there?

    This is really relevant for me, since I am toying with the idea of having plugins as processes (not shared libraries) for increased stability (if one process segfaults the rest of the program is naturally shielded from it), flexibility (the plugins can also run as stand-alone programs)... so, feedback would be very welcome.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Porting QX11Embed* functionality

    Quote Originally Posted by dv_ View Post
    In Windows, it should be easy - subclassing windows is done all the time in the winapi. It would require some digging into Qt internals, I suppose.
    Hmm... what exactly would you like to subclass here? QX11Embed is meant to pull existing windows into your application's window as a widget. The contained widget is a separate application - you can't access its internals or anything like that.

  3. #3
    Join Date
    Feb 2008
    Posts
    12

    Default Re: Porting QX11Embed* functionality

    This is exactly what I mean. You can reparent and subclass an application's main window (all you need is its HWND). Of course, to control the window's size and position you need to intercept messages as well, this might be trickier. Still, it can be done.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Porting QX11Embed* functionality

    Quote Originally Posted by dv_ View Post
    subclass an application's main window (all you need is its HWND).
    Hmm... what do you mean by "subclass" here? As far as I know WinAPI is not object oriented, so there are no classes there. Do you mean "add new controls to an existing window"?

  5. #5
    Join Date
    Feb 2008
    Posts
    12

    Default Re: Porting QX11Embed* functionality

    Its not meant in the OO sense. Here is a good article: http://www.venkydude.com/articles/subclass.htm

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Porting QX11Embed* functionality

    It's definitely not what X11Embed does.

  7. #7
    Join Date
    Feb 2008
    Posts
    12

    Default Re: Porting QX11Embed* functionality

    Of course the two techniques differ substantially, but in the end the result is the same: both embed processes, and this is exactly what I want. In the X11Embed case, if the process is X11Embed aware, then focus etc. work properly - but this is not necessary in my app.

Similar Threads

  1. portable getopt() functionality
    By KShots in forum Qt Programming
    Replies: 7
    Last Post: 14th March 2011, 18:19
  2. Porting from qwt-4.2.0 to qwt-5.0.2
    By vheinitz in forum Qwt
    Replies: 3
    Last Post: 31st January 2008, 12:39
  3. Weird problem while porting from Qt3 to Qt4
    By vermarajeev in forum Qt Programming
    Replies: 4
    Last Post: 8th August 2007, 07:51
  4. Common question about porting Qt3 to Qt4
    By zlatko in forum Qt Programming
    Replies: 4
    Last Post: 21st February 2007, 10:57
  5. Problem porting Kivio MP on win32 from Qt 3 to Qt 4
    By Amanda in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 19:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.