本文整理汇总了C++中Section::height方法的典型用法代码示例。如果您正苦于以下问题:C++ Section::height方法的具体用法?C++ Section::height怎么用?C++ Section::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePositivesGroup
void ClassifierTrainer::updatePositivesGroup()
{
project->load(); // get the latest from the file system
// remove existing model if it exists
if (positivesModel) delete positivesModel;
// create column headers for the model
positivesModel = new QStandardItemModel();
positivesModel->setColumnCount(5);
positivesModel->setHeaderData(0, Qt::Horizontal, "Image", Qt::DisplayRole);
positivesModel->setHeaderData(1, Qt::Horizontal, "X", Qt::DisplayRole);
positivesModel->setHeaderData(2, Qt::Horizontal, "Y", Qt::DisplayRole);
positivesModel->setHeaderData(3, Qt::Horizontal, "Width", Qt::DisplayRole);
positivesModel->setHeaderData(4, Qt::Horizontal, "Height", Qt::DisplayRole);
QStandardItem *invisibleRootNode = positivesModel->invisibleRootItem();
QList<QString> *keys = project->positives();
qDebug() << "Number of positives loaded: " << keys->length();
for(int i=0; i < keys->length(); i++)
{
QString path = keys->at(i);
QStandardItem *imageRowItem = new QStandardItem(path);
imageRowItem->setEditable(false);
imageRowItem->setIcon(QIcon(":/assets/img/image.png"));
QList<Section> sections = project->positive_sections()->values(path);
for(int j=0; j < sections.length(); j++)
{
Section s = sections.at(j);
// first column
QString firstColumn = path;
QStandardItem *firstColumnItem = new QStandardItem(firstColumn);
firstColumnItem->setIcon(QIcon(":/assets/img/shading.png"));
firstColumnItem->setEditable(false);
// second column
QStandardItem *secondColumnItem = new QStandardItem(QString::number(s.x()));
secondColumnItem->setEditable(false);
// third column
QStandardItem *thirdColumnItem = new QStandardItem(QString::number(s.y()));
thirdColumnItem->setEditable(false);
// fourth column
QStandardItem *fourthColumnItem = new QStandardItem(QString::number(s.width()));
fourthColumnItem->setEditable(false);
// fifth column
QStandardItem *fifthColumnItem = new QStandardItem(QString::number(s.height()));
fifthColumnItem->setEditable(false);
QList<QStandardItem *> sectionRowItems;
sectionRowItems.append(firstColumnItem);
sectionRowItems.append(secondColumnItem);
sectionRowItems.append(thirdColumnItem);
sectionRowItems.append(fourthColumnItem);
sectionRowItems.append(fifthColumnItem);
imageRowItem->appendRow(sectionRowItems);
}
invisibleRootNode->appendRow(imageRowItem);
}
positivesTreeView->setModel(positivesModel);
positivesTreeView->setColumnWidth(0, 350);
positivesTreeView->resizeColumnToContents(1);
positivesTreeView->resizeColumnToContents(2);
positivesTreeView->resizeColumnToContents(3);
positivesTreeView->resizeColumnToContents(4);
positivesTreeView->expandAll();
}