Results 1 to 3 of 3

Thread: Dialog positioning in GNOME

  1. #1
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Dialog positioning in GNOME

    I seem have come across a problem that exists only in GNOME. The position of a dialog (obtained using pos() ) is incorrect, if and only if the dialog hasn't been moved from its starting position.

    I have a included a small test program (Qt4) demonstrating this. At exit, it saves the position of the dialog to a text file ("test.txt"), which it reads upon starting again.

    With KDE and XFce (the only other window managers I have), the dialog is placed in the correct position i.e. the position at last exit. But with GNOME, the dialog is placed in the correct position only if it was moved by the user from where it was created, otherwise it is placed at the top left hand corner of the screen.

    I have search Qt forums and the Trolltech Task Tracker without finding any reference to this. Has anyone heard of such a possible bug before?

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication app(argc, argv);
    6. QDialog *dialog = new QDialog;
    7. QHBoxLayout *layout = new QHBoxLayout(dialog);
    8. QLabel *label = new QLabel("Testing widget->pos()", dialog);
    9. layout->addWidget(label);
    10.  
    11. // get position
    12. QFile file("test.txt");
    13. if (file.open(QIODevice::ReadOnly))
    14. {
    15. QString str = file.readAll();
    16. dialog->move(str.split(":")[0].toInt(), str.split(":")[1].toInt());
    17. file.close();
    18. }
    19.  
    20. dialog->show();
    21.  
    22. app.exec();
    23.  
    24. // write position
    25. if (file.open(QIODevice::WriteOnly))
    26. {
    27. QString str = QString("%1:%2").arg(dialog->pos().x())
    28. .arg(dialog->pos().y());
    29. file.write(str.toLocal8Bit());
    30. file.close();
    31. }
    32.  
    33. return 0;
    34. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Dialog positioning in GNOME

    I tested and noticed the "wrong" behaviour on GNOME. It worked seamless on KDE and WinXP.

    This problem might derive from X11's peculiarities, mentioned at: http://doc.trolltech.com/4.1/geometr...-peculiarities

  3. #3
    Join Date
    Feb 2006
    Posts
    11
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dialog positioning in GNOME

    Quote Originally Posted by jpn
    I tested and noticed the "wrong" behaviour on GNOME. It worked seamless on KDE and WinXP.

    This problem might derive from X11's peculiarities, mentioned at: http://doc.trolltech.com/4.1/geometr...-peculiarities
    I can imagine it would, but GNOME being one of the most widely used desktop enviroments on Linux, I would have thought that the Trolls would have found a way around this. That's if they know about it, of course ... I'll send in a bug report, and see what happens.

Similar Threads

  1. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 10:10
  2. Replies: 9
    Last Post: 13th August 2008, 18:07
  3. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  4. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.