Results 1 to 2 of 2

Thread: Issue occurring with successive calls to QX11EmbedContainer::embedClient()

  1. #1
    Join Date
    Dec 2020
    Posts
    1

    Question Issue occurring with successive calls to QX11EmbedContainer::embedClient()

    Hi All,

    QT Version: 4.7.1
    Platform: Linux Kubuntu 14
    Compiler: c++11

    After a long period of research on the web and forums, I successfully managed to use QX11EmbedContainer in order to embed a external application into a QT Widget.

    The QT application holds a push button that is pressed by the user.
    This is the general implemenation. How i get the window id is not of importance:

    Qt Code:
    1. Demo::Demo() {
    2. QX11EmbedContainer *container = new QX11EmbedContainer(parent);
    3. layout->addWidget(container);
    4. }
    5.  
    6. WId Demo::getWinID() {
    7. //Implementation
    8. }
    9.  
    10. void Demo::runExternalApp() {
    11. //Implementation
    12. }
    13.  
    14. void Demo::on_runAppButton_clicked() {
    15. runExternalApp()
    16. container->embedClient(getWinID());
    17. }
    To copy to clipboard, switch view to plain text mode 

    After pressing the button, and the call to embedClient() the external application is successfully embedded exactly where I want it to, and its also functioning properly.
    My problem starts when I try to close the external application regularly (from within my QT application) and then re-press the push button that embeds the external application (on_runAppButton_clicked()).
    The external application is terminated properly when regularly exiting from it.
    After pressing the push button again: the application is re-executed properly and embedded, but this time, it is embedded with a offset from the bottom of the layout that holds the container widget (QX11EmbedContainer widget).

    Bare in mind the QT application keeps running throughout this process without terminating - The layout, container widget and parent widget aren't destroyed or anything like that.

    Your help will be very helpful,
    Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Issue occurring with successive calls to QX11EmbedContainer::embedClient()

    Seems like there should be a call to discardClient() when you close the external application. My guess is that the container is still reserving space for the client because it may not know that the winID has become invalid.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 19th March 2014, 17:55
  2. QX11EmbedContainer and Xterm
    By brainTech in forum Qt Programming
    Replies: 0
    Last Post: 2nd January 2013, 18:26
  3. QX11EmbedContainer's problem, thanks for you help
    By ecbtnrt in forum Qt Programming
    Replies: 0
    Last Post: 2nd November 2010, 11:24
  4. QX11EmbedContainer into QMdiArea
    By peppino in forum Qt Programming
    Replies: 0
    Last Post: 25th September 2008, 18:12
  5. QX11EmbedContainer Problems
    By GuS in forum Qt Programming
    Replies: 2
    Last Post: 24th June 2008, 18:28

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.