Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QWidget::setStyle ( QStyle style  )  [inherited]

Sets the widget's GUI style to style. The ownership of the style object is not transferred.

If no style is set, the widget uses the application's style, QApplication::style() instead.

Setting a widget's style has no effect on existing or future child widgets.

This function is particularly useful for demonstration purposes, where you want to show Qt's styling capabilities. Real applications should avoid it and use one consistent GUI style instead.
See also:
style(), QStyle, QApplication::style(), QApplication::setStyle()

Definition at line 2123 of file qwidget.cpp.

References QWidget::setAttribute().

    setAttribute(Qt::WA_SetStyle, style != 0);
    // if we have an application stylesheet or have a proxy already, propagate
    if (qobject_cast<QStyleSheetStyle *>(d->extra->style) || !qApp->styleSheet().isEmpty())
        d->setStyle_helper(new QStyleSheetStyle(style), true);
        d->setStyle_helper(style, false);

Generated by  Doxygen 1.6.0   Back to index