Exemple #1
0
void QCheckBoxPrivate::init()
{
    Q_Q(QCheckBox);
    q->setCheckable(true);
    q->setMouseTracking(true);
    q->setForegroundRole(QPalette::WindowText);
    setLayoutItemMargins(QStyle::SE_CheckBoxLayoutItem);
}
Exemple #2
0
void QFramePrivate::updateFrameWidth()
{
    Q_Q(QFrame);
    QRect fr = q->frameRect();
    updateStyledFrameWidths();
    q->setFrameRect(fr);
    setLayoutItemMargins(QStyle::SE_FrameLayoutItem);
}
Exemple #3
0
/*
    Initializes the radio button.
*/
void QRadioButtonPrivate::init()
{
    Q_Q(QRadioButton);
    q->setCheckable(true);
    q->setAutoExclusive(true);
    q->setMouseTracking(true);
    q->setForegroundRole(QPalette::WindowText);
    setLayoutItemMargins(QStyle::SE_RadioButtonLayoutItem);
}
Exemple #4
0
/*
    Sets the right frame rect depending on the title.
*/
void QGroupBoxPrivate::calculateFrame()
{
    Q_Q(QGroupBox);
    QStyleOptionGroupBox box;
    q->initStyleOption(&box);
    QRect contentsRect = q->style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxContents, q);
    q->setContentsMargins(contentsRect.left() - box.rect.left(), contentsRect.top() - box.rect.top(),
                          box.rect.right() - contentsRect.right(), box.rect.bottom() - contentsRect.bottom());
    setLayoutItemMargins(QStyle::SE_GroupBoxLayoutItem, &box);
}
Exemple #5
0
void QLabelPrivate::init()
{
    Q_Q(QLabel);

    valid_hints = false;
    margin = 0;
#ifndef QT_NO_MOVIE
    movie = 0;
#endif
#ifndef QT_NO_SHORTCUT
    shortcutId = 0;
#endif
    pixmap = 0;
    scaledpixmap = 0;
    cachedimage = 0;
#ifndef QT_NO_PICTURE
    picture = 0;
#endif
    align = Qt::AlignLeft | Qt::AlignVCenter | Qt::TextExpandTabs;
    indent = -1;
    scaledcontents = false;
    textLayoutDirty = false;
    textDirty = false;
    textformat = Qt::AutoText;
    control = 0;
    textInteractionFlags = Qt::LinksAccessibleByMouse;
    isRichText = false;
    isTextLabel = false;

    q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred,
                                 QSizePolicy::Label));

#ifndef QT_NO_CURSOR
    validCursor = false;
    onAnchor = false;
#endif

    openExternalLinks = false;

    setLayoutItemMargins(QStyle::SE_LabelLayoutItem);
}
Exemple #6
0
inline void QFramePrivate::init()
{
    setLayoutItemMargins(QStyle::SE_FrameLayoutItem);
}