尝试状态值自动
This commit is contained in:
+35
-10
@@ -109,6 +109,9 @@ StatusUI::StatusUI(QWidget *parent) :
|
||||
}
|
||||
|
||||
|
||||
basewidth = this->width();
|
||||
|
||||
|
||||
}
|
||||
|
||||
StatusUI::~StatusUI()
|
||||
@@ -122,25 +125,47 @@ void StatusUI::resizeEvent(QResizeEvent *event)
|
||||
|
||||
//计算一个使用多少长度
|
||||
|
||||
|
||||
/*
|
||||
if(GroupList.size() > 0)
|
||||
{
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
|
||||
int current_height = 0;
|
||||
|
||||
this->resize(basewidth,this->height());
|
||||
|
||||
for( QMap<int,StateGroup *>::iterator i = GroupList.begin();i != GroupList.end();i++)
|
||||
{
|
||||
StateGroup *g = i.value();
|
||||
//ui->gridLayout->addWidget(g,g->ID(),0,1,1);
|
||||
//
|
||||
|
||||
qDebug() << g->size() << g->lenght();
|
||||
|
||||
|
||||
if((current_height + g->lenght()) < this->height())
|
||||
{
|
||||
ui->gridLayout->addWidget(g,row,column,1,1);
|
||||
|
||||
row++;
|
||||
|
||||
current_height += g->lenght();
|
||||
}
|
||||
else
|
||||
{
|
||||
current_height = 0;
|
||||
column ++;
|
||||
row = 0;
|
||||
this->resize(this->width() * (column+1),this->height());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
qDebug() << g->size();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
QVBoxLayout * vb = new QVBoxLayout;
|
||||
vb->addStretch();
|
||||
ui->gridLayout->addLayout(vb,GroupList.size(),0,1,1);
|
||||
*/
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user