本文整理汇总了C++中QSlider::adjustSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QSlider::adjustSize方法的具体用法?C++ QSlider::adjustSize怎么用?C++ QSlider::adjustSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSlider
的用法示例。
在下文中一共展示了QSlider::adjustSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createUi
void createUi(PlotViewInterpolation* plot_view) {
_b1_rbtn = new QRadioButton("no boundary", plot_view);
_b2_rbtn = new QRadioButton("c1 boundary", plot_view);
_b3_rbtn = new QRadioButton("c2 boundary", plot_view);
_b1_rbtn->setDown(true);
_lbl_weight = new QLabel("lambda", plot_view);
_lbl_weight->setAlignment(Qt::AlignRight);
_lbl_weight->adjustSize();
_sld_precision = new QSlider(Qt::Horizontal, plot_view);
_sld_precision->setMinimum(1);
_sld_precision->setMaximum(1000);
_sld_precision->setTickInterval(1);
_sld_precision->setValue(20);
_sld_precision->adjustSize();
_sld_alpha = new QSlider(Qt::Horizontal, plot_view);
_sld_alpha->setMinimum(1);
_sld_alpha->setMaximum(1000);
_sld_alpha->setTickInterval(1);
_sld_alpha->setValue(50);
_sld_alpha->adjustSize();
_lbl_knot = new QLabel("initial knots", plot_view);
_lbl_knot->setAlignment(Qt::AlignRight);
_lbl_knot->adjustSize();
_lbl_level = new QLabel("level", plot_view);
_lbl_level->setAlignment(Qt::AlignRight);
_lbl_knot->adjustSize();
_sld_level = new QSlider(Qt::Horizontal, plot_view);
_sld_level->setMinimum(1);
_sld_level->setMaximum(10);
_sld_level->setTickInterval(1);
_sld_level->setValue(1);
_sld_level->adjustSize();
QSignalMapper* signal_map = new QSignalMapper(plot_view);
signal_map->setMapping(_b1_rbtn, 0); // no boundary
signal_map->setMapping(_b2_rbtn, 1); // c1 boundary
signal_map->setMapping(_b3_rbtn, 2); // c2 boundary
QObject::connect(_b1_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
QObject::connect(_b2_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
QObject::connect(_b3_rbtn, SIGNAL(clicked()), signal_map, SLOT(map()));
QObject::connect(signal_map, SIGNAL(mapped(int)), plot_view,
SLOT(setBoundary(int)));
QObject::connect(_sld_precision, &QSlider::valueChanged, plot_view,
&PlotViewInterpolation::changePrecision);
QObject::connect(_sld_alpha, &QSlider::valueChanged, plot_view,
&PlotViewInterpolation::changeAlpha);
QObject::connect(_sld_level, &QSlider::valueChanged, plot_view,
&PlotViewInterpolation::changeLevel);
}