31 : QAbstractItemModel(parent)
32 , m_freezeKeyframePositions(false)
34 , m_reorderingKeyframes(false)
35 , m_imageIdleWatcher(10)
52 if (!hasIndex(row, column,
parent)) {
67 return createIndex(row, column, childItem.data());
69 return createIndex(row, column,
m_items.at(row).data());
75 if (!
index.isValid()) {
83 if (item.data() == childItemFirstLevel) {
91 int indexOfParent =
m_items.indexOf(parentItem);
92 return createIndex(indexOfParent, 0, parentItem.data());
100 else if (!
parent.parent().isValid()) {
102 return parentItem->childCount();
113 if (!
parent.parent().isValid()) {
122 if (!
index.isValid()) {
142 if (role == Qt::DisplayRole || role == Qt::EditRole || role == Qt::UserRole) {
145 ThumbnailData thumbnailData = qvariant_cast<ThumbnailData>(child->data());
146 if (role == Qt::UserRole) {
147 return thumbnailData.
pixmap;
154 CommentBox commentBox = qvariant_cast<CommentBox>(child->data());
155 if (role == Qt::UserRole) {
162 return child->data();
169 if (
index.isValid() && !
isLocked() && (role == Qt::EditRole || role == Qt::DisplayRole)) {
177 if (
value.toInt() < 0) {
180 ThumbnailData thumbnailData = qvariant_cast<ThumbnailData>(child->data());
182 child->setData(QVariant::fromValue<ThumbnailData>(thumbnailData));
198 const int implicitSceneDuration = qMax(
202 if (
value.toInt() < 0 && secondIndex.data().toInt() == 0) {
210 QModelIndex lastScene =
index.parent();
211 QModelIndex nextScene = this->
index(lastScene.row() + 1, 0);
213 while (nextScene.isValid()) {
215 const int lastSceneDuration = lastScene ==
index.parent() ? implicitSceneDuration
218 lastScene = nextScene;
219 nextScene = this->
index(lastScene.row() + 1, 0);
225 durationSeconds->setData(QVariant::fromValue<int>(implicitSceneDuration / fps));
226 durationFrames->setData(QVariant::fromValue<int>(implicitSceneDuration % fps));
236 playbackRange.
include(frameNum+totalDuration);
243 CommentBox commentBox = qvariant_cast<CommentBox>(child->data());
245 child->setData(QVariant::fromValue<CommentBox>(commentBox));
248 child->setData(
value);
262 CommentBox commentBox = qvariant_cast<CommentBox>(child->data());
264 child->setData(QVariant::fromValue<CommentBox>(commentBox));
273 QModelIndex
index = this->
index(0, 0, parentIndex);
278 QPixmap pxmap = QPixmap::fromImage(image);
279 pxmap = pxmap.scaled((1.5)*scale*
m_image->
size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
286 ThumbnailData thumbnailData = qvariant_cast<ThumbnailData>(child->data());
287 thumbnailData.
pixmap = pxmap;
288 child->setData(QVariant::fromValue<ThumbnailData>(thumbnailData));
297 if (!parentIndex.isValid()) {
301 QModelIndex currentScene = parentIndex;
302 QModelIndex nextScene =
index(currentScene.row() + 1, 0);
303 if (nextScene.isValid()) {
306 const int sceneDuration = nextSceneFrame - currentSceneFrame;
322 if(!
index.isValid()) {
323 return Qt::ItemIsDropEnabled;
328 return Qt::ItemIsDragEnabled | Qt::ItemIsSelectable | Qt::ItemIsEnabled;
332 return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemNeverHasChildren;
338 if (position < 0 || position >
m_items.count()) {
346 beginInsertRows(QModelIndex(), position, position+rows-1);
347 for (
int row = 0; row < rows; ++row) {
349 m_items.insert(position + row, newItem);
355 else if (!
parent.parent().isValid()) {
358 if (position < 0 || position > item->childCount()) {
361 beginInsertRows(
parent, position, position+rows-1);
362 for (
int row = 0; row < rows; ++row) {
363 item->insertChild(position, QVariant());
381 if (position < 0 || position >=
m_items.count()) {
389 beginRemoveRows(QModelIndex(), position, position+rows-1);
391 for (
int row = position + rows - 1; row >= position; row--) {
401 else if (!
parent.parent().isValid()) {
404 if (position < 0 || position >= item->childCount()) {
408 beginRemoveRows(
parent, position, position+rows-1);
409 for (
int row = 0; row < rows; ++row) {
410 item->removeChild(position);
421bool StoryboardModel::moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
const QModelIndex &destinationParent,
int destinationChild)
425 if (
moveRowsImpl(sourceParent, sourceRow, count, destinationParent, destinationChild, command)) {
426 if (!sourceParent.isValid()) {
427 const int sceneIndex = sourceRow < destinationChild ? destinationChild - 1 : destinationChild;
445 types << QLatin1String(
"application/x-krita-storyboard");
451 QMimeData *
mimeData =
new QMimeData();
454 QDataStream stream(&
encodeData, QIODevice::WriteOnly);
457 foreach (QModelIndex
index, indexes) {
458 if (
index.isValid()) {
459 int row =
index.row();
469 int row,
int column,
const QModelIndex &parent)
472 if (action == Qt::IgnoreAction) {
476 if (action == Qt::MoveAction &&
data->hasFormat(
"application/x-krita-storyboard")) {
477 QByteArray bytes =
data->data(
"application/x-krita-storyboard");
478 QDataStream stream(&bytes, QIODevice::ReadOnly);
490 while (!stream.atEnd()) {
492 QModelIndex
index = this->
index(sourceRow, 0);
493 moveRowIndexes.append(
index);
496 moveRows(QModelIndex(), moveRowIndexes.at(0).row(), moveRowIndexes.count(),
parent, row);
505 return Qt::CopyAction | Qt::MoveAction;
510 return Qt::CopyAction | Qt::MoveAction;
515 int visibleComments = 0;
521 return visibleComments;
533 int commentRow =
index.row() - 4;
534 int visibleComments = 0;
535 for (
int row = 0; row < commentRow; row++) {
540 return visibleComments;
640 while (end >= begin) {
641 const int row = begin + (end - begin) / 2;
642 const int nextRow = row + 1;
643 QModelIndex parentIndex =
index(row, 0);
645 QModelIndex nextParentIndex =
index(nextRow, 0);
648 if (framePerfect && frame == frameNumIndex.data().toInt()) {
650 }
else if (frame >= frameNumIndex.data().toInt() && (!nextParentIndex.isValid() || frame < nextFrameNumIndex.data().toInt())) {
652 }
else if (frame < frameNumIndex.data().toInt()) {
654 }
else if (frame > frameNumIndex.data().toInt()) {
659 return QModelIndex();
669 QModelIndex firstIndex =
index(0,0);
671 if (!firstIndex.isValid())
684 QItemSelectionRange indexRange(firstIndex, lastIndex);
685 return indexRange.indexes();
691 int nextKeyframeTime = INT_MAX;
696 KisKeyframeChannel* channel = node->getKeyframeChannel(KisKeyframeChannel::Raster.id(), false);
702 int nextKeyframeTimeQuery = channel->nextKeyframeTime(keyframeTime);
703 if (channel->keyframeAt(nextKeyframeTimeQuery)) {
704 if (nextKeyframeTime == INT_MAX) {
705 nextKeyframeTime = nextKeyframeTimeQuery;
707 nextKeyframeTime = qMin(nextKeyframeTime, nextKeyframeTimeQuery);
714 return nextKeyframeTime;
723 int lastKeyframeTime = 0;
728 KisKeyframeChannel* channel = node->getKeyframeChannel(KisKeyframeChannel::Raster.id(), false);
734 lastKeyframeTime = qMax(channel->lastKeyframeTime(), lastKeyframeTime);
739 return lastKeyframeTime;
750 QModelIndex nextScene =
index(sceneIndex.row() + 1, 0);
752 if (nextScene.isValid()) {
759 int lastFrameOfScene = sceneFrame;
760 for (
int frame = sceneFrame; frame < nextSceneFrame; frame =
nextKeyframeGlobal(frame)) {
761 lastFrameOfScene = frame;
764 return lastFrameOfScene;
770 int earliestFrame = INT_MAX;
776 typedef int AssociateFrameOffset;
778 QMultiHash<QModelIndex, AssociateFrameOffset> frameAssociates;
780 for (
int i = 0; i <
rowCount(); i++) {
781 QModelIndex sceneIndex =
index(i, 0);
783 earliestFrame = sceneFrame < earliestFrame ? sceneFrame : earliestFrame;
788 for(
int i = sceneFrame; i < lastFrameOfScene; i++) {
789 frameAssociates.insert(sceneIndex, i - sceneFrame);
793 if (earliestFrame == INT_MAX) {
816 QHash<int, KisKeyframeSP> originalKeyframes;
818 if (time >= earliestFrame && rasterChan->
keyframeAt(time)) {
819 originalKeyframes.insert(time, rasterChan->
keyframeAt(time));
825 int intendedSceneFrameTime = earliestFrame;
826 for (
int i = 0; i <
rowCount(); i++) {
827 QModelIndex sceneIndex =
index(i, 0);
829 Q_FOREACH(
const int& associateFrameOffset, frameAssociates.values(sceneIndex) ) {
830 if (!originalKeyframes.contains(srcFrame + associateFrameOffset))
833 rasterChan->
insertKeyframe(intendedSceneFrameTime + associateFrameOffset,
834 originalKeyframes.value(srcFrame + associateFrameOffset));
843 int intendedFrameValue = earliestFrame;
844 for (
int i = 0; i <
rowCount(); i++) {
845 QModelIndex sceneIndex =
index(i, 0);
856 if (!itemIndex.isValid()) {
863 int durationChange = newDuration - origSceneFrameLength;
864 if (durationChange == 0) {
868 if (origSceneFrameLength != 0) {
890 const int startFrame = affected.
start();
892 Q_FOREACH(KisKeyframeChannel* keyframeChannel, node->keyframeChannels()) {
893 if (keyframeChannel) {
895 int timeIter = affected.isInfinite() ?
896 keyframeChannel->lastKeyframeTime()
897 : keyframeChannel->activeKeyframeTime(affected.end());
899 KisKeyframeSP iterEnd = keyframeChannel->keyframeAt(keyframeChannel->previousKeyframeTime(startFrame));
901 while (keyframeChannel->keyframeAt(timeIter) &&
902 keyframeChannel->keyframeAt(timeIter) != iterEnd) {
903 keyframeChannel->moveKeyframe(timeIter, timeIter + offset, cmd);
904 timeIter = keyframeChannel->previousKeyframeTime(timeIter);
908 int timeIter = keyframeChannel->keyframeAt(startFrame) ? startFrame : keyframeChannel->nextKeyframeTime(startFrame);
910 KisKeyframeSP iterEnd = affected.isInfinite() ?
912 : keyframeChannel->keyframeAt(keyframeChannel->nextKeyframeTime(affected.end()));
914 while (keyframeChannel->keyframeAt(timeIter) != iterEnd) {
915 keyframeChannel->moveKeyframe(timeIter, timeIter + offset, cmd);
916 timeIter = keyframeChannel->nextKeyframeTime(timeIter);
937 if (!
index.isValid()) {
940 desiredIndex = after ?
index.row() + 1 :
index.row();
943 insertRow(desiredIndex);
949 if (
m_image && currentTime != desiredTime) {
954 switchTimeCmd->
redo();
970 const int row =
index.row();
976 const int timeOfNextScene = firstFrameOfScene + durationDeletedScene;
981 Q_FOREACH(KisKeyframeChannel* keyframeChannel, node->keyframeChannels()) {
982 int timeIter = keyframeChannel->keyframeAt(firstFrameOfScene)
984 : keyframeChannel->nextKeyframeTime(firstFrameOfScene);
986 while (keyframeChannel->keyframeAt(timeIter) && timeIter < timeOfNextScene) {
987 keyframeChannel->removeKeyframe(timeIter, command);
988 timeIter = keyframeChannel->nextKeyframeTime(timeIter);
1001 currentSceneFN.data().toInt(),
1004 switchTimeCmd->
redo();
1010 for (
int i = row; i < rowCount(); i++) {
1012 setData(frameNumIndex, data(frameNumIndex).toInt() - durationDeletedScene);
1017 slotUpdateThumbnails();
1018 m_renderScheduler->slotStartFrameRendering();
1051 const QModelIndex nextScene =
index( lastScene.row() + 1, 0);
1052 const bool extendsLastScene = lastScene.isValid() && !nextScene.isValid();
1055 if (extendsLastScene) {
1057 const int desiredDuration = time - sceneStartFrame + 1;
1059 const int duration = qMax(actualDuration, desiredDuration);
1066 Q_EMIT dataChanged(lastScene, lastScene);
1099 QModelIndex sceneIndex =
index(0,0);
1100 QModelIndex nextScene =
index(1,0);
1101 if (nextScene.isValid()) {
1103 while (sceneIndex.isValid() && nextScene.isValid()) {
1107 const int duration = nextSceneFrame - sceneFrame;
1114 sceneIndex = nextScene;
1115 nextScene =
index(sceneIndex.row() + 1, sceneIndex.column());
1118 Q_EMIT dataChanged(
index(0,0), sceneIndex);
1119 }
else if (sceneIndex.isValid()) {
1124 const int duration = lastKeyframe + 1 - sceneFrame;
1132 Q_EMIT dataChanged(sceneIndex, sceneIndex);
1144 bool affected =
true;
1155 Q_FOREACH(
const QModelIndex& storyboardItemIndex, indices ) {
1156 if (!storyboardItemIndex.isValid())
1160 if (storyboardItemIndex.parent().isValid())
1181 foreach(QModelIndex
index, dirtyIndexes) {
1194 if (
index.isValid()) {
1207 emit(layoutChanged());
1214 for(
int row = 0; row < numItems; row++) {
1215 QModelIndex parentIndex =
index(row, 0);
1216 insertRows(4 + first, last - first + 1, parentIndex);
1225 for(
int row = 0; row < numItems; row++) {
1226 QModelIndex parentIndex =
index(row, 0);
1227 removeRows(4 + first, last - first + 1, parentIndex);
1233 const QModelIndex &destinationParent,
int destinationRow)
1235 Q_UNUSED(sourceParent);
1236 Q_UNUSED(destinationParent);
1238 for(
int row = 0; row < numItems; row++) {
1239 QModelIndex parentIndex =
index(row, 0);
1240 moveRowsImpl(parentIndex, start + 4, end - start + 1, parentIndex, destinationRow + 4);
1252 for (
int row = position + 1; row <
rowCount(); ++row) {
1257 QModelIndex parentIndex =
index(position, 0);
1261 QString sceneName = i18nc(
"default name for storyboard item",
"scene ") + QString::number(
m_lastScene);
1264 const bool firstEntry =
rowCount() == 1;
1266 if (position == 0) {
1287 switchFrameCmd->
redo();
1293 if (scene.parent().isValid() || !
m_image) {
1310 if (node->supportsKeyframeChannel(KisKeyframeChannel::Raster.id())
1311 && node->isEditable(true)) {
1313 KisKeyframeChannel* chan = node->getKeyframeChannel(KisKeyframeChannel::Raster.id(), true);
1314 const int activeFrameTime = chan->activeKeyframeTime(targetFrame);
1315 chan->copyKeyframe(activeFrameTime, targetFrame, cmd);
1327 if (node->supportsKeyframeChannel(KisKeyframeChannel::Raster.id())
1328 && node->isEditable(true)) {
1330 KisKeyframeChannel* chan = node->getKeyframeChannel(KisKeyframeChannel::Raster.id(), true);
1331 chan->addKeyframe(targetFrame, cmd);
1338 const QModelIndex &destinationParent,
int destinationChild,
KUndo2Command* parentCMD)
1340 if (sourceParent != destinationParent) {
1343 if (destinationChild == sourceRow || destinationChild == sourceRow + 1) {
1352 bool dryrun = (parentCMD !=
nullptr);
1354 if (destinationChild > sourceRow + count - 1) {
1356 beginMoveRows(sourceParent, sourceRow, sourceRow + count - 1, destinationParent, destinationChild + count - 1);
1357 destinationChild = destinationChild - count;
1360 beginMoveRows(sourceParent, sourceRow, sourceRow + count - 1, destinationParent, destinationChild);
1363 if (sourceParent == destinationParent && sourceParent.isValid() && !sourceParent.parent().isValid()) {
1364 const QModelIndex
parent = sourceParent;
1365 for (
int row = 0; row < count; row++) {
1366 if (sourceRow < StoryboardItem::Comments || sourceRow >=
rowCount(
parent)) {
1369 if (destinationChild + row < StoryboardItem::Comments || destinationChild + row >=
rowCount(
parent)) {
1376 item->moveChild(sourceRow, destinationChild + row);
1388 else if (!sourceParent.isValid()) {
1389 for (
int row = 0; row < count; row++) {
1390 if (sourceRow < 0 || sourceRow >=
rowCount()) {
1393 if (destinationChild + row < 0 || destinationChild + row >=
rowCount()) {
1398 m_items.move(sourceRow, destinationChild + row);
1417 QModelIndex parentIndex =
index(position, 0);
1421 for (
int i = 0; i < item->childCount(); i++) {
1422 QVariant
data = item->child(i)->data();
float value(const T *src, size_t ch)
QList< QModelIndex > QModelIndexList
QModelIndex siblingAtRow(const QModelIndex &index, int row)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
bool adaptivePlaybackRange(bool defaultValue=false) const
void forceImageModified()
void setTrackedImage(KisImageSP image)
void switchCurrentTimeAsync(int frameId, SwitchTimeAsyncFlags options=STAO_NONE)
void setDocumentRange(const KisTimeSpan range)
int currentUITime() const
const KisTimeSpan & documentPlaybackRange() const
documentPlaybackRange
KisGroupLayerSP rootLayer() const
KisImageAnimationInterface * animationInterface() const
KisPostExecutionUndoAdapter * postExecutionUndoAdapter() const override
QRect bounds() const override
KisKeyframeChannel stores and manages KisKeyframes. Maps units of time to virtual keyframe values....
QSet< int > allKeyframeTimes() const
Get a set of all integer times that map to a keyframe.
int firstKeyframeTime() const
KisKeyframeSP keyframeAt(int time) const
Get a keyframe at specified time. Used primarily when the value of a given keyframe is needed.
int activeKeyframeTime(int time) const
Get the time of the active keyframe. Useful for snapping any time to that of the most recent keyframe...
int nextKeyframeTime(const int time) const
KisRasterKeyframeChannel * keyframeChannel() const
QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, KoColorConversionTransformation::Intent renderingIntent=KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::ConversionFlags conversionFlags=KoColorConversionTransformation::internalConversionFlags()) const
void addCommand(KUndo2CommandSP command)
static void runSingleCommandStroke(KisImageSP image, KUndo2Command *cmd, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
runSingleCommandStroke creates a stroke and runs cmd in it. The text() field of cmd is used as a titl...
The KisRasterKeyframeChannel is a concrete KisKeyframeChannel subclass that stores and manages KisRas...
virtual void insertKeyframe(int time, KisKeyframeSP keyframe, KUndo2Command *parentUndoCmd=nullptr) override
Insert an existing keyframe into the channel at the specified time.
virtual void removeKeyframe(int time, KUndo2Command *parentUndoCmd=nullptr) override
Remove a keyframe from the channel at the specified time.
This class maintains queues of dirty frames sorted in the order of proximity to the last changed fram...
void scheduleFrameForRegeneration(int frame, bool affected)
Adds the frame to the list of "to be regenerated" frames.
void cancelAllFrameRendering()
Cancels all frame rendering. Empties all queues and cancels the current rendering,...
void slotStartFrameRendering()
void setImage(KisImageSP image)
Sets an image, the class takes an image, clones it and calls frame regeneration on the clone so do no...
static KisTimeSpan infinite(int start)
static KisTimeSpan calculateAffectedFramesRecursive(const KisNode *node, int time)
static KisTimeSpan fromTimeToTime(int start, int end)
This class makes up the StoryboardItem class. It consists of pointer to its parent item and the data ...
StoryboardItemSP parent()
This class stores a list of StoryboardChild objects and provides functionality to manipulate the list...
@ DurationFrame
Store the duration in frame at index 3. Data type stored here should be int.
@ FrameNumber
Store the frame number at index 0. Data type stored here should be ThumbnailData.
@ DurationSecond
Store the duration in second at index 2. Data type stored here should be int.
@ ItemName
Store the item name at index 1. Data type stored here should be string.
@ Comments
Store the comments at indices greater_than_or_equal_to to index 4. Data type stored here should be Co...
void slotFramerateChanged()
void createBlankKeyframes(const QModelIndex &index, KUndo2Command *cmd=nullptr)
void sigStoryboardItemListChanged()
This signal is emitted whenever m_items is changed. it is used to keep the StoryboardItemList in KisD...
void insertChildRows(int position, KUndo2Command *cmd=nullptr)
must be called after a first level index is inserted. Adds child nodes to the first level indices
QStringList mimeTypes() const override
KisStoryboardThumbnailRenderScheduler * m_renderScheduler
KisIdleWatcher m_imageIdleWatcher
void slotKeyframeRemoved(const KisKeyframeChannel *channel, int time)
friend class KisMoveStoryboardCommand
void setView(StoryboardView *view)
void slotFrameRenderCompleted(int frame, KisPaintDeviceSP dev)
called KisStoryboardThumbnailRenderScheduler when frame render is complete
void slotCurrentFrameChanged(int frameId)
called when currentUiTime changes
QMimeData * mimeData(const QModelIndexList &indexes) const override
void setCommentModel(StoryboardCommentModel *commentModel)
Sets the commentModel in StoryboardModel and creates connections to keep the local copy of comments i...
bool setCommentScrollData(const QModelIndex &index, const QVariant &value)
Sets the scrollValue of the CommentBox object.
bool m_reorderingKeyframes
bool isValidBoard(const QModelIndex &index) const
int getFramesPerSecond() const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
bool setThumbnailPixmapData(const QModelIndex &parentIndex, const KisPaintDeviceSP &dev)
Sets the Pixmap data.
bool updateDurationData(const QModelIndex &parentIndex)
updates the duration data of item at parentIndex to the number of frame to the next keyframe in any l...
void slotSetActiveNode(KisNodeSP)
void visualizeScene(const QModelIndex &index, bool useUndo=true)
void slotCommentRowInserted(const QModelIndex, int, int)
@ TotalSceneDurationInFrames
@ TotalSceneDurationInSeconds
StoryboardItemList getData()
int totalCommentCount()
Get total number of comments.
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex()) override
bool m_freezeKeyframePositions
StoryboardComment getComment(int row) const
int columnCount(const QModelIndex &parent=QModelIndex()) const override
StoryboardCommentModel * m_commentModel
int lastKeyframeGlobal() const
QModelIndex indexFromFrame(int frame, bool framePerfect=true) const
Returns the index of the item corresponding the frame, if there is an item with that frame.
void resetData(StoryboardItemList list)
resets m_items to list
QModelIndex parent(const QModelIndex &index) const override
bool insertItem(QModelIndex index, bool after)
inserts item after or before index based on after parameter
void slotUpdateThumbnails()
calls regeneration of the currentUiTime() and all frames in affectedIndexes(KisTimeSpan)
QVector< StoryboardComment > m_commentList
void pushUndoCommand(KUndo2Command *command)
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex()) override
int lastKeyframeWithin(QModelIndex index)
Gets the last keyframe that exists within an index's duration. Used to prevent duration from overwrit...
Qt::DropActions supportedDropActions() const override
void slotUpdateThumbnailsForItems(QModelIndexList indices)
bool removeItem(QModelIndex index, KUndo2Command *command=nullptr)
removes item, deletes keyframes within and shifts keyframe after the scene to fill in the gap
int visibleCommentCount() const
Used in StoryboardDelegate and StoryboardView to get size of one storyboard item.
void slotCommentRowRemoved(const QModelIndex, int, int)
Qt::ItemFlags flags(const QModelIndex &index) const override
void slotCommentDataChanged()
int rowCount(const QModelIndex &parent=QModelIndex()) const override
int visibleCommentsUpto(QModelIndex index) const
Used in StoryboardView to design the layout of storyboard item.
QModelIndexList affectedIndexes(KisTimeSpan range) const
Returns a list of index of items that have frame in between argument range.
void reorderKeyframes()
reorders all keyframes to reflect storyboard docker's arrangement. typically used after drag and drop...
void slotUpdateThumbnailForFrame(int frame, bool delay=true)
calls regeneration of frame in the background i.e. in another thread.
StoryboardModel(QObject *parent)
bool moveRowsImpl(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild, KUndo2Command *parentCMD=nullptr)
KisSignalCompressor m_renderSchedulingCompressor
bool changeSceneHoldLength(int oldDuration, QModelIndex itemIndex)
moves all keyframes in all layers after the frame of the parent of durationIndex Keyframes are moved ...
void createDuplicateKeyframes(const QModelIndex &index, KUndo2Command *cmd=nullptr)
~StoryboardModel() override
StoryboardItemList m_items
void slotNodeRemoved(KisNodeSP node)
QModelIndex lastIndexBeforeFrame(int frame) const
Returns the index of the item with largest frame smaller than argument frame.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
int nextKeyframeGlobal(int keyframeTime) const
the next time at which there is a keyframe in any layer after keyframeTime
Qt::DropActions supportedDragActions() const override
void slotFrameRenderCancelled(int frame)
called KisStoryboardThumbnailRenderScheduler when frame render is cancelled.
bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild) override
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
void slotCommentRowMoved(const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
void setImage(KisImageWSP image)
void shiftKeyframes(KisTimeSpan affected, int offset, KUndo2Command *cmd=nullptr)
void slotKeyframeAdded(const KisKeyframeChannel *channel, int time)
QRect visualRect(const QModelIndex &index) const override
void setCurrentItem(int frame)
changes the currentIndex and selectedIndex to frame
This class is a simple combination of two QVariants. It can be converted to and from QVariant type an...
QVariant frameNum
the frame number corresponding to this item in the timeline docker
QVariant pixmap
a scaled down thumbnail version of the frame
void encodeData(Imf::OutputFile &file, const QList< ExrPaintLayerSaveInfo > &informationObjects, int width, int height)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
QSharedPointer< T > toQShared(T *ptr)
void recursiveApplyNodes(NodePointer node, Functor func)
bool isEditable(bool checkVisibility=true) const
virtual KisPaintDeviceSP paintDevice() const =0
virtual bool supportsKeyframeChannel(const QString &id)
static KoColorSpaceRegistry * instance()