当前位置: 首页>>代码示例>>C++>>正文


C++ QRadioButton::setFixedHeight方法代码示例

本文整理汇总了C++中QRadioButton::setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QRadioButton::setFixedHeight方法的具体用法?C++ QRadioButton::setFixedHeight怎么用?C++ QRadioButton::setFixedHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QRadioButton的用法示例。


在下文中一共展示了QRadioButton::setFixedHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Dialog

RadioButtonDialog::RadioButtonDialog(const QString &labelText, const QList<QString> &radioButtonList,
									 QWidget *parent, Qt::WindowFlags f)
	: Dialog(parent, true, true), m_result(1)
{
	setWindowTitle(tr("Toonz"));

	setMinimumSize(20, 20);

	beginVLayout();

	QLabel *label = new QLabel(labelText);
	label->setAlignment(Qt::AlignLeft);
	label->setFixedHeight(2 * WidgetHeight);
	addWidget(label);

	QButtonGroup *buttonGroup = new QButtonGroup(this);
	int i;
	for (i = 0; i < radioButtonList.count(); i++) {
		QRadioButton *radioButton = new QRadioButton(radioButtonList.at(i));
		if (i == m_result - 1)
			radioButton->setChecked(true);
		radioButton->setFixedHeight(WidgetHeight);
		buttonGroup->addButton(radioButton);
		buttonGroup->setId(radioButton, i);
		addWidget(radioButton);
	}

	bool ret = connect(buttonGroup, SIGNAL(buttonClicked(int)), SLOT(onButtonClicked(int)));

	endVLayout();

	QPushButton *applyButton = new QPushButton(QObject::tr("Apply"));
	ret = ret && connect(applyButton, SIGNAL(pressed()), this, SLOT(onApply()));
	QPushButton *cancelButton = new QPushButton(QObject::tr("Cancel"));
	ret = ret && connect(cancelButton, SIGNAL(pressed()), this, SLOT(onCancel()));

	addButtonBarWidget(applyButton, cancelButton);

	assert(ret);
}
开发者ID:PsmithG,项目名称:opentoonz,代码行数:40,代码来源:dvdialog.cpp

示例2: QWidget

KKeyChooser::KKeyChooser( QDict<KKeyEntry> *aKeyDict, QWidget *parent )
    : QWidget( parent )
{
	
	bKeyIntercept = FALSE;
	kbMode = NoKey;
	
	aKeyIt = new QDictIterator<KKeyEntry> ( *aKeyDict );
	
	// TOP LAYOUT MANAGER
	
	// The following layout is used for the dialog
	// 		LIST LABELS LAYOUT
	//		SPLIT LIST BOX WIDGET
	//		CHOOSE KEY GROUP BOX WIDGET
	//		BUTTONS LAYOUT
	// Items are added to topLayout as they are created.
	
	QBoxLayout *topLayout = new QVBoxLayout( this, 0, 10 ); 
	
	// CREATE LIST LABELS
	
	QGridLayout *stackLayout = new QGridLayout( 2, 2, 2);
	topLayout->addLayout( stackLayout, 50 );
	
	stackLayout->setRowStretch(1,10);

	keyLabel = new QLabel(this);
	stackLayout->addWidget(keyLabel, 0, 1);
	keyLabel->setText( i18n("Current key") );
	keyLabel->setFixedHeight( keyLabel->sizeHint().height() );
	
	// CREATE SPLIT LIST BOX
	
	// Copy all currentKeyCodes to configKeyCodes
	// and fill up the split list box with the action/key pairs.
	
	wList = new KSplitList( this );
	stackLayout->addMultiCellWidget( wList, 1, 1, 0, 1 );
	
	actLabel = new QLabel( wList, i18n("&Action"), this );
	stackLayout->addWidget( actLabel, 0, 0 );
	actLabel->setFixedHeight( actLabel->sizeHint().height() );
	
	wList->setAutoUpdate(FALSE);
	wList->setFocus();
	
	aIt = aKeyIt;
	aIt->toFirst();
	while ( aIt->current() ) {
		aIt->current()->aConfigKeyCode = aIt->current()->aCurrentKeyCode;
		
		KSplitListItem *sli = new KSplitListItem(
		 	item( aIt->current()->aConfigKeyCode, aIt->currentKey() )
		);
		
		connect( wList, SIGNAL( newWidth( int ) ),
				 sli, SLOT( setWidth( int ) ) );
		wList->insertItem( sli );
		
		++ ( *aIt );
	}

	if ( wList->count() == 0 ) wList->setEnabled( FALSE );
	//connect( wList, SIGNAL( selected( int ) ), SLOT( toChange( int ) ) );
	connect( wList, SIGNAL( highlighted( int ) ), SLOT( updateAction( int ) ) );
	
	// CREATE CHOOSE KEY GROUP
	
	fCArea = new QGroupBox( this );
	topLayout->addWidget( fCArea, 1 );
	
	fCArea->setTitle( i18n("Choose a key for the selected action") );
	fCArea->setFrameStyle( QFrame::Box | QFrame::Sunken );
	
	// CHOOSE KEY GROUP LAYOUT MANAGER
	
	QGridLayout *grid = new QGridLayout( fCArea, 6, 4, 5 );
	
	grid->setRowStretch(0,10);
	grid->setRowStretch(1,10);
	grid->setRowStretch(2,10);
	grid->setRowStretch(3,10);
	grid->setRowStretch(4,10);
	grid->setRowStretch(5,10);

	grid->setColStretch(0,0);
	grid->setColStretch(1,10);
	grid->setColStretch(2,90);
	grid->setColStretch(3,0);
	
	grid->addRowSpacing(0,15);
	grid->addRowSpacing(5,1);
	
	
	kbGroup = new QButtonGroup( fCArea );
    kbGroup->hide();
    kbGroup->setExclusive( true );
	
	QRadioButton *rb = new QRadioButton( i18n("&No key"), fCArea );
//.........这里部分代码省略.........
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:101,代码来源:kkeydialog.cpp

示例3: createCommonControls

void PathStrokeControls::createCommonControls(QWidget* parent)
{
    m_capGroup = new QGroupBox(parent);
    m_capGroup->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    QRadioButton *flatCap = new QRadioButton(m_capGroup);
    QRadioButton *squareCap = new QRadioButton(m_capGroup);
    QRadioButton *roundCap = new QRadioButton(m_capGroup);
    m_capGroup->setTitle(tr("Cap Style"));
    flatCap->setText(tr("Flat"));
    squareCap->setText(tr("Square"));
    roundCap->setText(tr("Round"));
    flatCap->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    squareCap->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    roundCap->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    m_joinGroup = new QGroupBox(parent);
    m_joinGroup->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    QRadioButton *bevelJoin = new QRadioButton(m_joinGroup);
    QRadioButton *miterJoin = new QRadioButton(m_joinGroup);
    QRadioButton *roundJoin = new QRadioButton(m_joinGroup);
    m_joinGroup->setTitle(tr("Join Style"));
    bevelJoin->setText(tr("Bevel"));
    miterJoin->setText(tr("Miter"));
    roundJoin->setText(tr("Round"));

    m_styleGroup = new QGroupBox(parent);
    m_styleGroup->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    QRadioButton *solidLine = new QRadioButton(m_styleGroup);
    QRadioButton *dashLine = new QRadioButton(m_styleGroup);
    QRadioButton *dotLine = new QRadioButton(m_styleGroup);
    QRadioButton *dashDotLine = new QRadioButton(m_styleGroup);
    QRadioButton *dashDotDotLine = new QRadioButton(m_styleGroup);
    QRadioButton *customDashLine = new QRadioButton(m_styleGroup);
    m_styleGroup->setTitle(tr("Pen Style"));

    QPixmap line_solid(":res/images/line_solid.png");
    solidLine->setIcon(line_solid);
    solidLine->setIconSize(line_solid.size());
    QPixmap line_dashed(":res/images/line_dashed.png");
    dashLine->setIcon(line_dashed);
    dashLine->setIconSize(line_dashed.size());
    QPixmap line_dotted(":res/images/line_dotted.png");
    dotLine->setIcon(line_dotted);
    dotLine->setIconSize(line_dotted.size());
    QPixmap line_dash_dot(":res/images/line_dash_dot.png");
    dashDotLine->setIcon(line_dash_dot);
    dashDotLine->setIconSize(line_dash_dot.size());
    QPixmap line_dash_dot_dot(":res/images/line_dash_dot_dot.png");
    dashDotDotLine->setIcon(line_dash_dot_dot);
    dashDotDotLine->setIconSize(line_dash_dot_dot.size());
    customDashLine->setText(tr("Custom"));

    int fixedHeight = bevelJoin->sizeHint().height();
    solidLine->setFixedHeight(fixedHeight);
    dashLine->setFixedHeight(fixedHeight);
    dotLine->setFixedHeight(fixedHeight);
    dashDotLine->setFixedHeight(fixedHeight);
    dashDotDotLine->setFixedHeight(fixedHeight);

    m_pathModeGroup = new QGroupBox(parent);
    m_pathModeGroup->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    QRadioButton *curveMode = new QRadioButton(m_pathModeGroup);
    QRadioButton *lineMode = new QRadioButton(m_pathModeGroup);
    m_pathModeGroup->setTitle(tr("Line Style"));
    curveMode->setText(tr("Curves"));
    lineMode->setText(tr("Lines"));


    // Layouts
    QVBoxLayout *capGroupLayout = new QVBoxLayout(m_capGroup);
    capGroupLayout->addWidget(flatCap);
    capGroupLayout->addWidget(squareCap);
    capGroupLayout->addWidget(roundCap);

    QVBoxLayout *joinGroupLayout = new QVBoxLayout(m_joinGroup);
    joinGroupLayout->addWidget(bevelJoin);
    joinGroupLayout->addWidget(miterJoin);
    joinGroupLayout->addWidget(roundJoin);

    QVBoxLayout *styleGroupLayout = new QVBoxLayout(m_styleGroup);
    styleGroupLayout->addWidget(solidLine);
    styleGroupLayout->addWidget(dashLine);
    styleGroupLayout->addWidget(dotLine);
    styleGroupLayout->addWidget(dashDotLine);
    styleGroupLayout->addWidget(dashDotDotLine);
    styleGroupLayout->addWidget(customDashLine);

    QVBoxLayout *pathModeGroupLayout = new QVBoxLayout(m_pathModeGroup);
    pathModeGroupLayout->addWidget(curveMode);
    pathModeGroupLayout->addWidget(lineMode);


    // Connections
    connect(flatCap, SIGNAL(clicked()), m_renderer, SLOT(setFlatCap()));
    connect(squareCap, SIGNAL(clicked()), m_renderer, SLOT(setSquareCap()));
    connect(roundCap, SIGNAL(clicked()), m_renderer, SLOT(setRoundCap()));

    connect(bevelJoin, SIGNAL(clicked()), m_renderer, SLOT(setBevelJoin()));
    connect(miterJoin, SIGNAL(clicked()), m_renderer, SLOT(setMiterJoin()));
    connect(roundJoin, SIGNAL(clicked()), m_renderer, SLOT(setRoundJoin()));
//.........这里部分代码省略.........
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:101,代码来源:pathstroke.cpp

示例4: QDialog

PrintDialog::PrintDialog( QWidget *parent, const char *name, int maxPages,
							bool marked )		
	: QDialog( parent, name, TRUE )
{
	setFocusPolicy(QWidget::StrongFocus);
	
	pgMode = All;
	/*
	printerName.sprintf( "" ); // default printer will be chosen.
	spoolerCommand.sprintf( "lpr" );
	printerVariable.sprintf( "PRINTER" );
	*/

	KConfig *config = KApplication::getKApplication()->getConfig();
	/* Read in the default options. */
	config->setGroup( "Print" );
	printerName=config->readEntry ("Name","");
	spoolerCommand=config->readEntry ("Spool","lpr");
	printerVariable=config->readEntry ("Variable","PRINTER");


	pgMax = maxPages;
	pgStart=0; pgEnd=0;
	
	int border = 10;
	
	QBoxLayout *topLayout = new QVBoxLayout( this, border );
	
	cbFile = new QCheckBox( i18n("Print to file"), this );
	cbFile->setFixedHeight( cbFile->sizeHint().height() );
	
	topLayout->addWidget( cbFile );
	
	QGroupBox *group = new QGroupBox( i18n( "Pages" ), this );
	topLayout->addWidget( group, 10 );
	
	QGridLayout *grid = new QGridLayout( group, 5, 7, 5 );
	
	grid->setRowStretch( 0, 10 );
	grid->setRowStretch( 1, 100 );
	grid->setRowStretch( 2, 0 );
	grid->setRowStretch( 3, 100 );
	grid->setRowStretch( 4, 10 );
	
	grid->setColStretch( 0, 0 );
	grid->setColStretch( 1, 100 );
	grid->setColStretch( 2, 100 );
	grid->setColStretch( 3, 100 );
	grid->setColStretch( 4, 0 );
	grid->setColStretch( 5, 100 );
	grid->setColStretch( 6, 0 );
		
	pgGroup = new QButtonGroup( group );
	pgGroup->hide();
	pgGroup->setExclusive( true );
	connect( pgGroup, SIGNAL( clicked( int ) ), SLOT( slotPageMode( int ) ) );
	
	int widest = 0;
	
	QRadioButton *arb = new QRadioButton( i18n("&All"), group );
	arb->setFixedHeight( arb->sizeHint().height()+6 );
	arb->setChecked( true );
	pgGroup->insert( arb, All );
	
	grid->addWidget( arb, 1, 1 );
	
	if ( arb->sizeHint().width() > widest )
	  widest = arb->sizeHint().width();
	
	QRadioButton *rb = new QRadioButton( i18n("&Current"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Current );
	
	grid->addWidget( rb, 1, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Marked"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	if ( !marked )
	  rb->setEnabled( false );
	else
	  {
	    arb->setChecked ( false );
	    rb->setChecked ( true );
	  }

	pgGroup->insert( rb, Marked );
	
	grid->addWidget( rb, 3, 1 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
	
	rb = new QRadioButton( i18n("&Range"), group );
	rb->setFixedHeight( rb->sizeHint().height()+6 );
	pgGroup->insert( rb, Range );
	
	grid->addWidget( rb, 3, 2 );
	
	if ( rb->sizeHint().width() > widest ) widest = rb->sizeHint().width();
//.........这里部分代码省略.........
开发者ID:kthxbyte,项目名称:KDE1-Linaro,代码行数:101,代码来源:print.cpp


注:本文中的QRadioButton::setFixedHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。