Eneboo - Documentación para desarrolladores
Slots públicos | Señales | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase QStatusBar

The QStatusBar class provides a horizontal bar suitable for presenting status information. Más...

#include <qstatusbar.h>

Diagrama de herencias de QStatusBar
QWidget QWidget QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject QPaintDevice QObject

Lista de todos los miembros.

Slots públicos

void message (const QString &)
void message (const QString &, int)
void clear ()
void message (const QString &)
void message (const QString &, int)
void clear ()

Señales

void messageChanged (const QString &text)
void messageChanged (const QString &text)

Métodos públicos

 QStatusBar (QWidget *parent=0, const char *name=0)
virtual ~QStatusBar ()
virtual void addWidget (QWidget *, int stretch=0, bool=FALSE)
virtual void removeWidget (QWidget *)
void setSizeGripEnabled (bool)
bool isSizeGripEnabled () const
 QStatusBar (QWidget *parent=0, const char *name=0)
virtual ~QStatusBar ()
virtual void addWidget (QWidget *, int stretch=0, bool=FALSE)
virtual void removeWidget (QWidget *)
void setSizeGripEnabled (bool)
bool isSizeGripEnabled () const

Métodos protegidos

void paintEvent (QPaintEvent *)
void resizeEvent (QResizeEvent *)
void reformat ()
void hideOrShow ()
bool event (QEvent *)
void paintEvent (QPaintEvent *)
void resizeEvent (QResizeEvent *)
void reformat ()
void hideOrShow ()
bool event (QEvent *)

Propiedades

bool sizeGripEnabled
 whether the QSizeGrip in the bottom right of the status bar is enabled

Descripción detallada

The QStatusBar class provides a horizontal bar suitable for presenting status information.

Each status indicator falls into one of three categories:

Temporary - briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example. Normal - occupies part of the status bar and may be hidden by temporary messages. Used to display the page and line number in a word processor, for example. Permanent - is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar.

QStatusBar lets you display all three types of indicators.

To display a temporary message, call message() (perhaps by connecting a suitable signal to it). To remove a temporary message, call clear(). There are two variants of message(): one that displays the message until the next clear() or message() and one that has a time limit:

        connect( loader, SIGNAL(progressMessage(const QString&)),
                 statusBar(), SLOT(message(const QString&)) );

        statusBar()->message("Loading...");  // Initial message
        loader.loadStuff();                  // Emits progress messages
        statusBar()->message("Done.", 2000); // Final message for 2 seconds

Normal and Permanent messages are displayed by creating a small widget and then adding it to the status bar with addWidget(). Widgets like QLabel, QProgressBar or even QToolButton are useful for adding to status bars. removeWidget() is used to remove widgets.

        statusBar()->addWidget(new MyReadWriteIndication(statusBar()));

By default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it with setSizeGripEnabled(FALSE);

qstatusbar-m.png
qstatusbar-w.png
Ver también:
QToolBar QMainWindow QLabel GUI Design Handbook: Status Bar.

Documentación del constructor y destructor

QStatusBar::QStatusBar ( QWidget parent = 0,
const char *  name = 0 
)

Constructs a status bar called name with parent parent and with a size grip.

Ver también:
setSizeGripEnabled()
QStatusBar::~QStatusBar ( ) [virtual]

Destroys the status bar and frees any allocated resources and child widgets.

QStatusBar::QStatusBar ( QWidget parent = 0,
const char *  name = 0 
)
virtual QStatusBar::~QStatusBar ( ) [virtual]

Documentación de las funciones miembro

void QStatusBar::addWidget ( QWidget widget,
int  stretch = 0,
bool  permanent = FALSE 
) [virtual]

Adds widget to this status bar. widget is reparented if it isn't already a child of the QStatusBar.

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

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.

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.

This function may cause some flicker.

Ver también:
removeWidget()
virtual void QStatusBar::addWidget ( QWidget ,
int  stretch = 0,
bool  = FALSE 
) [virtual]
void QStatusBar::clear ( ) [slot]
void QStatusBar::clear ( void  ) [slot]

Removes any temporary message being shown.

Ver también:
message()
bool QStatusBar::event ( QEvent e) [protected, virtual]

Reimplementado de QWidget.

bool QStatusBar::event ( QEvent e) [protected, virtual]

This is the main event handler; it handles event e. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.

The main event handler first passes an event through all event filters that have been installed. If none of the filters intercept the event, it calls one of the specialized event handlers.

Key press and release events are treated differently from other events. event() checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event() calls keyPressEvent().

This function returns TRUE if it is able to pass the event over to someone (i.e. someone wanted the event); otherwise returns FALSE.

Ver también:
closeEvent(), focusInEvent(), focusOutEvent(), enterEvent(), keyPressEvent(), keyReleaseEvent(), leaveEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), moveEvent(), paintEvent(), resizeEvent(), QObject::event(), QObject::timerEvent()

Reimplementado de QWidget.

void QStatusBar::hideOrShow ( ) [protected]
void QStatusBar::hideOrShow ( ) [protected]

Ensures that the right widgets are visible. Used by message() and clear().

bool QStatusBar::isSizeGripEnabled ( ) const
bool QStatusBar::isSizeGripEnabled ( ) const
void QStatusBar::message ( const QString ) [slot]
void QStatusBar::message ( const QString ,
int   
) [slot]
void QStatusBar::message ( const QString message) [slot]

Hides the normal status indicators and displays message until clear() or another message() is called.

Ver también:
clear()
void QStatusBar::message ( const QString message,
int  ms 
) [slot]

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Hides the normal status indications and displays message for ms milli-seconds or until clear() or another message() is called, whichever occurs first.

QStatusBar::messageChanged ( const QString message) [signal]

This signal is emitted when the temporary status messages changes. message is the new temporary message, and is a null-string when the message has been removed.

Ver también:
message(), clear()
void QStatusBar::messageChanged ( const QString text) [signal]
void QStatusBar::paintEvent ( QPaintEvent ) [protected, virtual]

Shows the temporary message, if appropriate.

Reimplementado de QWidget.

void QStatusBar::paintEvent ( QPaintEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive paint events.

A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons.

Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example.

Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, Qt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible.

When the paint event occurs, the update region has normally been erased, so that you're painting on the widget's background. There are a couple of exceptions and QPaintEvent::erased() tells you whether the widget has been erased or not.

The background can be set using setBackgroundMode(), setPaletteBackgroundColor() or setBackgroundPixmap(). The documentation for setBackgroundMode() elaborates on the background; we recommend reading it.

Ver también:
event(), repaint(), update(), QPainter, QPixmap, QPaintEvent

Reimplementado de QWidget.

void QStatusBar::reformat ( ) [protected]
void QStatusBar::reformat ( ) [protected]

Changes the status bar's appearance to account for item changes. Special subclasses may need this, but geometry management will usually take care of any necessary rearrangements.

virtual void QStatusBar::removeWidget ( QWidget ) [virtual]
void QStatusBar::removeWidget ( QWidget widget) [virtual]

Removes widget from the status bar.

This function may cause some flicker.

Note that widget is not deleted.

Ver también:
addWidget()
void QStatusBar::resizeEvent ( QResizeEvent e) [protected, virtual]

Reimplementado de QWidget.

void QStatusBar::resizeEvent ( QResizeEvent ) [protected, virtual]

This event handler can be reimplemented in a subclass to receive widget resize events. When resizeEvent() is called, the widget already has its new geometry. The old size is accessible through QResizeEvent::oldSize().

The widget will be erased and receive a paint event immediately after processing the resize event. No drawing need be (or should be) done inside this handler.

Widgets that have been created with the WNoAutoErase flag will not be erased. Nevertheless, they will receive a paint event for their entire area afterwards. Again, no drawing needs to be done inside this handler.

The default implementation calls updateMask() if the widget has automatic masking enabled.

Ver también:
moveEvent(), event(), resize(), QResizeEvent, paintEvent()

Reimplementado de QWidget.

void QStatusBar::setSizeGripEnabled ( bool  enabled)
void QStatusBar::setSizeGripEnabled ( bool  )

Documentación de propiedades

bool QStatusBar::sizeGripEnabled [read, write]

whether the QSizeGrip in the bottom right of the status bar is enabled

Enables or disables the QSizeGrip in the bottom right of the status bar. By default, the size grip is enabled.


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'