Results 1 to 4 of 4

Thread: Graphics Item display changed from Qt4.8 to Qt5.4

  1. #1
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Graphics Item display changed from Qt4.8 to Qt5.4

    Hi,
    Graphics View.PNG

    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
    Qt Code:
    1. QBrush qBrush;
    2. qBrush.setStyle(Qt::SolidPattern);
    3. qBrush.setColor(Qt::red);
    4. QGraphicsEllipseItem* pqCircleItem = scene->addEllipse(qX,qY,10,10,Qt::NoPen,qBrush);
    5. pqCircleItem ->setFlag(QGraphicsItem::ItemIsSelectable);
    To copy to clipboard, switch view to plain text mode 

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

    Thanks,
    Òscar Llarch i Galán

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Graphics Item display changed from Qt4.8 to Qt5.4

    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:
    Qt4.png

    Qt5 version:
    Qt5.png

    Projects:
    Qt4.zip
    Qt5.zip

    Thanks,
    Òscar Llarch i Galán

  3. #3
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Graphics Item display changed from Qt4.8 to Qt5.4

    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,
    Òscar Llarch i Galán

  4. #4
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Graphics Item display changed from Qt4.8 to Qt5.4

    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,
    Òscar Llarch i Galán

Similar Threads

  1. How to detect when item is changed in the table view?
    By schmimona in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2011, 09:06
  2. Scale dependent display of graphics Item
    By aalexei in forum Qt Programming
    Replies: 0
    Last Post: 17th February 2011, 23:32
  3. Replies: 2
    Last Post: 9th August 2010, 17:53
  4. QDateEdit Resize for Changed Display Format?
    By ChrisW67 in forum Newbie
    Replies: 5
    Last Post: 5th June 2009, 10:02
  5. Catch item changed
    By nina1983 in forum Qt Programming
    Replies: 2
    Last Post: 18th July 2008, 14:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.