Пример #1
0
void QGroupBox::setTitle( const QString &title )
{
    if ( str == title )				// no change
        return;
    str = title;
#ifndef QT_NO_ACCEL
    if ( accel )
        delete accel;
    accel = 0;
    int s = QAccel::shortcutKey( title );
    if ( s ) {
        accel = new QAccel( this, "automatic focus-change accelerator" );
        accel->connectItem( accel->insertItem( s, 0 ),
                            this, SLOT(fixFocus()) );
    }
#endif
#ifndef QT_NO_CHECKBOX
    if ( d->checkbox ) {
        d->checkbox->setText( str );
        updateCheckBoxGeometry();
    }
#endif
    calculateFrame();
    setTextSpacer();

    update();
    updateGeometry();
#if defined(QT_ACCESSIBILITY_SUPPORT)
    QAccessible::updateAccessibility( this, 0, QAccessible::NameChanged );
#endif
}
Пример #2
0
/*!\reimp
 */
void QGroupBox::fontChange( const QFont & oldFont )
{
    QWidget::fontChange( oldFont );
#ifndef QT_NO_CHECKBOX
    updateCheckBoxGeometry();
#endif
    calculateFrame();
    setTextSpacer();
}
Пример #3
0
/*! \reimp
*/
void QGroupBox::resizeEvent( QResizeEvent *e )
{
    QFrame::resizeEvent(e);
#ifndef QT_NO_CHECKBOX
    if ( align & AlignRight || align & AlignCenter ||
            ( QApplication::reverseLayout() && !(align & AlignLeft) ) )
        updateCheckBoxGeometry();
#endif
    calculateFrame();
}
Пример #4
0
void
CQGroupBox::
setMarginTop(int margin)
{
  marginTop_ = margin;

  calculateFrame();

  update();
}
Пример #5
0
void
CQGroupBox::
setMarginBottom(int margin)
{
  marginBottom_ = margin;

  calculateFrame();

  update();
}
Пример #6
0
void
CQGroupBox::
setMarginRight(int margin)
{
  marginRight_ = margin;

  calculateFrame();

  update();
}
Пример #7
0
void
CQGroupBox::
changeEvent(QEvent *e)
{
  if (e->type() == QEvent::EnabledChange)
    updateEnabled();

  calculateFrame();

  QWidget::changeEvent(e);
}
Пример #8
0
void
CQGroupBox::
childEvent(QChildEvent *e)
{
  if (e->type() != QEvent::ChildAdded || ! e->child()->isWidgetType())
    return;

  calculateFrame();

  if (isCheckable())
    updateEnabled();

  QWidget::childEvent(e);
}
Пример #9
0
void QGroupBoxPrivate::init()
{
    Q_Q(QGroupBox);
    align = Qt::AlignLeft;
#ifndef QT_NO_SHORTCUT
    shortcutId = 0;
#endif
    flat = false;
    checkable = false;
    checked = true;
    hover = false;
    pressedControl = QStyle::SC_None;
    calculateFrame();
    q->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred, 
                     QSizePolicy::GroupBox));
}
/**
 * Returns a pointer to texture referenced by the current animFrame_.
 * Updates animFrame_ the first time the function gets called in a frame.
 *
 * @return pointer to the current texture.
 */
DX::BaseTexture* AnimatingTexture::pTexture( )
{
	BW_GUARD;
	calculateFrame();

	// Find the texture for this frame.
	BaseTexturePtr tp;
	uint32 uanim = uint32(animFrame_);
	if (uanim < textures_.size())
	{
		tp = textures_[uanim];
	}
	else
	{
		DEBUG_MSG( "Wrong animFrame %f %d\n", animFrame_, textures_.size() );
	}

	// If a texture was found, return it.
	if (tp)
		return tp->pTexture();

	// Return NULL if no texture was found.
	return NULL;
}