×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    90

    Problems with QGrsphicsItems

    Hello,

    I have a weird problem and I don't know how can I solve it.

    I have a QGraphicsScene, with two QGraphicsItems. One "is falling" and the other is the floor. The falling should collide with the floor and stay on its top.

    For that, I use projection vectors and few long functions... it has no sense to paste them here.

    The program works fine in Visual C++ with Qt, and it does as well with the simulator. When they collide, there is a small error of 1e-6 or something like that, nothing important. BUT when I try the application in the phone the error is always 0.6 or 0.2... it's really weird and it has no sense because the code is exactly the same.

    Well, I'll debug step by step... but it's even worse because my code gives me back that there is no collision (please note I'm using my own collision functions, not the Qt one). But it should!

    Do you have, for any chance, any sort of hint or something like that? does Qt work differently when mapping the positions in the mobile phone? Maybe moveBy() works differently?
    Last edited by jano_alex_es; 2010-11-13 at 00:02.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Problems with QGrsphicsItems

    Hi,
    I guess you are mixing floats, doubles and qreals. Keep in mind that qreals are defined as double by Qt on all platforms except for those using an ARM CPU.

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    90

    Re: Problems with QGrsphicsItems

    I am working with floats always, in both versions. That's why I don't care about the minimal error in PC and simulator.

  4. #4
    Registered User
    Join Date
    Oct 2009
    Posts
    90

    Re: Problems with QGrsphicsItems

    sorry, I was wrong. Edited.
    Last edited by jano_alex_es; 2010-11-13 at 10:42.

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    90

    Re: Problems with QGrsphicsItems

    Well, it's solved.

    The abs function works differently if it's executed in PC or simulator and Symbian. In the first class it converts the symbol of a number in possitive, in Symbian it does the same BUT it rounds the number too.

Similar Threads

  1. still have problems?
    By khossy in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2006-11-09, 10:59
  2. Problems
    By Pepper_91 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2006-02-07, 19:19
  3. Some problems.
    By Typhexx in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2006-01-07, 07:52
  4. Problems
    By Igor-a in forum Symbian
    Replies: 1
    Last Post: 2004-10-09, 21:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×