[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: koffice/kexi/shapes/relationdesign
From: Thomas Zander <zander () kde ! org>
Date: 2009-08-25 3:54:16
Message-ID: 200908250654.17201.zander () kde ! org
[Download RAW message or body]
I suggest you recreate the connection points on resize. Its not as expensive
as it may sound ;) The parameter shapes recreate their vector
representation every time as well. Works great!
On Tuesday 25. August 2009 00.45.46 Adam Pigg wrote:
> SVN commit 1015213 by piggz:
>
> create connection points on each side of the shape for each field...todo:
> the points move when the shape is resized which in this case is
> undesirable (atleast for vertical changes), maybe KoShape could allow
> options to be specified when creating points which affects how they are
> moved, or methods could be added to control the placement of existing
> points?
>
> CCMAIL: koffice-devel@kde.org
>
> M +22 -3 kexirelationdesignshape.cpp
> M +2 -0 kexirelationdesignshape.h
>
>
> --- trunk/koffice/kexi/shapes/relationdesign/kexirelationdesignshape.cpp
> #1015212:1015213 @@ -115,6 +115,7 @@
> sf->notnull = e.attribute("notnull").toInt();
> m_fieldData.append(sf);
> }
> +addConnectionPoints();
> return true;
> }
>
> @@ -194,8 +195,6 @@
> }
> update();
>
> - //Connect to the new database
> - //m_connection = new KexiDB::Connection();
> }
> }
>
> @@ -231,7 +230,27 @@
> }
>
> }
> -
> + addConnectionPoints();
> update();
> }
> }
> +
> +void KexiRelationDesignShape::addConnectionPoints()
> +{
> + uint i = 0;
> + int offset = 0;
> +
> + int point_count = connectionPoints().count();
> +
> + for (int j = 0; j < point_count; ++j) {
> + removeConnectionPoint(0);
> + }
> +
> + foreach (SimpleField *column, m_fieldData) {
> + ++i;
> + offset = (13.0*i) + 15;
> + addConnectionPoint(QPointF(0,offset));
> + addConnectionPoint(QPointF(boundingRect().width(), offset));
> +
> + }
> +}
> --- trunk/koffice/kexi/shapes/relationdesign/kexirelationdesignshape.h
> #1015212:1015213 @@ -51,6 +51,8 @@
> virtual bool loadOdfFrameElement( const KoXmlElement & element,
> KoShapeLoadingContext & context );
>
> private:
> + void addConnectionPoints();
> +
> //Data for display
> QString m_relation;
> QString m_database;
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@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