Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2009

    qt creator, simple graphical examples


    I'm trying to compile a simple graphical example from QtCreator, for example concentriccircles.
    When I compile for standard settings (x86) it compiles and runs fine on the computer.
    If I move project to Nokia_N97_SDK_v1.0 (Qt 4.6.1), I'm getting error:

    make -s -C \Qt\2010.01\qt\examples\painting\concentriccircles -f "MAKEFILE_0XA000A64A.MK" TO_ROOT=..\..\..\..\..\.. EPOCBLD=\S60\devices\Nokia_N97_SDK_v1.0\EPOC32\BUILD\MAKEFILE_0XA000A64A\GCCE TO_BLDINF=..\..\..\..\..\..\Qt\2010.01\qt\examples\painting\concentriccircles PLATFORM=GCCE CFG=UREL FINAL
    \S60\devices\Nokia_N97_SDK_v1.0\EPOC32\BUILD\Qt\2010.01\qt\examples\painting\concentriccircles\CONCENTRICCIRCLES_0XA000A64A\GCCE\urel\circlewidget.o: In function `CircleWidget::paintEvent(QPaintEvent*)':
    circlewidget.cpp:(.text+0x19e): undefined reference to `QPen::QPen(QBrush const&, double, Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)'
    make[2]: *** [\S60\devices\Nokia_N97_SDK_v1.0\epoc32\release\gcce\urel\concentriccircles.exe] Error 1
    make[1]: *** [TARGETCONCENTRICCIRCLES_0XA000A64A] Error 2
    In general (checked with other examples) there is a problem with methods getting double which does not get conversed to qreal.
    I can override this (creating QPen::QPen(QBrush const&, double, Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle) that calls QPen::QPen(QBrush const&, qreal, Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)) but it causes application to crash :/

    Any ideas?
    Please let me know what additional info I can provide for you.

    [edit] Also, when trying to
    painter.setPen(QPen(QColor(0, diameter / 2, 127, alpha), (float)(3), Qt::SolidLine, Qt::SquareCap, Qt::BevelJoin));
    I get the same problem (either compilation error or application crush if I define overridden function). In short, I cannot access any method that accepts qreal.
    Last edited by hoopbeat; 2010-02-03 at 08:52.

  2. #2
    Regular Contributor
    Join Date
    Sep 2008

    Re: qt creator, simple graphical examples

    Hi, your issue is indeed compiler based.

    'Problem' here is that compiler defaults all real numbers to double precision and we in Symbian define qreal as float precision (speed optimisation) i.e.

    void foo(qreal arg){}
    will have signature:
    void foo(float arg)

    Now the compiler won't do automatic conversion from double to float as there is a loss of precision so what you need to do is
    instead of

    In your example I don't know why this (float)1.23 would fail though as that should be explicit conversion.


Similar Threads

  1. Qt for Symbian development resources
    By liuxg in forum [Archived] Qt General ( Qt技术)
    Replies: 55
    Last Post: 2011-01-26, 04:06
  2. kinetic scrolling
    By stalep in forum Nokia N9
    Replies: 10
    Last Post: 2009-12-08, 12:41
  3. Senior QT Client Developer (Dublin, Ireland)
    By marynyc in forum News and Announcements
    Replies: 0
    Last Post: 2009-06-02, 18:24

Posting Permissions

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