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

List:       kde-devel
Subject:    Re: Composed widget
From:       Kevin Krammer <kevin.krammer () gmx ! at>
Date:       2006-01-29 17:02:39
Message-ID: 200601291802.46602.kevin.krammer () gmx ! at
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday 29 January 2006 17:32, Gábor Lehel wrote:

> Perhaps something like:
>
> class MyWidget: public KLineEdit
> {
>     MyWidget( QWidget *parent = 0, const char *name = 0 )
>
>         : KLineEdit( new QHBox( parent ), name )
>
>     {
>         new KPushButton( parent() );
>     }
> };

While I think this will work, it will break in the event that MyWidget is 
reparented or asked for its size() or geometry()

> 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.)

Definitely cleaner.
For example QSpinBox does it this way.

Cheers,
Kevin

-- 
Kevin Krammer <kevin.krammer@gmx.at>
Qt/KDE Developer, Debian User
Moderator: www.mrunix.de (German), www.qtcentre.org

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


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

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