Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-39206

QGraphicsProxyWidget renders with incorrect DPI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.6
    • Widgets: GraphicsView
    • None
    • Mac OS 10.9

    Description

      On a high-DPI screen, widgets proxied by a QGraphicsProxy are rendered at a low DPI. The example below draws a widget and a proxy widget; the proxy looks much worse.

      This has been fixed in Qt 5.2.12 – would it be possible to backport the fix to Qt 4.8.x?

      main.cpp
      #include <QWidget>
      #include <QPainter>
      #include <QGraphicsScene>
      #include <QGraphicsView>
      #include <QApplication>
      
      class Circle : public QWidget
      {
      public:
          Circle(QWidget* parent=NULL)
              : QWidget(parent)
          {
              this->setFixedSize(60, 60);
          }
      
          void paintEvent(QPaintEvent* event)
          {
              QPainter painter(this);
              painter.setBrush(QBrush(Qt::red));
              painter.drawEllipse(10, 10, 40, 40);
          }
      };
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QGraphicsScene scene;
          QGraphicsView view(&scene);
          Circle c1(&view);
          Circle c2;
          scene.addWidget(&c2);
          view.show();
          view.raise();
          return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            mkeeter Matthew Keeter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes