void DataMarkerLabel::slot_copyAllFrame()
{
    ObjectModel *pModel = m_pEditData->getObjectModel();
    ObjectItem *pItem = pModel->getObject(m_pEditData->getSelIndex());
    if (!pItem)
    {
        return;
    }
    m_pEditData->setCopyAllFrameData(pItem, m_value);
}
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);
}
示例#3
0
// アニメ再生中
void AnimeGLWidget::drawLayers_Anime()
{
    ObjectModel *pModel = m_pEditData->getObjectModel();

    ObjectItem *pItem = pModel->getObject(m_pEditData->getSelIndex());
    if (!pItem)
    {
        return;
    }

    if (m_pSetting->getUseZSort())
    {
        m_drawList.clear();
    }
    drawLayers(pItem);

    if (m_pSetting->getUseZSort())
    {
        sortDrawList();
        drawList();
    }
}
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);
    }
}