Results 1 to 2 of 2

Thread: Third Party X11 Window doesn't wanna fit inside GUI

  1. #1
    Join Date
    May 2012
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Third Party X11 Window doesn't wanna fit inside GUI

    I'm not sure if this counts as a noob question cause this is my first post, as I've been working in Qt for about 3 weeks now. Anyways...

    I have this third-party library that is reponsible for creating and displaying a certain type of buffer. I'm sure it uses the Xlib libs somehow.
    When I try to embed this XWindow into a GUI i'm working on, it keeps popping up separately from the GUI, but works fine.

    At first I thought I just sucked at Qt, but after about 7 or so hours of looking into this, I'm really stumped.

    I attempted to solve this problem in a few different ways:

    - first, create a QX11EmbedContainer, and embed the XWindow client into this container.

    Qt Code:
    1. QX11EmbedContainer *container = new QX11EmbedContainer(this);
    2. container -> setFixedSize(320, 240);
    3.  
    4. //After display creation
    5.  
    6. void *handler = malloc(sizeof(int *));
    7. thirdPartyFunctionForGettingWindowHandle(thirdPartyDisplay, GET_WINDOW_HANDLE, (void *) handler); //the window handle is returned in handler
    8.  
    9. container -> embedClient (handler)
    To copy to clipboard, switch view to plain text mode 

    Unfortunately this doesn't work, as I'm not entirely sure of the function that returns the window Id.

    Second way:

    I attempted to create my own XWindow with an associated display, and pass that into the third-party display creation function:

    Qt Code:
    1. Display *display = XOpenDisplay(NULL);
    2. Window win = XCreateSimpleWindow(display, RootWindow(display, DefaultScreen(display)), 1, 1, 320, 240, 0, BlackPixel(display, 0), BlackPixel(display, 0));
    3. XMapWindow(display, win);
    4. XFlush(display);
    5.  
    6. ...
    7.  
    8. thirdPartyFunctionForCreatingADisplay(display, NULL, Camera_handle, errorHandler);
    To copy to clipboard, switch view to plain text mode 

    This doesn't even compile, as all the third party functions take in only void pointers and do weird stuff with them, and casting doesn't work, of course.

    After summing all this info up, I guess nobody on this forum can help me unless they're familiar with the libraries I'm using...sigh. I've emailed the third-party people for some advice on this one.
    I don't think I can switch to another window managing system like GTK cause I need their other functions for buffer handling and such.

    In any case, is there another way for embedding XWindows that I haven't figured out yet?

    (I have to use these libs, by the way)

    Thanks!

  2. #2
    Join Date
    May 2012
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Third Party X11 Window doesn't wanna fit inside GUI

    problem solved, looking at wrong version of third party API X(

Similar Threads

  1. Replies: 1
    Last Post: 10th April 2012, 17:18
  2. I wanna drag and drop some files into QTreeView
    By guri in forum Qt Programming
    Replies: 4
    Last Post: 28th September 2011, 10:13
  3. Why QAction inside Qmenu doesn't display Icon ?
    By jpujolf in forum Qt Programming
    Replies: 8
    Last Post: 21st December 2009, 13:51
  4. Open a window inside another window
    By passerb in forum Qt Programming
    Replies: 6
    Last Post: 18th October 2009, 14:24

Tags for this Thread

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.