Results 1 to 4 of 4

Thread: Launching GUI application on different X11 display

  1. #1
    Join Date
    Dec 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Launching GUI application on different X11 display

    Hi all.
    I create simple application
    mainwindow.h:

    Qt Code:
    1. #include <QMainWindow>
    2. #include <QTextBrowser>
    3. #include "mainwindow.h"
    4.  
    5. class MainWindow : public QMainWindow {
    6. Q_OBJECT
    7.  
    8. public:
    9. MainWindow();
    10. };
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp:

    Qt Code:
    1. #include "mainwindow.h"
    2.  
    3. MainWindow::MainWindow() : QMainWindow(){
    4. setCentralWidget(new QTextBrowser());
    5. }
    To copy to clipboard, switch view to plain text mode 

    main.cpp:

    Qt Code:
    1. #include <QApplication>
    2. #include "mainwindow.h"
    3.  
    4. int main(int argc, char *argv[]) {
    5. QApplication a(argc, argv);
    6. MainWindow w;
    7. w.show();
    8. return a.exec();
    9. }
    To copy to clipboard, switch view to plain text mode 

    Everything works, but when i ssh myself and run
    Qt Code:
    1. ./MyApp -display :0.0
    To copy to clipboard, switch view to plain text mode 
    application starts for a while and then it fail:
    Qt Code:
    1. ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include//QtCore/qlist.h, line 463
    2. Aborted
    To copy to clipboard, switch view to plain text mode 
    Any ideas how to manage starting application on defined X display ?
    Thanks, regards BasY

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

    Default Re: Launching GUI application on different X11 display

    I never had any problems running Qt applications over ssh. I doubt the error is caused by the fact you are using a different display.
    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.


  3. #3
    Join Date
    Dec 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Launching GUI application on different X11 display

    It looks like QT BUG, because when I use QLabel, i can run this application over ssh without fail..

    Qt Code:
    1. MainWindow::MainWindow() : QMainWindow(){
    2. setCentralWidget(new QLabel("OK"));
    3. }
    To copy to clipboard, switch view to plain text mode 
    Also when i ssh myself: ssh -X me@my_ip i can run app without problems, but this is not solution because i need to run my app using cron...

    Application fail when i use QTableWidget too...

    Maybe i have to use QX11EmbedWidget or add some display config code in main(...) method.

    Any ideas ?
    Last edited by basy; 3rd December 2010 at 18:07.

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

    Default Re: Launching GUI application on different X11 display

    The thing is Qt has nothing to do with display settings. It's just an address of the X Server XLib connects to, the rest is a matter of where X calls go so I'd look for trouble in configuration of your system(s) and not Qt itself.
    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. Replies: 6
    Last Post: 19th September 2010, 05:42
  2. Application Resizing on Display resolution change
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2010, 12:12
  3. Replies: 0
    Last Post: 14th April 2010, 12:21
  4. Application doesn't display images
    By satoshi in forum Qt Programming
    Replies: 3
    Last Post: 2nd January 2010, 11:33
  5. Replies: 5
    Last Post: 15th June 2007, 22:08

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.