Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

Qt Class Reference

The Qt class is a namespace for miscellaneous identifiers that need to be global-like. More...

#include <qnamespace.h>

Inherited by QObject, QPixmap, QBrush, QCanvasItem, QCursor, QPainter, QEvent, QIconViewItem, QKeySequence, QListViewItem, QCustomMenuItem, QPen, QStyleSheetItem, QSyntaxHighlighter, QTab, QTableItem, QThread, QToolTip, and QWhatsThis.

List of all member functions.

Public Members

Detailed Description

The Qt class is a namespace for miscellaneous identifiers that need to be global-like.

Normally, you can ignore this class. QObject and a few other classes inherit it, so all the identifiers in the Qt namespace are normally usable without qualification.

However, you may occasionally need to say Qt::black instead of just black, particularly in static utility functions (such as many class factories).

See also Miscellaneous Classes.

Member Type Documentation


This enum type is used to describe alignment. It contains horizontal and vertical flags.

The horizontal flags are:

The vertical flags are:

You can use only one of the horizontal flags at a time. There is one two-dimensional flag:

You can use at most one horizontal and one vertical flag at a time. AlignCenter counts as both horizontal and vertical.


Conflicting combinations of flags have undefined meanings.


An anchor has one or more of the following attributes:



Background mode


This enum describes how the background of a widget changes, as the widget's palette changes.

The background is what the widget contains when paintEvent() is called. To minimize flicker, this should be the most common color or pixmap in the widget. For PaletteBackground, use colorGroup().brush( QColorGroup::Background ), and so on. There are also three special values, listed at the end:

Although FixedColor and FixedPixmap are sometimes just right, if you use them, make sure that you test your application when the desktop color scheme has been changed. (On X11, a quick way to test this is e.g. "./myapp -bg paleblue". On Windows, you must use the control panel.)

See also QWidget::backgroundMode, QWidget::backgroundMode, QWidget::setBackgroundPixmap(), and QWidget::paletteBackgroundColor.


Brush Styles


This enum type describes the state of the mouse and the modifier buttons.


This enum type defines the various cursors that can be used.

ArrowCursor is the default for widgets in a normal state.

Cursor Shapes



Each dock window can be in one of the following positions:


This type is obsolete. It is provided to keep old source working. We strongly advise against using it in new code.


The conversion flag is a bitwise-OR of the following values. The options marked "(default)" are set if no other values from the list are included (since the defaults are zero):

Color/Mono preference (ignored for QBitmap)

Dithering mode preference for RGB channels

Dithering mode preference for alpha channel

Color matching versus dithering preference

The following are not values that are used directly, but masks for the above classes:

Using 0 as the conversion flag sets all the default options.


The key names used by Qt.

Multimedia keys



This enum type describes the keyboard modifier keys supported by Qt.


This type is used to signify an object's orientation.

Orientation is used with QScrollBar for example.



This enum type defines the pen cap styles supported by Qt, i.e. the line end caps that can be drawn using QPainter.

Pen Cap Styles


This enum type defines the pen join styles supported by Qt, i.e. which joins between two connected lines can be drawn using QPainter.

Pen Join Styles


This enum type defines the pen styles that can be drawn using QPainter. The styles are

Pen Styles


This enum type is used to describe the way things are written to the paint device. Each bit of the src (what you write) interacts with the corresponding bit of the dst pixel.

By far the most useful ones are CopyROP and XorROP.

On Qt/Mac, only CopyROP, OrROP, XorROP, NotAndROP, NotCopyROP, NotOrROP, NotXorROP, and AndROP are supported.

On Qt/Embedded, only CopyROP, XorROP, and NotROP are supported.



This enum type is used to set the string comparison mode when searching for an item. It is used by QListBox, QListView and QIconView, for example. We'll refer to the string being searched as the 'target' string.

If you OR these flags together (excluding CaseSensitive), the search criteria be applied in the following order: ExactMatch, BeginsWith, EndsWith, Contains.

Matching is case-insensitive unless CaseSensitive is set. CaseSensitive may be OR-ed with any combination of the other flags.


This enum type is used to define some modifier flags. Some of these flags only make sense in the context of printing:

You can use as many modifier flags as you want, except that SingleLine and WordBreak cannot be combined.

Flags that are inappropriate for a given use (e.g. ShowPrefix to QGridLayout::addWidget()) are generally ignored.


This enum is used in widgets that can display both plain text and rich text, e.g. QLabel. It is used for deciding whether a text string should be interpreted as one or the other. This is normally done by passing one of the enum values to a setTextFormat() function.




This enum type is used to specify various window-system properties for the widget. They are fairly unusual but necessary in a few cases. Some of these flags depend on whether the underlying window manager supports them.

The main types are

There are also a number of flags which you can use to customize the appearance of top-level windows. These have no effect on other windows:

Modifier flags:

Miscellaneous flags

Internal flags.


Internal flags.


This file is part of the Qt toolkit. Copyright © 1995-2003 Trolltech. All Rights Reserved.

Copyright © 2003 TrolltechTrademarks
Qt version 3.1.2