Results 1 to 3 of 3

Thread: QX11EmbedContainer Problems

  1. #1
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default QX11EmbedContainer Problems

    Hi guys!

    I have a little problem... In my application i was embedding a xterm console using QX11EmbedContainer. But since Qt4.4 this does not work (was working perfectly before:

    Heres the code (in PyQt, sorry...):

    Qt Code:
    1. class toolsConsole(QtCore.QObject):
    2. def __init__(self, gui):
    3. QtCore.QObject.__init__(self)
    4.  
    5. self.gui = gui
    6.  
    7. # Creamos un contenedor para poder embeber la consola dentro de un frame
    8. self.container = QX11EmbedContainer(self.gui.consoleFrame)
    9. self.container.setGeometry(4, 4, 600, 425)
    10.  
    11. # Comenzamos a definir la ventana para poder obtener el wid (window ID) y colocarlo en el "container"
    12. wid = self.container.winId()
    13.  
    14. # Asigamos los parámetros de la aplicación y a su vez, obtenemos el número de WID.
    15. self.parametersList = ["-into", repr(wid), "-bg", "black", "-fg", "white"]
    16.  
    17. # Definimos la clase para ejecutar el proceso, o sea, la aplicación de la consola xterm
    18. self.process = QtCore.QProcess()
    19.  
    20. # Especificamos que el path por defecto, sea el HOME de cada usuario.
    21. self.initDirectory = QString(QDir.homePath())
    22. self.process.setWorkingDirectory(self.initDirectory)
    23.  
    24. # Ejecutamos el proceso de xterm
    25. self.process.start("xterm", self.parametersList)
    To copy to clipboard, switch view to plain text mode 

    Any Tip?

    Thanks!!
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QX11EmbedContainer Problems

    What is the specific problem that you have now (i.e. please be more specific as to what "does not work" means)?

    Did you check that "wid" has a meaningful value?
    Perhaps you need to call
    Qt Code:
    1. self.container.show
    To copy to clipboard, switch view to plain text mode 
    before grabbing the winId / before starting your process?

    Embedding basically works in Qt4.4 (just gave it a try with
    Qt Code:
    1. #include <QtGui>
    2. #include <QX11EmbedContainer>
    3.  
    4. int main(int argc, char **argv)
    5. {
    6. QApplication app(argc,argv);
    7. c.show();
    8. qDebug() << c.winId();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 
    in a shell I entered:
    Qt Code:
    1. xterm -into <id that was output by Qt>
    To copy to clipboard, switch view to plain text mode 
    which produced an xterm was inside the Qt window.

    HTH

  3. #3
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default Re: QX11EmbedContainer Problems

    Yeah sorry.. I meant that the xterm console was not
    Embedding. And this exactly code was working on Qt4.3 and older. Since Qt4.4 this does not work for me.

    Using self.container.show does nothing either.

    I will continue digging this...

    NOTE: i was looking that i have not xterm process running :S
    Maybe is there a problem catching the winId...
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

Similar Threads

  1. flicker and wierd resize problems ...
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 18:00
  2. Problems with QTextEdit::cursorRect()
    By elcuco in forum Qt Programming
    Replies: 4
    Last Post: 1st April 2008, 10:34
  3. Replies: 2
    Last Post: 8th March 2007, 22:22
  4. QT4 Plugins - problems, problems
    By NormanDunbar in forum Qt Programming
    Replies: 6
    Last Post: 9th May 2006, 15:39
  5. problems with Opengl
    By SlawQ in forum Qt Programming
    Replies: 4
    Last Post: 12th February 2006, 22:49

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.