PDA

View Full Version : Graphics Item display changed from Qt4.8 to Qt5.4



^NyAw^
20th January 2015, 12:34
Hi,
10894

I have updated a project that uses a QGrpahicsView and adds items using "scene->addRect(x,y,w,h,Qt::NoPen,qBrush)" and "scene->addEllipse(...)". "qBrush" is a simple QBrush that modifies the color using "qBrush.setColor(Qt::red)".

The problem is that as you can see on the attached image, when I select and item, the graphics view displays some kind of rectangle using a dash pattern. This doesn't appear using Qt4.8

Here you have the adding items code


QBrush qBrush;
qBrush.setStyle(Qt::SolidPattern);
qBrush.setColor(Qt::red);
QGraphicsEllipseItem* pqCircleItem = scene->addEllipse(qX,qY,10,10,Qt::NoPen,qBrush);
pqCircleItem ->setFlag(QGraphicsItem::ItemIsSelectable);


I'm using Windows XP + Qt 5.4 (openGL) + Visual Studio 2010

Thanks,

^NyAw^
21st January 2015, 19:02
Hi,

Here you have the example for Qt4 and Qt5. If anyone can test if you have the same behaviour...

As you can see on attached image there is a difference on the mark of the selected item.

Qt4 version:
10895

Qt5 version:
10897

Projects:
10896
10898

Thanks,

^NyAw^
22nd January 2015, 12:44
Hi,

If not setting the viewport with a QGLWidget the rectangle with dash pattern doesn't appear but there is no graphic identification on wich item is selected.

Thanks,

^NyAw^
6th February 2015, 16:17
Hi,

Can anyone test the example on a different version than Qt 5.4.0 (Visual Studio 2010 - OpenGL)?
I have tested with Qt5.4.0 on Windows XP and Windows 7 with same result.

Thanks,