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

List:       kde-devel
Subject:    Re: widgets on statusbar ???
From:       Sven Radej <sven () lisa ! exp ! univie ! ac ! at>
Date:       2000-05-16 12:22:00
[Download RAW message or body]

On Tue, 16 May 2000, Carsten Pfeiffer wrote:
>On Sat, May 13, 2000 at 09:14:29PM +0200, Shie Erlich wrote:
>
>Hi,
>
>> i'm trying to take a KLed widget and put it on my statusbar.
>> the problem is that the addWidget() method puts my led on the left side of
>> the bar, where my messages go. 
>> is there a way to align the widget to the right-end side of the statusbar ???
>> (preferably without overloading resizeEvent())
>
>what about KStatusBar::setItemAlignMent()? Hmm, I'm afraid this only sets
>the alignment of an item when it is smaller than the statusbar and doesn't
>care about the position in the bar.
>
>In KDE 1, we had setInsertOrder(), why don't we support this
>anymore? Sven?

KStatusBar inherits QStatusBar now. Widgets on the left side of ststusbar are
now called permanent. So, to add left-aligned widget you must do:

  statusbar()->addWidget(myWidget, 0, true); //using QStatusBar API

From QT docs:
   void QStatusBar::addWidget ( QWidget * widget, int stretch = 0, 
                                bool permanent = FALSE ) 
   
   Adds widget to this status bar. 

   widget is permanently visible if permanent is TRUE, and is obscured by
   temporary messages if permanent is FALSE. The default is FALSE. 

   stretch is used to compute a suitable size for widget as the status bar grows
   and shrinks. The default of 0 uses a minimum of space. 

   If permanent is TRUE, widget is located at the far right of the status bar.
   If permanent is FALSE (the default) widget is located just to the left of the
   first permanent widget. 

KStatusBar::setItemAlignment() aligns text inside text item (QLabel)

bye, 
-- 
Sven Radej      radej@kde.org
KDE developer   Visit http://www.kde.org

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

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