コード例 #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
ファイル: CQGroupBox.cpp プロジェクト: colinw7/CQGroupBox
void
CQGroupBox::
setMarginTop(int margin)
{
  marginTop_ = margin;

  calculateFrame();

  update();
}
コード例 #5
0
ファイル: CQGroupBox.cpp プロジェクト: colinw7/CQGroupBox
void
CQGroupBox::
setMarginBottom(int margin)
{
  marginBottom_ = margin;

  calculateFrame();

  update();
}
コード例 #6
0
ファイル: CQGroupBox.cpp プロジェクト: colinw7/CQGroupBox
void
CQGroupBox::
setMarginRight(int margin)
{
  marginRight_ = margin;

  calculateFrame();

  update();
}
コード例 #7
0
ファイル: CQGroupBox.cpp プロジェクト: colinw7/CQGroupBox
void
CQGroupBox::
changeEvent(QEvent *e)
{
  if (e->type() == QEvent::EnabledChange)
    updateEnabled();

  calculateFrame();

  QWidget::changeEvent(e);
}
コード例 #8
0
ファイル: CQGroupBox.cpp プロジェクト: colinw7/CQGroupBox
void
CQGroupBox::
childEvent(QChildEvent *e)
{
  if (e->type() != QEvent::ChildAdded || ! e->child()->isWidgetType())
    return;

  calculateFrame();

  if (isCheckable())
    updateEnabled();

  QWidget::childEvent(e);
}
コード例 #9
0
ファイル: qgroupbox.cpp プロジェクト: muromec/qtopia-ezx
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));
}
コード例 #10
0
/**
 * 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;
}