Main Page   Class Hierarchy   Compound List   Compound Members   Examples   Search  

QdbtSection Class Reference

The QdbtSection widget represents a section of the header of a QdbtTabular widget. More...

#include <qdbtsection.h>

Class diagram for QdbtSection:

QPushButton QButton QWidget QPaintDevice QObject Qt

List of all members.

Public Members

 QdbtSection (QWidget *parent=0,const char *name=0)
 QdbtSection (const char *text,QWidget *parent=0,const char *name=0)
 ~QdbtSection ()
virtual int widthHint () const
virtual int heightHint () const
void setAlignment (int alignment)
int alignment () const
void setResizable (bool enable)
bool isResizable () const

Signals

void clicked (QdbtSection *)
void setResizable (QdbtSection *,bool)

Protected Members

virtual void resizeEvent (QResizeEvent *)
virtual void drawButton (QPainter *p)
virtual void drawButtonLabel (QPainter *p)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *)

Detailed Description

The QdbtSection widget represents a section of the header of a QdbtTabular widget.

The header of a QdbtTabular widget is divided into a number of sections, one for each column.

Each section is a specialized QdbtSection widget. Its position and size are controlled by the QdbtTabular widget.

By inheriting this widget you can change the look and feel of the individual sections.

You can both read and change the widget that is used for the section of a column by using QdbtTabular::section() and QdbtTabular::changeSection().

Examples:
example1.cpp, example3.cpp, and example4.cpp.

Member Function Documentation

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

Constructs a section widget with no label.

Warning:
The parent argument must be a QdbtTabular widget or a widget that inherits from QdbtTabular, otherwise a run time error will be generated.

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

Constructs a section widget with the label text.

Warning:
The parent argument must be a QdbtTabular widget or a widget that inherits from QdbtTabular, otherwise a run time error will be generated.

QdbtSection::~QdbtSection ()

Destroys the section widget.

int QdbtSection::widthHint () const [virtual]

Returns the preferret width of the widget. That is not the actual width, but the width that is needed to fully show the section.

You probably want to reimplement this if you are inheriting from this widget.

See also:
heightHint(), width()

int QdbtSection::heightHint () const [virtual]

Returns the preferret width of the widget. That is not the actual width, but the width that is needed to fully show the section.

You probably want to reimplement this if you are inheriting from this widget.

See also:
widthHint(), height()

void QdbtSection::setAlignment (int alignment) [inline]

Set the alignment of the text to align. Possible values are AlignLeft, AlignRight and AlignCenter.

See also:
alignment()
Examples:
example1.cpp, and example4.cpp.

int QdbtSection::alignment () const [inline]

Returns the alignment that is currently used.

See also:
setAlignment()

void QdbtSection::setResizable (bool enable)

Determines whether or not this section can be resized by the user.

If enable is FALSE the section cannot be resized.

if enable is TRUE the section can be resized.

Examples:
example4.cpp.

bool QdbtSection::isResizable () const [inline]

Returns TRUE if the section is currently resizable and FALSE otherwise.

void QdbtSection::clicked (QdbtSection *) [signal]

For internal use only.

void QdbtSection::setResizable (QdbtSection *, bool) [signal]

For internal use only.

void QdbtSection::resizeEvent (QResizeEvent * e) [protected, virtual]

The resize event, currently doesn't do anything

Reimplemented from QWidget.

void QdbtSection::drawButton (QPainter * p) [protected, virtual]

This function can be reimplemented to customize the way the section is drawn.

See also:
drawButtonLabel()

Reimplemented from QPushButton.

void QdbtSection::drawButtonLabel (QPainter * p) [protected, virtual]

This function can be reimplemented to customize the way the label of the section is drawn. (this is the section excluding the border)

See also:
drawButton()

Reimplemented from QPushButton.

void QdbtSection::mousePressEvent (QMouseEvent * e) [protected, virtual]

The mouse press event.

Warning:
If you plan to reimplement this function please make sure you call QdbtSection::mousePressEvent(e) within the body of the function. Otherwise the resizing of the buttons will not work anymore.

Reimplemented from QWidget.

void QdbtSection::mouseReleaseEvent (QMouseEvent * e) [protected, virtual]

The mouse release event.

Reimplemented from QWidget.

void QdbtSection::mouseMoveEvent (QMouseEvent * e) [protected, virtual]

The mouse move event.

Warning:
If you plan to reimplement this function please make sure you call QdbtSection::mouseMoveEvent(e) within the body of the function. Otherwise the resizing of the buttons will not work anymore.

Reimplemented from QWidget.

void QdbtSection::keyPressEvent (QKeyEvent * e) [protected, virtual]

Reimplements the keyboard events. Left and Right cursor key events are passed on to the parent. Other events (space) are processed just as QPushButton.

Reimplemented from QWidget.

Examples:
example3.cpp.

The documentation for this class was generated from the following files:
Generated 11:09, 1999/10/02 for QdbtTabular by doxygen  written by Dimitri van Heesch, © 1997-1998