[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Shadow distance type
From:       p.stirnweiss_koffice () bluewin ! ch
Date:       2004-08-31 19:09:20
Message-ID: 412EB53F00026D04 () mssbzhb-int ! msg ! bluewin ! ch
[Download RAW message or body]


>-- Message original --
>From: Nicolas Goutte <nicolasg@snafu.de>
>To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>Date: Tue, 31 Aug 2004 20:59:08 +0200
>Subject: Re: Shadow distance type
>Reply-To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>
>
>On Tuesday 31 August 2004 20:51, p.stirnweiss_koffice@bluewin.ch wrote:
>> >-- Message original --
>>
>> From: Nicolas Goutte <nicolasg@snafu.de>
>>
>> >To: For developer's discussion about KOffice <koffice-devel@mail.kde.org>
>> >Date: Tue, 31 Aug 2004 20:20:31 +0200
>> >Subject: Re: Shadow distance type
>> >Reply-To: For developer's discussion about KOffice
>> > <koffice-devel@mail.kde.org>
>> >
>> >
>> >Please use double, as the unit widgets in KOffice are based on double.
>> >
>> >And I would perhaps not change it to KDoubleNumInput but the corresponding
>> >
>> >unit widget.
>>
>> I meant a KDoubleSpinBox but I guess this is not the proper one either.
>Is
>> the corresponding unit widget to be found in KOffice? or KDE?
>
>Sorry! By "unit widgets" I meant the widgets defined in:
>koffice/lib/kofficeui/koUnitWidgets.h
>
>So I suppose that you would need a KoUnitDoubleSpinBox
>
>(Unit widgets are supposed to be used everywhere, but the implementation
>was 
>closely related to their use in Karbon. I have tried to make the class more
>
>general (always based on points) but it is not really finished.)
>
>(...)
>> >be
>> >able to do it too, even if it is not completly supported. The other
>> > problem
>> >
>> >is the overflow of "long int".)
>>
>> By the way, is it a big problem if I had a short int to kotextformat (for
>> the shadow direction)? This would allow for a cleaner code in the widget
>> implementation. On the other hand I can keep the "uggly temporary code"
>a
>> bit longer. I also thought about a different implementation but this would
>> involve converting a double into an int (keeping only the integer part
>and
>> the sign is OK) but I don't know how to do it.
>
>Do you mean code like:
>
>double d;
>int i;
>i =int(d);
>
>(You also have the function qRound )
>
>But probably I misunderstood you.
>

probably, waht I did was :

    int dirx = shadowDistanceX = 0 ? 0 : shadowDistanceX / QABS( shadowDistanceX
);

where shadowDistanceX is a double. The result I was expecting was dirx =
either -1 or 0 or 1, depending on the sign, but it does not seem to work
for some reasons.

>>
>> Pierre
>
>Have a nice day!
>
>>
>> >Have a nice day!
>> >
>> >On Tuesday 31 August 2004 15:52, p.stirnweiss_koffice@bluewin.ch wrote:
>> >> Hello,
>> >>
>> >> Just to open a quick discussion about the type of variable used for
>the
>> >> shadow distance.
>> >> The widget used is a QSpinbox and provide a unique distance in the
int
>> >> format. This is then converted in a distancex and distancey in double
>> >> format (used in kotextformat. The code asks to change the QSpinBox
to
>>
>> a
>>
>> >> KDoubleNumInput. The user is asked the distance in points (as opposed
>>
>> to
>>
>> >mm
>> >
>> >> or in).
>> >>
>> >> So the question is: why using a double if the unit is points (can we
>> >> display part of a point)? If the unit we want is point, wouldn't it
>be
>> >
>> >more
>> >
>> >> memory efficient to use an int in kotextformat?
>> >> Or do we want to provide the distance in mm (or inches)? And therefore
>> >
>> >use
>> >
>> >> doubles?
>> >>
>> >> Pierre
>> >>
>> >> _______________________________________________
>> >> koffice-devel mailing list
>> >> koffice-devel@mail.kde.org
>> >> https://mail.kde.org/mailman/listinfo/koffice-devel
>> >
>> >_______________________________________________
>> >koffice-devel mailing list
>> >koffice-devel@mail.kde.org
>> >https://mail.kde.org/mailman/listinfo/koffice-devel
>>
>> _______________________________________________
>> koffice-devel mailing list
>> koffice-devel@mail.kde.org
>> https://mail.kde.org/mailman/listinfo/koffice-devel
>
>_______________________________________________
>koffice-devel mailing list
>koffice-devel@mail.kde.org
>https://mail.kde.org/mailman/listinfo/koffice-devel

_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic