[Kde-java] QSizePolicy
Richard Dale
kde-java@kde.org
Sun, 26 Jan 2003 19:08:55 +0000
On Saturday 25 January 2003 12:53 pm, Marco Ladermann wrote:
> BTW: Your anouncement to put win dll's of the QtJava bindings on SF was a
> big plus for my argumentation pro QtJava in my company.
Ah - that was before I actually looked at the license that Trolltech had given
me. I found it was for a dual X11/Mac OS X one, so I can't build any Windows
dlls still. And I don't have a Windows development environment anyway (that's
what I told the trolls, and why they've given me that Mac/X11 license). But
porting the QtJava bindings should be trivial for someone with the right
Windows development environment. If I can get them to build on Mac OS X, it
will remove any X11-specific methods which wouldn't have compiled on Windows
either. Then just use qmake to generate the build environment for the dll.
> And now to something completely different!
>
> QSizePolicy (C++) has a constructor
> QSizePolicy ( SizeType hor, SizeType ver, uchar horStretch, uchar
> verStretch, bool hfw = FALSE )
>
> which is not defined in the Java proxy. Therefore I had to change the uic
> approach from
>
> setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3,
> (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWid
> th() ) );
>
> to something like:
> QSizePolicy cwSizePolicy = new QSizePolicy();
> cwSizePolicy.setHorData( 3 );
> cwSizePolicy.setVerData( 5 );
> cwSizePolicy.setHorStretch( 0 );
> cwSizePolicy.setVerStretch( 0 );
> cw.setSizePolicy( cwSizePolicy );
>
> This is of course no problem, as long as every "property" class has a noarg
> constructor, otherwise I have to introduce handling for special cases :(.
It has this constructor after the recent fixes to the HEAD and KDE_3_1_BRANCH
branches:
public QSizePolicy( int hor, int ver, short hors, short vers, boolean hfw);
-- Richard