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. QWidget in QGraphicsView not scaled correctly in OSX
Forum Updated to NodeBB v4.3 + New Features

QWidget in QGraphicsView not scaled correctly in OSX

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicsviewscalingosx
12 Posts 2 Posters 4.2k Views 1 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi,

    Any chance you are experiencing this on a retina display ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    S 1 Reply Last reply
    0
    • SGaistS SGaist

      Hi,

      Any chance you are experiencing this on a retina display ?

      S Offline
      S Offline
      szergejbubka
      wrote on last edited by
      #3

      @SGaist I do not know how to test it. I use it in a VirtualBox, the resolution of which is not retina, and I do not have a real mac. But the effect depends on scaling. When scaled to 1, the painted parts and the text match. If I "zoom out", the unscaled painted parts become large relative to the properly scaled text.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #4

        I'm not sure I'm understanding you correctly: are you running a virtual machine on e.g. a Linux host with OS X installed in it ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          szergejbubka
          wrote on last edited by szergejbubka
          #5

          Yes, on Win7 host I am running OS X guest (El Capitan, if it matters), in VMWare, to be precise. I do not know very well either OS X or VMWare, so I cannot change the display resolution other than what is the normal resolution of my monitor (minus the window decorations of the virtual machine), which is a standard 1920x1080 or something.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #6

            Do you have a small code sample that triggers this behavior ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • S Offline
              S Offline
              szergejbubka
              wrote on last edited by
              #7

              Ok, so here is the minimal one-file example. It crashes after closing the window, obviously I should have created something with 'new'. But while it is running, it shows the bad behaviour on osx. By changing the parameters of scale(), the text of the button scales properly, but not the painted parts.

              // main.cpp
              #include <QApplication>
              #include <QMainWindow>
              #include <QGraphicsView>
              #include <QPushButton>
              #include <QGraphicsProxyWidget>
              
              int main(int argc, char *argv[])
              {
                  QApplication a(argc, argv);
              
                  QMainWindow window;
                  QGraphicsScene scene;
                  QGraphicsProxyWidget widget;
                  QPushButton button;
                  button.setText("TEXT");
                  widget.setWidget(&button);
                  scene.addItem(&widget);
                  QGraphicsView view;
                  view.setScene(&scene);
                  view.scale(2, 2); // .5 or 2
                  window.setCentralWidget(&view);
              
                  window.show();
              
                  return a.exec();
              }
              
              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #8

                Ok, I can reproduce it also.

                Seems you have found a bug. You should go to the bug report system and check whether it's something known, if not please consider opening a new report providing your code as a compilable project.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  szergejbubka
                  wrote on last edited by
                  #9

                  I think, somebody have already found it: https://bugreports.qt.io/browse/QTBUG-48681

                  Thanks.

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    You can vote for that issue and also provide your own findings, the more data is gathered the better to help debug that problem.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      szergejbubka
                      wrote on last edited by
                      #11

                      I did that, vote and my findings.

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        Thanks !

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        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