QWidget in QGraphicsView not scaled correctly in OSX

My program uses QWidgets within a QGraphicsView. The view can be scaled, and it shows the widgets scaled perfectly in Windows and Linux, but not in OSX. The painted parts are not scaled, just the texts. Here are the same situation in Windows, Linux and OSX.

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

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.

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.