本文整理汇总了C++中ObjectItem::getIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectItem::getIndex方法的具体用法?C++ ObjectItem::getIndex怎么用?C++ ObjectItem::getIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectItem
的用法示例。
在下文中一共展示了ObjectItem::getIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slot_deleteAllFrame
void DataMarkerLabel::slot_deleteAllFrame()
{
ObjectModel *pModel = m_pEditData->getObjectModel();
ObjectItem *pItem = pModel->getObject(m_pEditData->getSelIndex());
if (!pItem)
{
return;
}
m_pEditData->cmd_deleteAllFrame(pItem->getIndex(), m_value);
}
示例2: paintEvent
void DataMarkerLabel::paintEvent(QPaintEvent * /*event*/)
{
QPainter painter(this);
painter.drawRect(0, 0, width() - 1, height() - 1);
if (m_frameEnd - m_frameStart < 1)
{
return;
}
drawFrameBase(painter);
ObjectModel *pModel = m_pEditData->getObjectModel();
QModelIndex index = m_pEditData->getSelIndex();
ObjectItem *obj = pModel->getObject(index);
if (!obj)
{
return;
}
QList<int> frames;
drawLayer(obj->getIndex(), painter, index, frames);
if (m_pressCurrentFrame >= 0)
{
int x0 = getX(m_pressCurrentFrame);
int x1 = getX(m_pressCurrentFrame + 1);
int y0 = 0;
QColor col = QColor(255, 0, 0, 128);
if (pModel->isObject(index))
{
y0 = height() / 3;
col.setRed(255);
}
painter.fillRect(x0, y0, x1 - x0, height() / 3, col);
}
}
示例3: slot_dropedImage
// ドロップ時のスロット
// レイヤ追加
void AnimationForm::slot_dropedImage( QRectF rect, QPoint pos, int imageIndex )
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
int frameNum = ui->label_frame->value() ;
QModelIndex index = ui->treeView->currentIndex() ;
if ( !index.isValid() ) {
qWarning() << "slot_dropedImage current index invalid 0" ;
return ;
}
ObjectItem *pObjItem = pModel->getObject(index) ;
if ( !pObjItem ) {
qWarning() << "slot_dropedImage current obj 0" ;
return ;
}
if ( !m_pSetting->getLayerHierarchy() ) {
index = pObjItem->getIndex() ;
}
pos -= QPoint((m_pSetting->getAnmWindowW()/2), (m_pSetting->getAnmWindowH()/2)) ; // GLWidgetのローカルポスに変換
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
bool valid ;
QMatrix4x4 mat = pItem->getDisplayMatrix(frameNum, &valid) ;
if ( valid ) {
QMatrix4x4 inv = mat.inverted(&valid) ;
if ( valid ) {
pos = inv.map(pos) ;
}
}
index = m_pEditData->cmd_addItem(QString("Layer %1").arg(pObjItem->childCount()), index) ;
ui->treeView->setCurrentIndex(index) ;
// m_pEditData->setSelIndex(index) ;
// ツリービューに追加
FrameData frameData ;
frameData.pos_x = pos.x() ;
frameData.pos_y = pos.y() ;
frameData.pos_z = 0 ;
frameData.rot_x =
frameData.rot_y =
frameData.rot_z = 0 ;
frameData.center_x = (rect.width()) / 2 ;
frameData.center_y = (rect.height()) / 2 ;
frameData.frame = frameNum ;
frameData.fScaleX = frameData.fScaleY = 1.0f ;
frameData.setRect(rect);
frameData.nImage = imageIndex ;
frameData.bUVAnime = false ;
frameData.rgba[0] =
frameData.rgba[1] =
frameData.rgba[2] =
frameData.rgba[3] = 255 ;
QList<QWidget *> updateWidget ;
updateWidget << m_pGlWidget ;
updateWidget << m_pDataMarker ;
m_pEditData->cmd_addFrameData(index, frameData, updateWidget) ;
}