本文整理汇总了C++中QScrollBar::setLineStep方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollBar::setLineStep方法的具体用法?C++ QScrollBar::setLineStep怎么用?C++ QScrollBar::setLineStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollBar
的用法示例。
在下文中一共展示了QScrollBar::setLineStep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setSlaveLayout
void EigenGraspDlg::setSlaveLayout( int nGrasps )
{
mainLayout = new QVBoxLayout(mSlave, 5);
QLabel *valueLabel = new QLabel(QString("Value:"), mSlave);
QLabel *amplLabel = new QLabel(QString("Amplitude:"), mSlave);
QLabel *fixedLabel = new QLabel(QString("Fixed"), mSlave);
QHBoxLayout *fakeRow = new QHBoxLayout(mainLayout,-1);
fakeRow->addSpacing(400);
QHBoxLayout *labelRow = new QHBoxLayout(mainLayout,-1);
labelRow->addSpacing(5);
labelRow->addWidget(valueLabel,0);
labelRow->addWidget(amplLabel,1,Qt::AlignHCenter);
labelRow->addWidget(fixedLabel,0);
labelRow->addSpacing(5);
mainLayout->addLayout(labelRow);
for (int i=0; i<nGrasps; i++) {
QHBoxLayout *graspRow = new QHBoxLayout(mainLayout,10);
QLabel *eigenValue = new QLabel(QString("0.0"), mSlave);
QScrollBar *bar = new QScrollBar(Qt::Horizontal, mSlave);
bar->setRange( -SLIDER_STEPS, SLIDER_STEPS );
bar->setPageStep(5000);
bar->setLineStep(1000);
bar->setValue(0);
QCheckBox *box = new QCheckBox(mSlave);
graspRow->addSpacing(15);
graspRow->addWidget(eigenValue,0);
graspRow->addWidget(bar,1);
graspRow->addWidget(box,0);
graspRow->addSpacing(15);
mValueList.push_back(eigenValue);
mBarList.push_back(bar);
mCheckList.push_back(box);
connect(bar,SIGNAL(sliderMoved(int)), this, SLOT(eigenGraspChanged()) );
//comment this one out
//connect(bar,SIGNAL(valueChanged(int)), this, SLOT(eigenGraspChanged()) );
connect(bar,SIGNAL(nextLine()), this, SLOT(eigenGraspChanged()) );
connect(bar,SIGNAL(prevLine()), this, SLOT(eigenGraspChanged()) );
connect(bar,SIGNAL(nextPage()), this, SLOT(eigenGraspChanged()) );
connect(bar,SIGNAL(prevPage()), this, SLOT(eigenGraspChanged()) );
connect(bar,SIGNAL(sliderReleased()), this, SLOT(eigenGraspChanged()) );
connect(box,SIGNAL(clicked()), this, SLOT(fixBoxChanged()) );
}
mainLayout->addSpacing(20);
}