×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Issue with QPainter::drawPoint

    Hallo!
    i am developing in Qt... and i hit this strange behaviour only on Symbian.

    Inside a paint event i do some transformations (scale and translation) to the painter, then i paint some stuff.

    Code:
    QPointF my_point( .., ..);
    
    QPen pen;
    pen.setWidthF(0);
    pen.setColor( color );
    
    painter.drawEllipse( my_point, 10.0, 10.0 ); 
    painter.drawPoint( my_point );
    The ellipse is drawn correctly as an ellipse. The point, instead, is draw as an orizzontal line very long!

    This behaviour is not present on the Simulator, it works just fine. With the debugger i cannot see any problem. On the device, my_point still has the correct values, but drawPoint draws a line!

    Can it be related to float-double precision issues on Symbian?

    I am quite out of idea, what could i try to pinpoint this problem and solve it?

    thank you!
    Last edited by gardiol; 2011-01-13 at 15:00. Reason: typo fix

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Issue with QPainter::drawPoint

    Is this only happening on the Symbian^3 devices like the N8? Have you tried setting the graphics system to "raster" before constructing your app. (That's not really a fix - more of a workaround with poor performance that could pinpoint the bug to the OpenVG paint engine).

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Re: Issue with QPainter::drawPoint

    It does happen on S60v5 using Qt 4.6.3... Probably happen also on Symbian^3 but i cannot test. It does not happen on Windows on the emulator,

    How do i set the graphics system to raster?

  4. #4
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Issue with QPainter::drawPoint

    Graphics system will already be raster on S60v5. It quite possibly is a floating point precision issue in that case - I believe Symbian uses single precision.

    Have you tried just drawing a point without the transforms?

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Re: Issue with QPainter::drawPoint

    The point draws correctly without the transforms, its a problem of precision, very probably.

    Do you have any suggestions on how to try to fix this problem? Its affecting badly some sides of my application...
    Do you suggest getting rid of the transformations provided by Qt and do some my own? I cannot see any other possible workaround...

  6. #6
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Issue with QPainter::drawPoint

    First you should report it as a bug in the Qt issue tracker! Perferably giving them some minimal code to reproduce it. Possibly they've done something bad that can easily be fixed in the official Qt 4.7.x release for Symbian...

    I can only imagine that the scaling is causing the problem... it might be worth seeing if the problem only occurs for points - for example have you tried drawing a single pixel line instead?

  7. #7
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Re: Issue with QPainter::drawPoint

    Actually, the problem was showing for points, but i did not care (not using points). Later on, with some particular numbers (smaller precision), it started showing also for lines! And here is where i started caring about the problem.

    I can tell you that for ellipses it works correctly, even when points and lines fails... But are much more slower to draw.

    Tomorrow i will report the bug. What pisses me off is the extreme slow compilation time inside the Nokia Qt SDK which make everithng so slow to test on the device.

  8. #8
    Registered User
    Join Date
    Jul 2010
    Posts
    99

    Re: Issue with QPainter::drawPoint

    Opened bug QTBUG-16632...

  9. #9
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Issue with QPainter::drawPoint

    Looks like it's already fixed in Qt 4.7 - good to know.

    The slow compilation is because the IDE always causes everything to be rebuilt - not sure if they're planning to fix that. Power users end up editing in the IDE but doing their builds from the command line.

Similar Threads

  1. QPainter translate
    By mj_124949727@126.com in forum Qt
    Replies: 1
    Last Post: 2010-10-19, 08:17

Posting Permissions

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