本文整理汇总了C++中QRadioButton::setStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:C++ QRadioButton::setStyleSheet方法的具体用法?C++ QRadioButton::setStyleSheet怎么用?C++ QRadioButton::setStyleSheet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRadioButton
的用法示例。
在下文中一共展示了QRadioButton::setStyleSheet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: problemSolutionWidget
void ConflictResolutionScreen::problemSolutionWidget( const QString & probDescription, const QStringList & solutions )
{
m_solId = -1;
if ( m_solutionWidget != NULL && m_questionLabel != NULL ) {
m_mainLayout->removeWidget( m_questionLabel );
m_mainLayout->removeWidget( m_solutionWidget );
}
QLabel *questionLabel = new QLabel( probDescription );
questionLabel->setStyleSheet( "background-color: rgb(254, 250, 210); border-bottom : 1px solid rgb(252,233,79); border-left : 1px solid rgb(196,181,147); border-top : 1px solid rgb(196,181,147); border-right : 1px solid rgb(196,181,147);" );
questionLabel->setFixedHeight( 50 );
questionLabel->setWordWrap( true );
QWidget *solutionWidget = new QWidget;
solutionWidget->setObjectName( "solutionWidget" );
solutionWidget->setStyleSheet( "QWidget#solutionWidget{ background-color : white; border-bottom: 1px solid rgb(196, 181, 147); border-left : 1px solid rgb(196,181,147); border-top : 1px solid rgb(196,181,147); border-right : 1px solid rgb(196,181,147); }" );
QVBoxLayout *solutionLayout = new QVBoxLayout( solutionWidget );
solutionLayout->setSpacing( 0 );
int radioId = 0;
for ( QString solution : solutions ) {
QRadioButton *sol = new QRadioButton( solution );
m_buttonGroup.addButton( sol, radioId++ );
sol->setStyleSheet( "padding-left: 40px;" );
solutionLayout->addWidget( sol );
solutionLayout->setSpacing( 10 );
}
m_questionLabel = questionLabel;
m_solutionWidget = solutionWidget;
m_mainLayout->addWidget( questionLabel );
m_mainLayout->setSpacing( 0 );
m_mainLayout->addWidget( solutionWidget );
}