Results 1 to 20 of 26

Thread: Qt5 and embedwidgets

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 and embedwidgets

    Using a low level thread and having it emit a signal is most likely the problem because the slot will likely be called in the secondary thread's context and not in the one handling the UI.

    My recommendation is to try something simpler first, e.g. letting the rasterwindow program write its winId to stdout (followed by newline and maybe flush), which you then read in the main application through QProcess (see signal readyReadStandardOutput())

    That way you can test the child process manually, e.g. start it in a shell window and see if it correctly outputs its window id.

    i'd also recommend that you put some empty placeholder widget into the central widget and when you got the winId and have create the window container, you put the window container into a layout in that placeholder.
    You obviously need to keep a pointer to that placerholder as a member of the main window instance so you can access it from the slot connected to readyReadStandardOutput()

    Cheers,
    _

  2. #2
    Join Date
    Mar 2013
    Location
    Hyderabad,Bangalore,India
    Posts
    70
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt5 and embedwidgets

    Thanks anda_skoa,
    i will try what you said,but before that i would like let you know the output i am getting with current program.

    When i run the raster example alone i am getting the window id printed in Qt Creator Log.
    and also if i run container first and raster second seperately i am able to receive the winid in the container but the window is not embedded into it.

    logs when running rasterwindow
    In RasterWindow
    before mq_open
    window id is : 121634822
    window id int : 121634822
    mq_open success
    window id sent is 121634822

    logs when running container

    in Main
    MainWindow
    thread create success
    Init unable to unlink
    mq_open success
    window id received is : 121634822
    unlink success
    In launch_app

    some times i am getting below errors:

    QXcbConnection: XCB error: 8 (BadMatch), sequence: 1131, resource id: 121634822, major code: 1 (CreateWindow), minor code: 0
    QXcbConnection: XCB error: 3 (BadWindow), sequence: 1134, resource id: 109051937, major code: 18 (ChangeProperty), minor code: 0

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt5 and embedwidgets

    It might be helpful to see the actual code of launch_app()
    the one you posted will obviously never embed the window since the widget is never added to any layout.

    Cheers,
    _

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
  •  
Qt is a trademark of The Qt Company.