Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 2

Qt-interest Archive, March 2002
QStatusBar with free widget placement


Message 1 in thread

Hi folks, 

maybe someone can help me, 

I'm currently working on an application where 
I have a central widget and toolbars placed 
on all 4 sides of that widget. On the bottom 
of the main window I need need something that 
behaves like a QStatusBar (which means that 
a toolbar is positioned at the top of the 
statusbar). The aim is that I can freely add 
any widgets to that bar, which is not possible 
with QStatusBar because it has a QVBoxLayout 
which brings all my widgets into one line. 

Thanks for any help in advance 

Dietmar 


Message 2 in thread

Hi Dietmar,

I've tried something like this in a QMainWindow:

  QWidget* widget = new QWidget (statusBar());
  QGridLayout* layout = new QGridLayout (widget, 3, 2);
  layout->addWidget (new QLineEdit (widget), 0, 0);
  layout->addWidget (new QLineEdit (widget), 0, 1);
  layout->addWidget (new QComboBox (TRUE, widget), 1, 0);
  ...

  statusBar()->addWidget (widget, 1, TRUE);

So I have a QGridLayout in the statusbar and can add any widget or
additionally layouts.
Hope this will help.

Matthias Bartelt

dk wrote:
> 
> Hi folks,
> 
> maybe someone can help me,
> 
> I'm currently working on an application where
> I have a central widget and toolbars placed
> on all 4 sides of that widget. On the bottom
> of the main window I need need something that
> behaves like a QStatusBar (which means that
> a toolbar is positioned at the top of the
> statusbar). The aim is that I can freely add
> any widgets to that bar, which is not possible
> with QStatusBar because it has a QVBoxLayout
> which brings all my widgets into one line.
> 
> Thanks for any help in advance
> 
> Dietmar
> 
> --
> List archive and information: http://qt-interest.trolltech.com