本文整理汇总了C++中QSlider::setFixedHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ QSlider::setFixedHeight方法的具体用法?C++ QSlider::setFixedHeight怎么用?C++ QSlider::setFixedHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSlider
的用法示例。
在下文中一共展示了QSlider::setFixedHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KDialog
KBannerSetup::KBannerSetup( QWidget *parent )
: KDialog( parent)
, saver( 0 ), ed(0), speed( 50 )
{
setButtons(Ok|Cancel|Help);
setDefaultButton(Ok);
setCaption(i18n( "Setup Banner Screen Saver" ));
setModal(true);
setButtonText( Help, i18n( "A&bout" ) );
readSettings();
QWidget *main = new QWidget(this);
setMainWidget(main);
QLabel *label;
QVBoxLayout *tl = new QVBoxLayout( main );
QHBoxLayout *tl1 = new QHBoxLayout();
tl->addLayout(tl1);
QVBoxLayout *tl11 = new QVBoxLayout();
tl1->addLayout(tl11);
QGroupBox *group = new QGroupBox( i18n("Font"), main );
QVBoxLayout *vbox = new QVBoxLayout;
group->setLayout(vbox);
QGridLayout *gl = new QGridLayout();
vbox->addLayout(gl);
gl->setSpacing(spacingHint());
label = new QLabel( i18n("Family:"), group );
gl->addWidget(label, 1, 0);
KFontComboBox* comboFonts = new KFontComboBox( group );
comboFonts->setCurrentFont( fontFamily );
gl->addWidget(comboFonts, 1, 1);
connect( comboFonts, SIGNAL(currentFontChanged(QFont)),
SLOT(slotFamily(QFont)) );
label = new QLabel( i18n("Size:"), group );
gl->addWidget(label, 2, 0);
comboSizes = new QComboBox( group );
comboSizes->setEditable( true );
fillFontSizes();
gl->addWidget(comboSizes, 2, 1);
connect( comboSizes, SIGNAL(activated(int)), SLOT(slotSize(int)) );
connect( comboSizes, SIGNAL(editTextChanged(QString)),
SLOT(slotSizeEdit(QString)) );
QCheckBox *cb = new QCheckBox( i18n("Bold"),
group );
cb->setChecked( bold );
connect( cb, SIGNAL(toggled(bool)), SLOT(slotBold(bool)) );
gl->addWidget(cb, 3, 0);
cb = new QCheckBox( i18n("Italic"), group );
cb->setChecked( italic );
gl->addWidget(cb, 3, 1);
connect( cb, SIGNAL(toggled(bool)), SLOT(slotItalic(bool)) );
label = new QLabel( i18n("Color:"), group );
gl->addWidget(label, 4, 0);
colorPush = new KColorButton( fontColor, group );
gl->addWidget(colorPush, 4, 1);
connect( colorPush, SIGNAL(changed(QColor)),
SLOT(slotColor(QColor)) );
QCheckBox *cyclingColorCb=new QCheckBox(i18n("Cycling color"),group);
cyclingColorCb->setMinimumSize(cyclingColorCb->sizeHint());
gl->addWidget(cyclingColorCb, 5, 0,5,1);
connect(cyclingColorCb,SIGNAL(toggled(bool)),this,SLOT(slotCyclingColor(bool)));
cyclingColorCb->setChecked(cyclingColor);
preview = new QWidget( main );
preview->setFixedSize( 220, 170 );
{
QPalette palette;
palette.setColor( preview->backgroundRole(), Qt::black );
preview->setPalette( palette );
preview->setAutoFillBackground(true);
}
preview->show(); // otherwise saver does not get correct size
saver = new KBannerSaver( preview->winId() );
tl1->addWidget(preview);
tl11->addWidget(group);
label = new QLabel( i18n("Speed:"), main );
tl11->addStretch(1);
tl11->addWidget(label);
QSlider *sb = new QSlider( Qt::Horizontal, main );
sb->setMinimum(0);
sb->setMaximum(100);
sb->setPageStep(10);
sb->setValue(speed);
sb->setMinimumWidth( 180);
sb->setFixedHeight(20);
sb->setTickPosition(QSlider::TicksBelow);
//.........这里部分代码省略.........