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

List:       kde-devel
Subject:    Re: QLabel & QLineEdit
From:       Stephan Kulow <coolo () kde ! org>
Date:       1998-01-17 21:03:29
[Download RAW message or body]

Arnt Gulbrandsen wrote:
> 
> Stephan Kulow <coolo@kde.org>
> > Hi!
> >
> > OK, I give up. The documentation for QLabel contains the following
> > example code:
> >
> >    QLineEdit * phone = new QLineEdit( this, "phone number" );
> >    QLabel * phoneLabel = new QLineEdit( phone, "&Phone", this );
> 
> (Fixed the doc bug just now.)
> 
> > Beside the fact, that there is a mistake in it (QLineEdit -> QLabel),
> > it doesn't work. I have very similiar code and it always show the
> > text "&Phone" instead of "Phone" with an underlined P.
> 
> That's strange... I can't play with it right now, Qt dumps core for me
> tonight, but could you check what phoneLabel->alignment() returns?
> That should include ShowPrefix, but from your description it doesn't.
> 
> You could always use setAlignment() to hammer ShowPrefix explicitly,
> or perhaps an explicit call to setBuddy() will do.  That works in the
> layout example.  Excerpt follows:
> 
That was, what caused my problems. The code set alignment to AlignCenter
and overrode the default. I must say, that this was not very intuitive
;)

But thanks, it works now.

Greets, Stephan

-- 
Everyone makes mistakes -- but we are more experienced at it
                                      anonymous KDE developer

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

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