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, 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

Qt::AlignmentFlags

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.

Masks:

Conflicting combinations of flags have undefined meanings.

Qt::ArrowType

Qt::BGMode

Background mode

Qt::BackgroundMode

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 your application looks right 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 have to use the control panel.)

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

Qt::BrushStyle

Brush Styles

Qt::ButtonState

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

Qt::CursorShape

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

ArrowCursor is the default for widgets in a normal state.

Cursor Shapes

Qt::DateFormat

Qt::Dock

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

Qt::GUIStyle

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

Qt::ImageConversionFlags

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.

Qt::Key

The key names used by Qt.

Qt::Modifier

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

Qt::Orientation

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

Orientation is used with QScrollBar for example.

Qt::PaintUnit

Qt::PenCapStyle

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

Qt::PenJoinStyle

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

Qt::PenStyle

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

Pen Styles

Qt::RasterOp

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.

Qt::StringComparisonMode

This enum type is used to set the string comparison mode when searching for an item. This is implemented in 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.

Qt::TextFlags

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.

Qt::TextFormat

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.

Qt::UIEffect

Qt::WidgetFlags

This enum type is used to specify various window-system properties of 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.

Qt::WidgetState

Internal flags.

Qt::WindowsVersion


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


Copyright © 2002 TrolltechTrademarks
Qt version 3.0.4