Distorted icons on multiscreen



  • I have a problem with sample Qt application (standarddialogs) modified to display dialog on every screen (as non modal dialog). The problem is when I want to display a message box that has an icon. On default screen (the one from which the application has been started) everything is fine. But when I want to see the very same message box on the second screen then the icon is distorted. My configuration is solaris 5.10/SunPro compiler/Qt 4.7.2/Xnest over vnc. I have also tested on linux/gcc/Qt 4.7.2/Xnest (without vnc;the same incorrect behaviour can be observed) and linux/gcc/Qt 4.7.2/Xephyr (without vnc; icons are displayed correctly).
    What may be the cause of this problem and how do I fix it? Do I need to compile Qt with some special options? Or is it a problem with Xserver configuration?



  • Could you please share a screenshot? Sharing the source code for the message box would be useful too.

    Regards,
    Leon



  • Here is the code for displaying the message (as in the example):
    @ reply = QMessageBox::critical(this, tr("QMessageBox::critical()"),
    MESSAGE,
    QMessageBox::Abort | QMessageBox::Retry | QMessageBox::Ignore);
    @

    Here is the modified code for main to display the dialog on all screens:
    @
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);

    QString translatorFileName = QLatin1String("qt_");
    translatorFileName += QLocale::system().name();
    QTranslator *translator = new QTranslator(&app);
    if (translator->load(translatorFileName, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
        app.installTranslator(translator);
    
    for(int i=0;i<app.desktop()->screenCount();i++)
    {
        Dialog* dialog = new Dialog(app.desktop()->screen(i));
        dialog->show();
    }
    return app.exec();
    

    }
    @

    And here is the result:
    !http://grobelny.oswiecenia.net/misc/Screenshot-2.png(Distorted icon)!



  • Hi Leon,

    And how does the constructor of the Dialog class look like?

    Regards,
    Wladek



  • [quote author="wladek" date="1305099838"]Hi Leon,

    And how does the constructor of the Dialog class look like?

    Regards,
    Wladek[/quote]

    Hi Wladek,

    Sorry but this thread belongs to tomasz_grobelny so I cannot provide you more details. Hope that he will provide source code of the Dialog :)

    Cheers,
    Leon



  • This application is dialogs/standarddialogs application with only main function slightly changed (as above).
    Here is the (shortened) constructor for Dialog:
    @Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    {
    errorMessageDialog = new QErrorMessage(this);

    int frameStyle = QFrame::Sunken | QFrame::Panel;
    
    //(...)
    criticalLabel = new QLabel;
    criticalLabel->setFrameStyle(frameStyle);
    QPushButton *criticalButton =
            new QPushButton(tr("QMessageBox::critica&l()"));
    
    //(...)
    connect(criticalButton, SIGNAL(clicked()), this, SLOT(criticalMessage()));
    
    //(...)
    QGridLayout *layout = new QGridLayout;
    layout->setColumnStretch(1, 1);
    layout->setColumnMinimumWidth(1, 250);
    //(...)
    layout->addWidget(criticalButton, 10, 0);
    layout->addWidget(criticalLabel, 10, 1);
    //(...)
    setLayout(layout);
    
    setWindowTitle(tr("Standard Dialogs"));
    

    }
    @



  • [quote author="leon.anavi" date="1305100875"]
    [quote author="wladek" date="1305099838"]Hi Leon,

    And how does the constructor of the Dialog class look like?

    Regards,
    Wladek[/quote]

    Hi Wladek,

    Sorry but this thread belongs to tomasz_grobelny so I cannot provide you more details. Hope that he will provide source code of the Dialog :)

    Cheers,
    Leon

    [/quote]

    Yes yes...my mistake, sorry :)



  • Seems like a bug in Qt's X11 graphics system. If I set QT_GRAPHICSSYSTEM environment variable to "raster" then the icons are displayed correctly. It seems to be an acceptable workaround (but it would still be nice to find and fix the actual bug).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.