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

# Qt 3 Support Members for QApplication

The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.

- QApplication class reference

### Public Types

- typedef ColorMode

### Static Public Members

- ColorMode colorMode ()
- void flushX ()
- bool hasGlobalMouseTracking ()
- Qt::Alignment horizontalAlignment ( Qt::Alignment align )
- Qt::MacintoshVersion macVersion ()
- QWidget * mainWidget ()
- bool reverseLayout ()
- void setColorMode ( ColorMode mode )
- void setFont ( const QFont & font, bool b, const char * className = 0 )
- void setGlobalMouseTracking ( bool b )
- void setMainWidget ( QWidget * mainWidget )
- void setOverrideCursor ( const QCursor & cursor, bool replace )
- void setPalette ( const QPalette & pal, bool b, const char * className = 0 )
- void setReverseLayout ( bool reverse )
- void setWinStyleHighlightColor ( const QColor & c )
- QWidget * widgetAt ( int x, int y, bool child )
- QWidget * widgetAt ( const QPoint & point, bool child )
- const QColor & winStyleHighlightColor ()
- Qt::WindowsVersion winVersion ()

- 4 static public members inherited from QCoreApplication

## Member Type Documentation

### typedef QApplication::ColorMode

Constant | Value
--- | ---
`QApplication::NormalColors` |
`QApplication::CustomColors` |

## Member Function Documentation

### ColorMode QApplication::colorMode () `[static]`

Use colorSpec() instead, and use ColorSpec as the enum type.

### void QApplication::flushX () `[static]`

Use flush() instead.

### bool QApplication::hasGlobalMouseTracking () `[static]`

Always returns true. ###

### Qt::Alignment QApplication::horizontalAlignment ( Qt::Alignment align ) `[static]`

Strips out vertical alignment flags and transforms an alignment align of Qt::AlignLeft into Qt::AlignLeft or Qt::AlignRight according to the language used.

### Qt::MacintoshVersion QApplication::macVersion () `[static]`

Use QSysInfo::MacintoshVersion instead.

### QWidget * QApplication::mainWidget () `[static]`

Returns the main application widget, or 0 if there is no main widget.

See also setMainWidget().

### bool QApplication::reverseLayout () `[static]`

Use layoutDirection() instead.

### void QApplication::setColorMode ( ColorMode mode ) `[static]`

Use setColorSpec() instead, and pass a ColorSpec value instead.

### void QApplication::setFont ( const QFont & font, bool b, const char * className = 0 ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use the two-argument overload instead.

### void QApplication::setGlobalMouseTracking ( bool b ) `[static]`

###

### void QApplication::setMainWidget ( QWidget * mainWidget ) `[static]`

Sets the application's main widget to mainWidget.

In most respects the main widget is like any other widget, except that if it is closed, the application exits. Note that QApplication does not take ownership of the mainWidget, so if you create your main widget on the heap you must delete it yourself.

You need not have a main widget; connecting lastWindowClosed() to quit() is an alternative.

For X11, this function also resizes and moves the main widget according to the -geometry command-line option, so you should set the default geometry (using QWidget::setGeometry()) before calling setMainWidget().

See also mainWidget(), exec(), and quit().

### void QApplication::setOverrideCursor ( const QCursor & cursor, bool replace ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

### void QApplication::setPalette ( const QPalette & pal, bool b, const char * className = 0 ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use the two-argument overload instead.

### void QApplication::setReverseLayout ( bool reverse ) `[static]`

Use setLayoutDirection() instead.

### void QApplication::setWinStyleHighlightColor ( const QColor & c ) `[static]`

Use the palette instead.

For example, if you have code like

        app.setWinStyleHighlightColor(color);

you can rewrite it as

        QPalette palette(qApp->palette());
        palette.setColor(QPalette::Highlight, color);
        qApp->setPalette(palette);

### QWidget * QApplication::widgetAt ( int x, int y, bool child ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use the two-argument widgetAt() overload to get the child widget. To get the top-level widget do this:

        QWidget *widget = qApp->widgetAt(x, y);
        if (widget)
            widget = widget->window();

### QWidget * QApplication::widgetAt ( const QPoint & point, bool child ) `[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Use the single-argument widgetAt() overload to get the child widget. To get the top-level widget do this:

        QWidget *widget = qApp->widgetAt(point);
        if (widget)
            widget = widget->window();

### const QColor & QApplication::winStyleHighlightColor () `[static]`

Use qApp->palette().color(QPalette::Active, QPalette::Highlight) instead.

### Qt::WindowsVersion QApplication::winVersion () `[static]`

Returns the version of the Windows operating system that is running:

Version | OS
--- | ---
Qt::WV_95 | Windows 95
Qt::WV_98 | Windows 98
Qt::WV_Me | Windows Me
Qt::WV_NT | Windows NT 4.x
Qt::WV_2000 | Windows 2000 (NT5)
Qt::WV_XP | Windows XP
Qt::WV_2003 | Windows Server 2003 family
Qt::WV_CE | Windows CE
Qt::WV_CENET | Windows CE.NET

Warning: This function is only implemented for the Windows version of Qt.