Results 1 to 8 of 8

Thread: Windows XP and QGraphicsView/Scene

  1. #1
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Windows XP and QGraphicsView/Scene

    I am developing a simple game using Qt 4.2.2 and QGraphicsView/Scene. Everything works properly on Linux and on at least one Windows 2000 box. However, on several Windows XP boxes, the items in my send are not displayed properly. In order for them to display properly, I have to to switch to different window and then back again and the items appear. Sometimes items will show up on their own, but not often. Currently after I add my items I issue a scene-update() to, hopefully, repaint the scene. I have tried adding qApp->processEvents() before and after the update and while this sometimes provides a little more items to display, it is not 100% effective. If I call setViewport on the QGraphicsView to use QGlWidget, everything is displayed fine. I would rather not use OpenGL as it is much slower on both windows and linux. I can post code if neccessary but it is rather long so I would first like to see if anyone has any ideas. I have tried 4.2.0 and 4.2.1 with the same issue. I am using mingw. Is there any using in trying a 4.30 snapshot?

    Thanks
    mAx

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Windows XP and QGraphicsView/Scene

    Without seeing the code we won't be able to help you much. OpenGL is slower than a regular widget? Hmm.... do you have hardware acceleration in your gfx chip?

    What would help is a minimal compilable example reproducing the problem - your own code is probably quite complex and pinpointing the exact reason of a faulty behaviour will be much easier with a simple snippet of code.

    BTW. Have you tried running the application on a different WinXP box? There might be some extensions or tweaks in your system causing the incorrect behaviour...

  3. #3
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP and QGraphicsView/Scene

    I can only test the OpenGL/Windows combo under VMware, so that is probably why it is slow. It is also slow in my linux laptop which has an integrated Intel chip with so-so performance. I have tried the program on different XP boxes, all with the same result. I will try to put together a simple demo that illustrates my problem. I should also note that the program works fund under Wine (which I believe is emulating win98).

    Thanks
    mAx

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Windows XP and QGraphicsView/Scene

    I guess you should test the app on a real XP box, after all, emulators are just emulators.

  5. #5
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: Windows XP and QGraphicsView/Scene

    Okay, here is an example. It is sort of different in that the items don't even show up if you switch windows. I tried this on a real XP box with the same results.

    Thanks
    mAx
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2006
    Location
    England
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Post Re: Windows XP and QGraphicsView/Scene

    Looking at your problem, I think it may well be related to mine (Possible QGraphicsView/Scene bug). I found that the items would only show up if the window was resized.
    It's possible that it is a bug in a recent Qt version. I've had the problem on Qt 4.2.2 and KDE's svn qt-copy both under Linux. What versions were your executables built with?

  7. #7
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Windows XP and QGraphicsView/Scene

    I think there's a bug in this GraphicsTest example. It doesn't add any items to the scene. The view is basically visualizing... nothing :-).
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  8. #8
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Windows XP and QGraphicsView/Scene

    My bad, I misread the example, items are indeed added.

    The bug is that the items are added at positions like -4200000, 536, but the top-left corner of the scene is set to (0, 0). The defOffset variable, which is added to all X coordinates, seems to be uninitialized. Removing this variable, or setting it to 0, gives me rects and diamonds.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

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.