-
Re: Composed widget
--===============1899242920==
Content-Type: multipart/signed;
boundary="nextPart1342059.LtUp1hhfVK";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
--nextPart1342059.LtUp1hhfVK
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
On Sunday 29 January 2006 17:32, G=E1bor Lehel wrote:
[color=blue]
> Perhaps something like:
>
> class MyWidget: public KLineEdit
> {
> MyWidget( QWidget *parent =3D 0, const char *name =3D 0 )
>
> : KLineEdit( new QHBox( parent ), name )
>
> {
> new KPushButton( parent() );
> }
> };[/color]
While I think this will work, it will break in the event that MyWidget is=20
reparented or asked for its size() or geometry()
[color=blue]
> Note that I haven't actually tried this, and there may be a cleaner
> solution. (Such as just providing KLineEdit *lineEdit() const { return
> m_lineEdit; } in a class derived from QHBox.)[/color]
Definitely cleaner.
=46or example QSpinBox does it this way.
Cheers,
Kevin
=2D-=20
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
Moderator: [url]www.mrunix.de[/url] (German), [url]www.qtcentre.org[/url]
--nextPart1342059.LtUp1hhfVK
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQBD3PU2nKMhG6pzZJIRAkJ1AJ9/1DtcotwDxeiMFmKYNunJbNGKSACeP+2P
dyFabszpTuRYzT1g6X0tsb0=
=vmvz
-----END PGP SIGNATURE-----
--nextPart1342059.LtUp1hhfVK--
--===============1899242920==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
[color=blue][color=green]
>> Visit [url]http://mail.kde.org/mailman/listinfo/kde-devel#unsub[/url] to unsubscribe <<[/color][/color]
--===============1899242920==--