Results 1 to 20 of 23

Thread: Embed an external application to the widget

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Posts
    90
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    6
    Thanked 4 Times in 2 Posts

    Default Re: Embed an external application to the widget

    Quote Originally Posted by fullmetalcoder View Post
    any way to perform such an embedding under window$ ???
    Qt is cross-platform isn't it?
    Sorry for reopening... but I find this to be a good question. How does one do this under Windows? I assume QX11EmbedWidget will obviously only work under X11.

    And one more question since I have not used QX11Embed*, can I use these classes to essentially attach my Qt app to another window... to basically doc mine to the side for example?

  2. #2
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    9
    Thanked 3 Times in 3 Posts

    Default Re: Embed an external application to the widget

    Quote Originally Posted by bpetty View Post
    How does one do this under Windows? I assume QX11EmbedWidget will obviously only work under X11.
    I'm also wondering this - is it possible to embed an external application under Windows? Or only for Linux?
    Richard

  3. #3
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Embed an external application to the widget

    I am just hanging to this thread, because I also have a problem with this. I am trying to embed xterm in a QDockWidget. All that I need is the wid. When passing the wid to embedClient(..) manually (via xwininfo -int) it works perfectly, but I don't see any good way of getting that wid? Ideas?

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

    Default Re: Embed an external application to the widget

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Embed an external application to the widget

    Yeah, but I mean the wid from the external application, not my own widget.

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

    Default Re: Embed an external application to the widget

    Just run xterm with "-into X" where X is the winId returned by the window you wish to embed xterm into.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Embed an external application to the widget

    I tried exactly this, but xterm opens in a separate window.

    edit:
    Here's some code:
    Shell::Shell(QWidget *parent)
    : QDockWidget(parent)
    {
    setObjectName("Shell");
    setWindowTitle("Shell");

    QWidget *widget=new QWidget(this);
    setWidget(widget);

    process=new QProcess(this);
    process->start("xterm -into "+QString((int)widget->winId()));
    widget->show();
    }
    edit2:
    I made a screenshot for you, so you can understand what I am trying to achieve:
    Attached Images Attached Images
    Last edited by leenxkewl; 14th October 2010 at 17:15.

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

    Default Re: Embed an external application to the widget

    It fails because your QString "cast" fails. Look that there is no QString constructor taking a sole int as a parameter.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. The following user says thank you to wysota for this useful post:

    leenxkewl (14th October 2010)

  10. #9
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Re: Embed an external application to the widget

    Oh hehe, sorry fur bugging you. Anyways, isn't there a solution to implement any foreign window?
    Attached Images Attached Images
    Last edited by leenxkewl; 14th October 2010 at 18:08.

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

    Default Re: Embed an external application to the widget

    As far as I know, there is no such solution.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 18:50
  2. shared vs static
    By alisami in forum Installation and Deployment
    Replies: 3
    Last Post: 4th October 2008, 14:04
  3. Replies: 16
    Last Post: 23rd May 2008, 11:12
  4. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 23:04
  5. Replies: 1
    Last Post: 14th June 2006, 15:36

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.