[Qt-interest] Sunken statusbar in QT 4.4
Diego Schulz
dschulz at gmail.com
Sat Jul 18 02:15:10 CEST 2009
On Fri, Jul 17, 2009 at 7:53 AM, Nitish Jha<nitishjham at gmail.com> wrote:
>
> Hello,
>
> I am new to Qt and I wanted to know if it is possible for the statusbar in
> Qt on Windows XP to be sunken like other native toolkit based window apps.
> If so how ?
> I am using PyQt 4.4
>
>
> Thanks,
> Nitish
>
>
Yes, it is possible. Even if I don't use PyQt, the example below
(plain C++) should be easily translatable to python.
If I recall correctly you have to use the QMainWindow class, which
provides a statusBar() method.
Using this method, you can add whatever widget you like to your status bar.
Suppose you have a QMainWindow subclass, MyMainWindow with a custom
method called from the ctor, defined like this
void MyMainWindow::createStatusBar()
{
statusLabel = new QLabel ( this ); // statusLabel declared in
mymainwindow.h
// customize the appearance of statusLabel to whatever you want
statusLabel->setFrameShape(QFrame::WinPanel);
statusLabel->setFrameShadow(QFrame::Sunken);
// ...
// then add the widget to the status bar
statusBar()->addWidget ( statusLabel );
}
HTH,
diego
More information about the Qt-interest-old
mailing list