好吧我尝试将QMaemo5ListPickSelector与QMaemo5ValueButton一起使用,但是当我点击按钮时,会出现一个弹出对话框,但它没有任何列表..
这是我的意思的图片:
alt text http://i50.tinypic.com/24y3fki.png
这是我用来启动上述两个组件并填充列表的代码:
QMaemo5ValueButton *x = new QMaemo5ValueButton("Testing .. !");
QStandardItemModel model (10,2);
int j,k;
for(j=0;j<=1;j++)
{
k=0;
for(i=0;i<=9;i++)
{
QStandardItem *item = new QStandardItem(QString("%0").arg(k));
k+=5;
model.setItem(i,j,item);
}
}
x->setValueLayout(QMaemo5ValueButton::ValueBesideText);
QMaemo5ListPickSelector *sel = new QMaemo5ListPickSelector();
sel->setModel(&model);
x->setPickSelector(sel);
hbox->addWidget(x);
我会说我可能错误地填充了这个列表..