本文整理汇总了C++中ListWidget::listWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ ListWidget::listWidget方法的具体用法?C++ ListWidget::listWidget怎么用?C++ ListWidget::listWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListWidget
的用法示例。
在下文中一共展示了ListWidget::listWidget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
QWidget *WalkmeshManager::buildWalkmeshPage()
{
QWidget *ret = new QWidget(this);
ListWidget *listWidget = new ListWidget(ret);
listWidget->addAction(ListWidget::Add, tr("Ajouter triangle"), this, SLOT(addTriangle()));
listWidget->addAction(ListWidget::Rem, tr("Supprimer triangle"), this, SLOT(removeTriangle()));
idToolbar = listWidget->toolBar();
idList = listWidget->listWidget();
idVertices[0] = new VertexWidget(ret);
idVertices[1] = new VertexWidget(ret);
idVertices[2] = new VertexWidget(ret);
idAccess[0] = new QSpinBox(ret);
idAccess[1] = new QSpinBox(ret);
idAccess[2] = new QSpinBox(ret);
idAccess[0]->setRange(-32768, 32767);
idAccess[1]->setRange(-32768, 32767);
idAccess[2]->setRange(-32768, 32767);
QHBoxLayout *accessLayout0 = new QHBoxLayout;
accessLayout0->addWidget(new QLabel(tr("Triangle accessible via la ligne 1-2 :")));
accessLayout0->addWidget(idAccess[0]);
QHBoxLayout *accessLayout1 = new QHBoxLayout;
accessLayout1->addWidget(new QLabel(tr("Triangle accessible via la ligne 2-3 :")));
accessLayout1->addWidget(idAccess[1]);
QHBoxLayout *accessLayout2 = new QHBoxLayout;
accessLayout2->addWidget(new QLabel(tr("Triangle accessible via la ligne 3-1 :")));
accessLayout2->addWidget(idAccess[2]);
QGridLayout *layout = new QGridLayout(ret);
layout->addWidget(listWidget, 0, 0, 7, 1, Qt::AlignLeft);
layout->addWidget(new QLabel(tr("Point 1 :")), 0, 1);
layout->addWidget(idVertices[0], 0, 2);
layout->addWidget(new QLabel(tr("Point 2 :")), 1, 1);
layout->addWidget(idVertices[1], 1, 2);
layout->addWidget(new QLabel(tr("Point 3 :")), 2, 1);
layout->addWidget(idVertices[2], 2, 2);
layout->addLayout(accessLayout0, 3, 1, 1, 2);
layout->addLayout(accessLayout1, 4, 1, 1, 2);
layout->addLayout(accessLayout2, 5, 1, 1, 2);
layout->setRowStretch(6, 1);
connect(idList, SIGNAL(currentRowChanged(int)), SLOT(setCurrentId(int)));
connect(idVertices[0], SIGNAL(valuesChanged(Vertex_s)), SLOT(editIdTriangle(Vertex_s)));
connect(idVertices[1], SIGNAL(valuesChanged(Vertex_s)), SLOT(editIdTriangle(Vertex_s)));
connect(idVertices[2], SIGNAL(valuesChanged(Vertex_s)), SLOT(editIdTriangle(Vertex_s)));
connect(idAccess[0], SIGNAL(valueChanged(int)), SLOT(editIdAccess(int)));
connect(idAccess[1], SIGNAL(valueChanged(int)), SLOT(editIdAccess(int)));
connect(idAccess[2], SIGNAL(valueChanged(int)), SLOT(editIdAccess(int)));
return ret;
}