QGraphicsScene retina support for QWidgets
-
The retina support does not work when qt widget is added to QGraphicsScene?
Below is the code i am working on.
@
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;QGraphicsView view; QGraphicsScene *scene = new QGraphicsScene(0, 0, 500, 500, &view); scene->setBackgroundBrush(Qt::green); view.setScene(scene); QWidget *widget = new QWidget(); QVBoxLayout *lay = new QVBoxLayout(); widget->setLayout(lay); QSlider *slider = new QSlider(Qt::Horizontal); lay->addWidget(slider); scene->addWidget(widget); view.show(); return a.exec();
}
@After changing slider's position the icon is disappeared. Someone know if it possible to fix it and how?
[fixed typo in title, Eddy]
-
Hi,
Welcome to the forum.
Your code works for me. There must be something else going on.
Can you show us the code of your MainWindow class?Also, what OS you're on, which Qt version?
-
I used Qt5.2.0
I test it on my Max OS X 10.8 and 10.9.1. and its does not work.
In my MainWindow nothing extra.Are you sure that you tested it on retina display?
Thanks for such soon respond@
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}
@ -
I misunderstood the environment you are working in. I thought you didn't see the slider movable part. I tested on windows 7. There it works fine.
Maybe someone else on os x can test it for you.
Can you elaborate on the "icon dissappearing" part? Maybe a screenshot?
-
I use Mac OS X 10.8.4 and Mac OS X 10.9.1.
In normal display it works fine but in retina display the movable part of slider disappears. Sometimes even the whole slider is not visible.I put the links of screen shot bellow:
"Before":http://www.dropbox.com/s/7hwh6vvc3mo566t/Screen1.png
"After":http://www.dropbox.com/s/2ptitofnp87rut1/Screen2.png -
You can check also on "JIRA":https://bugreports.qt-project.org/secure/Dashboard.jspa for a reported bug with Retina . In case you cannot find anything reported there, please file a bug report.
If you put a link to this thread there, all info here can be easily found. Please add the bug report number here as a tag for easy finding it back.