本文整理汇总了C++中ObjectItem::child方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectItem::child方法的具体用法?C++ ObjectItem::child怎么用?C++ ObjectItem::child使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectItem
的用法示例。
在下文中一共展示了ObjectItem::child方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QFileInfo
bool Anm2DAsm::makeFromEditData2Inc(EditData &rEditData, QString qsFname)
{
qsFname = QFileInfo(qsFname).baseName().toUpper();
m_pModel = rEditData.getObjectModel();
if (m_bFlat)
{
ObjectModel *p = new ObjectModel();
p->copy(m_pModel);
p->flat();
m_pModel = p;
}
ObjectItem *pRoot = m_pModel->getItemFromIndex(QModelIndex());
// ObjectItem *pObj = pRoot->child(0);
addString("; このファイルはAnimationCreatorにより生成されました。\n");
addString("\n");
for (int i = 0; i < pRoot->childCount(); i++)
{
ObjectItem *pObj = pRoot->child(i);
addString("%define\t\tACO_" + qsFname + "__" + pObj->getName().replace(" ", "_").toUpper().toUtf8() + QString("\t\t%1").arg(i) + "\n");
}
addString("\n");
for (int i = 0; i < pRoot->childCount(); i++)
{
ObjectItem *pObj = pRoot->child(i);
QVector4D qv4AreaMin = QVector4D(FLT_MAX, FLT_MAX, FLT_MAX, 0);
QVector4D qv4AreaMax = QVector4D(FLT_MIN, FLT_MIN, FLT_MIN, 0);
QString qsLabel = "ACL_" + qsFname + "__" + pObj->getName().replace(" ", "_").toUpper().toUtf8() + "__";
addString("%define\t\t" + qsLabel + "ROOT\t\t0\n");
makeFromEditDataArea(pObj, &qv4AreaMin, &qv4AreaMax, true);
addString("\t\t; Area:" + QString("(%1, %2, %3)-(%4, %5, %6) size:(%7, %8, %9)").arg(qv4AreaMin.x(), 0, 'f').arg(qv4AreaMin.y(), 0, 'f').arg(qv4AreaMin.z(), 0, 'f').arg(qv4AreaMax.x(), 0, 'f').arg(qv4AreaMax.y(), 0, 'f').arg(qv4AreaMax.z(), 0, 'f').arg(qv4AreaMax.x() - qv4AreaMin.x(), 0, 'f').arg(qv4AreaMax.y() - qv4AreaMin.y(), 0, 'f').arg(qv4AreaMax.z() - qv4AreaMin.z(), 0, 'f') + "\n");
m_nCnt = 1;
for (int j = 0; j < pObj->childCount(); j++)
{
ObjectItem *pChild = pObj->child(j);
makeFromEditData2IncTip(qsLabel, pChild);
}
addString("\n");
}
return true;
}
示例2: removeRows
bool CObjectModel::removeRows(int row, int count, const QModelIndex &parent)
{
beginRemoveRows(parent, row, row+count-1) ;
ObjectItem *p = getItemFromIndex(parent) ;
p->removeChild(p->child(row)) ;
endRemoveRows();
return true ;
}
示例3: index
QModelIndex CObjectModel::index(int row, int column, const QModelIndex &parent) const
{
if ( !hasIndex(row, column, parent) ) { return QModelIndex() ; }
ObjectItem *p = getItemFromIndex(parent) ;
ObjectItem *pChild = p->child(row) ;
if ( pChild ) {
return createIndex(row, column, pChild) ;
}
return QModelIndex() ;
}
示例4: index
QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)
const
{
if (!hasIndex(row, column, parent))
return QModelIndex();
ObjectItem *parentItem;
if (!parent.isValid())
parentItem = rootItem;
else
parentItem = static_cast<ObjectItem*>(parent.internalPointer());
ObjectItem *childItem = parentItem->child(row);
if (childItem)
return createIndex(row, column, childItem);
else
return QModelIndex();
}
示例5: QWidget
AnimationForm::AnimationForm(CEditData *pImageData, CSettings *pSetting, QWidget *parent) :
QWidget(parent),
ui(new Ui::AnimationForm)
{
m_pEditData = pImageData ;
m_pSetting = pSetting ;
m_bDontSetData = false ;
m_frameStart = pSetting->getFrameStart() ;
m_frameEnd = pSetting->getFrameEnd() ;
m_oldWinSize = QSize(-1, -1) ;
ui->setupUi(this);
m_pEditData->setTreeView(ui->treeView) ;
ui->label_frame->setEditData(m_pEditData) ;
ui->label_frame->setHorizontalBar(ui->horizontalScrollBar_frame) ;
m_pDataMarker = ui->label_frame ;
setFocusPolicy(Qt::StrongFocus);
m_pGlWidget = new AnimeGLWidget(pImageData, pSetting, this) ;
ui->scrollArea_anime->setWidget(m_pGlWidget);
m_pGlWidget->resize(m_pSetting->getAnmWindowW(), m_pSetting->getAnmWindowH());
m_pGlWidget->setDrawArea(m_pSetting->getAnmWindowW(), m_pSetting->getAnmWindowH());
m_pGlWidget->show();
ui->radioButton_pos->setChecked(true);
ui->checkBox_grid->setChecked(true);
ui->spinBox_fps->setValue(60) ;
ui->checkBox_frame->setChecked(pSetting->getDrawFrame());
ui->checkBox_center->setChecked(pSetting->getDrawCenter());
ui->spinBox_frame_start->setValue(m_frameStart) ;
ui->spinBox_frame_end->setValue(m_frameEnd) ;
ui->label_frame->slot_setFrameStart(m_frameStart) ;
ui->label_frame->slot_setFrameEnd(m_frameEnd) ;
for ( int i = 0 ; i < m_pEditData->getImageDataListSize() ; i ++ ) {
CEditData::ImageData *p = m_pEditData->getImageData(i) ;
if ( !p ) { continue ; }
ui->comboBox_image_no->addItem(tr("%1").arg(p->nNo));
}
m_pSplitter = new AnimationWindowSplitter(this) ;
m_pSplitter->addWidget(ui->treeView) ;
m_pSplitter->addWidget(ui->scrollArea_anime) ;
m_pSplitter->setGeometry(ui->treeView->pos().x(),
ui->treeView->pos().y(),
ui->scrollArea_anime->width()+ui->scrollArea_anime->pos().x()-ui->treeView->pos().x(),
ui->treeView->height());
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
ui->treeView->setModel(pModel);
ui->treeView->header()->setHidden(true);
ui->treeView->setContextMenuPolicy(Qt::CustomContextMenu);
ui->treeView->setDragEnabled(true) ;
ui->treeView->setAcceptDrops(true) ;
ui->treeView->setDropIndicatorShown(true) ;
ui->treeView->setDragDropMode(QAbstractItemView::DragDrop) ;
ui->treeView->setFocusPolicy(Qt::NoFocus);
ObjectItem *root = pModel->getItemFromIndex(QModelIndex()) ;
if ( !root->childCount() ) {
addNewObject(trUtf8("New Object"));
}
else {
if ( root->child(0) ) {
QModelIndex index = pModel->index(0) ;
ui->treeView->setCurrentIndex(index);
}
}
}
m_pActTreeViewAdd = new QAction(QString("Add Object"), this);
m_pActTreeViewCopy = new QAction(QString("Copy Object"), this) ;
m_pActTreeViewDel = new QAction(QString("Delete"), this);
m_pActTreeViewLayerDisp = new QAction(QString("Disp"), this) ;
m_pActTreeViewLayerLock = new QAction(QString("Lock"), this) ;
m_pTimer = new QTimer(this) ;
m_pTimer->setInterval((int)(100.0f/6.0f));
connect(ui->label_frame, SIGNAL(sig_changeValue(int)), this, SLOT(slot_frameChanged(int))) ;
connect(ui->radioButton_pos, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioPos(bool))) ;
connect(ui->radioButton_rot, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioRot(bool))) ;
connect(ui->radioButton_center, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioCenter(bool))) ;
connect(ui->radioButton_scale, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioScale(bool))) ;
connect(ui->radioButton_path, SIGNAL(clicked(bool)), this, SLOT(slot_clickedRadioPath(bool))) ;
connect(ui->treeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slot_treeViewMenuReq(QPoint))) ;
connect(ui->treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(slot_changeSelectObject(QModelIndex))) ;
connect(m_pGlWidget, SIGNAL(sig_dropedImage(QRectF, QPoint, int)), this, SLOT(slot_dropedImage(QRectF, QPoint, int))) ;
connect(m_pGlWidget, SIGNAL(sig_selectLayerChanged(QModelIndex)), this, SLOT(slot_selectLayerChanged(QModelIndex))) ;
connect(m_pGlWidget, SIGNAL(sig_dragedImage(FrameData)), this, SLOT(slot_setUI(FrameData))) ;
connect(m_pGlWidget, SIGNAL(sig_deleteFrameData()), this, SLOT(slot_deleteFrameData())) ;
//.........这里部分代码省略.........
示例6: fi
bool Anm2DAsm::makeFromEditData(EditData &rEditData)
{
m_pModel = rEditData.getObjectModel();
if (m_bFlat)
{
ObjectModel *p = new ObjectModel();
p->copy(m_pModel);
p->flat();
m_pModel = p;
}
ObjectItem *pRoot = m_pModel->getItemFromIndex(QModelIndex());
// 画像をラベル化
// 未使用画像をスキップするテーブル構築
int nVram = 0;
{
for (int i = 0; i < rEditData.getImageDataListSize(); i++)
{
if (i >= KM_VRAM_MAX)
{
return false;
}
EditData::ImageData *p = rEditData.getImageData(i);
if (!p)
continue;
QFileInfo fi(p->fileName);
QString sImageLabel = fi.fileName();
sImageLabel = QString("ID_") + sImageLabel.replace(".", "_").toUpper();
sImageLabel = sImageLabel.toUtf8();
m_aqsVramID[i] = sImageLabel;
m_bUnused[i] = true;
}
for (int i = 0; i < pRoot->childCount(); i++)
{
ObjectItem *pObj = pRoot->child(i);
for (int j = 0; j < pObj->childCount(); j++)
{
ObjectItem *pChild = pObj->child(j);
subUnusedVramSkip(pChild);
}
}
for (int i = 0; i < rEditData.getImageDataListSize(); i++)
{
if (m_bUnused[i] == false)
nVram++;
}
}
addString(";----------------------------------------------------------------\n");
addString("; @kamefile\t" + pRoot->getName().toUtf8() + "\n");
addString(";---------------------------------------------------------------- HEADER\n");
addString("\t\t\%include\t\"../imageid.inc\"\n");
addString("\n");
addString(";---------------------------------------------------------------- DATA\n");
addString("%define\t\tNO_READ\t\t0\n");
addString("%define\t\tF32(f32)\t\t__float32__(f32)\n");
addString("data:\n");
addString(";---------------------------------------------------------------- ANM_HEAD\n");
addString("\t\t\tdb\t\t'ANM0'\t\t; ANM0\n");
addString("\t\t\tdd\t\t00000003h\t\t; uVersion\n");
addString("\t\t\tdd\t\t" + QString("%1").arg(/*rEditData.getImageDataListSize()*/ nVram) + "\t\t; nVram\n");
addString("\t\t\tdd\t\t.vram\t\t; pauVram\n");
addString("\t\t\tdd\t\t" + QString("%1").arg(pRoot->childCount()) + "\t\t; nObject\n");
addString("\t\t\tdd\t\t.object\t\t; paObj\n");
addString("\t\n");
addString("\t.vram:\n");
for (int i = 0; i < rEditData.getImageDataListSize(); i++)
{
if (i >= KM_VRAM_MAX)
{
return false;
}
if (m_bUnused[i])
continue;
EditData::ImageData *p = rEditData.getImageData(i);
if (!p)
continue;
QFileInfo fi(p->fileName);
QString sImageLabel = fi.fileName();
sImageLabel = QString("ID_") + sImageLabel.replace(".", "_").toUpper();
sImageLabel = sImageLabel.toUtf8();
m_aqsVramID[i] = sImageLabel;
addString("\t\t\tdd\t\t" + m_aqsVramID[i] + "\n");
}
addString("\t\n");
addString("\t.object:\n");
for (int i = 0; i < pRoot->childCount(); i++)
{
addString("\t\t\tdd\t\tanmobj" + QString("%1").arg(i) + "\n");
}
addString("\n");
for (int i = 0; i < pRoot->childCount(); i++)
{
ObjectItem *pObj = pRoot->child(i);
QVector4D qv4AreaMin = QVector4D(FLT_MAX, FLT_MAX, FLT_MAX, 0);
QVector4D qv4AreaMax = QVector4D(FLT_MIN, FLT_MIN, FLT_MIN, 0);
addString(";---------------------------------------------------------------- ANM_OBJ\n");
addString("; " + QString(pObj->getName().toUtf8()) + "\n");
addString("anmobj" + QString("%1").arg(i) + ":\n");
//.........这里部分代码省略.........