Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Distorted icons on multiscreen
QtWS25 Last Chance

Distorted icons on multiscreen

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 3.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tomasz_grobelny
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

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

      Regards,
      Leon

      http://anavi.org/

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tomasz_grobelny
        wrote on last edited by
        #3

        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)!

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wladek
          wrote on last edited by
          #4

          Hi Leon,

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

          Regards,
          Wladek

          1 Reply Last reply
          0
          • L Offline
            L Offline
            leon.anavi
            wrote on last edited by
            #5

            [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

            http://anavi.org/

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tomasz_grobelny
              wrote on last edited by
              #6

              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"));
              

              }
              @

              1 Reply Last reply
              0
              • W Offline
                W Offline
                wladek
                wrote on last edited by
                #7

                [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 :)

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tomasz_grobelny
                  wrote on last edited by
                  #8

                  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).

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved