Results 1 to 2 of 2

Thread: QGraphicsGridLayout Broken

  1. #1
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsGridLayout Broken

    Hi

    I have an application that uses a QGraphcsiGridLayout in a QGraphicsScene/View that works on 4.4.3 but does not on 4.6.1.

    I've crafted a minimal copy to reproduce it. It subclasses the QGraphicsLayoutItem and QGraphicsEllipse classes to create a graphics object that can be added to the layout.

    On 4.4.3 I get the grid of ellipsis displaying ok. When I compile and run under 4.6.1 the screen is shown blank.

    Can anyone tell me what's wrong?

    Here is the .pro file:

    TEMPLATE = app
    TARGET = GraphicsLayoutTest
    DESTDIR = ../Release
    CONFIG += release
    INCLUDEPATH += ./GeneratedFiles \
    ./GeneratedFiles/Release \
    .
    DEPENDPATH += .
    MOC_DIR += ./GeneratedFiles/release
    OBJECTS_DIR += release
    UI_DIR += ./GeneratedFiles
    RCC_DIR += ./GeneratedFiles

    #Include file(s)
    include(GraphicsLayoutTest.pri)
    and .pri file:

    #Header files
    HEADERS += ./ellipseitem.h \
    ./graphicslayouttest.h

    #Source files
    SOURCES += ./ellipseitem.cpp \
    ./graphicslayouttest.cpp \
    ./main.cpp

    #Forms
    FORMS += ./graphicslayouttest.ui

    #Resource file(s)
    RESOURCES += ./graphicslayouttest.qrc

    Thanks, Paul
    Attached Files Attached Files
    Last edited by oberlus; 14th March 2010 at 18:06.

  2. #2
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsGridLayout Broken

    The problem was solved by changing the implementation of EllipseItem::setGeometry to call the QgraphicsLayoutItem base class setGeometry method before setRect():

    QgraphicsLayoutItem::setGeometry(rect); // Call the base class first
    setRect(rect);

    Hope this helps someone...

Similar Threads

  1. Replies: 1
    Last Post: 10th January 2010, 19:51
  2. Qt4.3 broken by Qt4.4
    By bnilsson in forum Installation and Deployment
    Replies: 2
    Last Post: 4th January 2008, 11:41
  3. QValueVector in Qt 3(.3.8) is broken
    By fear in forum Qt Programming
    Replies: 5
    Last Post: 5th July 2007, 15:58
  4. Broken QFileSystemWatcher in Qt 4.2.3 under Windows?
    By No-Nonsense in forum Qt Programming
    Replies: 4
    Last Post: 28th March 2007, 14:14

Tags for this Thread

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.