本文整理汇总了C++中QSpinBox::setFixedSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QSpinBox::setFixedSize方法的具体用法?C++ QSpinBox::setFixedSize怎么用?C++ QSpinBox::setFixedSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSpinBox
的用法示例。
在下文中一共展示了QSpinBox::setFixedSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: passSimulationTime
//.........这里部分代码省略.........
qDebug()<<"max y position"<<ypos;
QGraphicsTextItem *item1 = new QGraphicsTextItem(tr("wind speeds in knots"));
item1->setPos(mapToScene(-20,-20));
scene->addItem(item1);
for(int time=0;time<=simutimeinseconds;time= time+5)
{
QString str;
str.setNum(time);
QGraphicsTextItem *item = new QGraphicsTextItem(str);
// if(time%2==0)
// {
// QLinearGradient lGrad(QPointF(xinitialpos, 668), QPointF(xinitialpos, 100));
// lGrad.setColorAt(0, Qt::black);
// lGrad.setColorAt(1, Qt::darkBlue);
// }
item->setPos(mapToScene(xinitialpos,668));
scene->addItem(item);
// QGraphicsLineItem *line = new QGraphicsLineItem();
// line->setPos(mapToScene(xinitialpos,666));
xinitialpos = xinitialpos+gapx;
// QPen pen(Qt::yellow,3,Qt::DashDotLine,Qt::RoundCap,Qt::RoundJoin);
// scene->addLine(xinitialpos+4,665,xinitialpos+4,20,pen);
}
QGraphicsTextItem *item2 = new QGraphicsTextItem(tr("time in seconds"));
item2->setPos(mapToScene(668,681));
scene->addItem(item2);
timer = new QTimer(this);
connect(timer,SIGNAL(timeout()),scene,SLOT(advance()));
horizontalGroupBox = new QGroupBox(tr("Wind angles"));
horizontalGroupBoxspinboxes = new QGroupBox();
QHBoxLayout *hboxlayout = new QHBoxLayout;
QHBoxLayout *hboxlayoutspinboxes = new QHBoxLayout;
// //QScrollArea *scroll=new QScrollArea();
for(int i=0;i<noofperiods;i++)
{
QDial *dial= new QDial();
QSize size(35,35);
dial->setMinimumSize(size);
dial->setMaximumSize(size);
dial->setNotchesVisible(1);
dial->setWrapping(1);
dial->setMaximum(359);
dial->setMinimum(0);
list.append(dial);
// //list.append(dial);
QSpinBox * spin = new QSpinBox(this);
// // //QLabel *label = new QLabel(this);
// // //spinboxlist[i]= new QSpinBox(this);
spin->setMaximum(359);
spin->setMinimum(0);
spin->setFixedSize(35,35);
spinboxlist.append(spin);
connect(list.at(i),SIGNAL(valueChanged(int)),spinboxlist.at(i),SLOT(setValue(int)));
connect(spinboxlist.at(i),SIGNAL(valueChanged(int)),list.at(i),SLOT(setValue(int)));
// //int value= list.at(i)->value();
// //qDebug()<<"dial value "<<value;
// //connect(list.at(i),SIGNAL(valueChanged(int)),view,SLOT(setValuesOfList(int)));
hboxlayout->addWidget(list[i]);
hboxlayoutspinboxes->addWidget(spinboxlist[i]);
// hboxlayoutspinboxes->addSpacing(0);
//qDebug()<<"dial width"<<dial->width();
// //hboxlayout->addWidget(spinboxlist[i]);
}
horizontalGroupBox->setLayout(hboxlayout);
// //scroll->setWidget(horizontalGroupBox);
horizontalGroupBoxspinboxes->setLayout(hboxlayoutspinboxes);
//horizontalGroupBox->set
QGraphicsProxyWidget *proxy1= scene->addWidget(horizontalGroupBox);
proxy1->setPos(0,700);
QGraphicsProxyWidget *proxy2= scene->addWidget(horizontalGroupBoxspinboxes);
proxy2->setPos(0,760);
//QGraphicsProxyWidget *proxy1= scene->addWidget(horizontalGroupBoxspinboxes);
//scene has advance () slot, what it does is it says every object in the scee
//that it is time to advance one step or multiple steps
//thast what animation is
}