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

void QStyleOption::init ( const QWidget widget  )  [inherited]

Use initFrom(widget) instead.

Definition at line 178 of file qstyleoption.cpp.

References QWidget::fontMetrics(), QWidget::hasFocus(), QWidget::isActiveWindow, QWidget::isEnabled(), QWidget::layoutDirection, QWidget::palette, QWidget::rect, QWidget::testAttribute(), QWidget::underMouse(), and QWidget::window().

Referenced by Q3DockWindow::drawContents(), QFrame::drawFrame(), QMenuBar::heightForWidth(), QDockWidget::paintEvent(), QDateTimeEdit::paintEvent(), QSizeGrip::paintEvent(), QTabBar::paintEvent(), QLabel::paintEvent(), Q3ListViewItem::paintFocus(), Q3Table::paintFocus(), Q3ComboBox::Q3ComboBox(), QAccessibleToolButton::rect(), QSplitterHandle::sizeHint(), QTabWidget::sizeHint(), QSizeGrip::sizeHint(), Q3IconView::sizeHint(), and QAbstractItemView::viewOptions().

{
    state = QStyle::State_None;
    if (widget->isEnabled())
        state |= QStyle::State_Enabled;
    if (widget->hasFocus())
        state |= QStyle::State_HasFocus;
    if (widget->window()->testAttribute(Qt::WA_KeyboardFocusChange))
        state |= QStyle::State_KeyboardFocusChange;
    if (widget->underMouse())
        state |= QStyle::State_MouseOver;
    if (widget->window()->isActiveWindow())
        state |= QStyle::State_Active;
#ifdef Q_WS_MAC
    extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
    if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
        state &= ~QStyle::State_Enabled;
#endif
#ifdef QT_KEYPAD_NAVIGATION
    if (widget->hasEditFocus())
        state |= QStyle::State_HasEditFocus;
#endif

    direction = widget->layoutDirection();
    rect = widget->rect();
    palette = widget->palette();
    fontMetrics = widget->fontMetrics();
}


Generated by  Doxygen 1.6.0   Back to index