diff --git a/toonz/sources/image/ffmpeg/tiio_gif.h b/toonz/sources/image/ffmpeg/tiio_gif.h index fd9bff9..2380b76 100644 --- a/toonz/sources/image/ffmpeg/tiio_gif.h +++ b/toonz/sources/image/ffmpeg/tiio_gif.h @@ -21,12 +21,12 @@ public: TLevelWriterGif(const TFilePath &path, TPropertyGroup *winfo); ~TLevelWriterGif(); // FfmpegBridge* ffmpeg; - void setFrameRate(double fps); + void setFrameRate(double fps) override; TImageWriterP getFrameWriter(TFrameId fid) override; void save(const TImageP &image, int frameIndex); - void saveSoundTrack(TSoundTrack *st); + void saveSoundTrack(TSoundTrack *st) override; static TLevelWriter *create(const TFilePath &path, TPropertyGroup *winfo) { return new TLevelWriterGif(path, winfo); @@ -92,6 +92,6 @@ public: // Tiio::Reader *makeGifReader(); // Tiio::Writer *makeGifWriter(); -} // namespace +} // namespace Tiio #endif diff --git a/toonz/sources/image/ffmpeg/tiio_mp4.h b/toonz/sources/image/ffmpeg/tiio_mp4.h index 8748037..d7caae1 100644 --- a/toonz/sources/image/ffmpeg/tiio_mp4.h +++ b/toonz/sources/image/ffmpeg/tiio_mp4.h @@ -19,12 +19,12 @@ class TLevelWriterMp4 : public TLevelWriter { public: TLevelWriterMp4(const TFilePath &path, TPropertyGroup *winfo); ~TLevelWriterMp4(); - void setFrameRate(double fps); + void setFrameRate(double fps) override; TImageWriterP getFrameWriter(TFrameId fid) override; void save(const TImageP &image, int frameIndex); - void saveSoundTrack(TSoundTrack *st); + void saveSoundTrack(TSoundTrack *st) override; static TLevelWriter *create(const TFilePath &path, TPropertyGroup *winfo) { return new TLevelWriterMp4(path, winfo); @@ -88,6 +88,6 @@ public: // Tiio::Reader *makeMp4Reader(); // Tiio::Writer *makeMp4Writer(); -} // namespace +} // namespace Tiio #endif diff --git a/toonz/sources/image/ffmpeg/tiio_webm.h b/toonz/sources/image/ffmpeg/tiio_webm.h index 01ff39d..cfee346 100644 --- a/toonz/sources/image/ffmpeg/tiio_webm.h +++ b/toonz/sources/image/ffmpeg/tiio_webm.h @@ -18,12 +18,12 @@ class TLevelWriterWebm : public TLevelWriter { public: TLevelWriterWebm(const TFilePath &path, TPropertyGroup *winfo); ~TLevelWriterWebm(); - void setFrameRate(double fps); + void setFrameRate(double fps) override; TImageWriterP getFrameWriter(TFrameId fid) override; void save(const TImageP &image, int frameIndex); - void saveSoundTrack(TSoundTrack *st); + void saveSoundTrack(TSoundTrack *st) override; static TLevelWriter *create(const TFilePath &path, TPropertyGroup *winfo) { return new TLevelWriterWebm(path, winfo); @@ -87,6 +87,6 @@ public: // Tiio::Reader *makeWebmReader(); // Tiio::Writer *makeWebmWriter(); -} // namespace +} // namespace Tiio #endif diff --git a/toonz/sources/image/sprite/tiio_sprite.h b/toonz/sources/image/sprite/tiio_sprite.h index 781141e..ae4d3b1 100644 --- a/toonz/sources/image/sprite/tiio_sprite.h +++ b/toonz/sources/image/sprite/tiio_sprite.h @@ -21,12 +21,12 @@ class TLevelWriterSprite : public TLevelWriter { public: TLevelWriterSprite(const TFilePath &path, TPropertyGroup *winfo); ~TLevelWriterSprite(); - void setFrameRate(double fps); + void setFrameRate(double fps) override; TImageWriterP getFrameWriter(TFrameId fid) override; void save(const TImageP &image, int frameIndex); - void saveSoundTrack(TSoundTrack *st); + void saveSoundTrack(TSoundTrack *st) override; static TLevelWriter *create(const TFilePath &path, TPropertyGroup *winfo) { return new TLevelWriterSprite(path, winfo); @@ -65,6 +65,6 @@ public: //=========================================================================== -} // namespace +} // namespace Tiio #endif diff --git a/toonz/sources/include/tools/pinchtool.h b/toonz/sources/include/tools/pinchtool.h index ff3e657..0b71270 100644 --- a/toonz/sources/include/tools/pinchtool.h +++ b/toonz/sources/include/tools/pinchtool.h @@ -63,41 +63,41 @@ public: PinchTool(); virtual ~PinchTool(); - ToolType getToolType() const { return TTool::LevelWriteTool; } + ToolType getToolType() const override { return TTool::LevelWriteTool; } void setShowSelector(bool show) { m_showSelector = show; } - void onEnter(); - void onLeave(); + void onEnter() override; + void onLeave() override; - void updateTranslation(); + void updateTranslation() override; - void draw(); + void draw() override; - void leftButtonDown(const TPointD &pos, const TMouseEvent &); + void leftButtonDown(const TPointD &pos, const TMouseEvent &) override; - void leftButtonDrag(const TPointD &pos, const TMouseEvent &e); + void leftButtonDrag(const TPointD &pos, const TMouseEvent &e) override; - void leftButtonUp(const TPointD &pos, const TMouseEvent &e); + void leftButtonUp(const TPointD &pos, const TMouseEvent &e) override; void invalidateCursorArea(); - void mouseMove(const TPointD &pos, const TMouseEvent &e); + void mouseMove(const TPointD &pos, const TMouseEvent &e) override; bool moveCursor(const TPointD &pos); bool keyDown(QKeyEvent *) override; - void onActivate(); - void onDeactivate(); + void onActivate() override; + void onDeactivate() override; // viene usato?? void update(const TGlobalChange &); - void onImageChanged(); + void onImageChanged() override; - int getCursorId() const { return updateCursor(); } - TPropertyGroup *getProperties(int targetType) { return &m_prop; } + int getCursorId() const override { return updateCursor(); } + TPropertyGroup *getProperties(int targetType) override { return &m_prop; } }; #endif // PINCHTOOL_H diff --git a/toonz/sources/include/tools/tooloptions.h b/toonz/sources/include/tools/tooloptions.h index d47a829..aad1d58 100644 --- a/toonz/sources/include/tools/tooloptions.h +++ b/toonz/sources/include/tools/tooloptions.h @@ -696,7 +696,7 @@ class ShiftTraceToolOptionBox final : public ToolOptionsBox { void resetGhost(int index); protected: - void showEvent(QShowEvent *); + void showEvent(QShowEvent *) override; void hideEvent(QShowEvent *); public: diff --git a/toonz/sources/include/toonz/preferencesitemids.h b/toonz/sources/include/toonz/preferencesitemids.h index 67ef65b..07dffcd 100644 --- a/toonz/sources/include/toonz/preferencesitemids.h +++ b/toonz/sources/include/toonz/preferencesitemids.h @@ -5,16 +5,9 @@ enum PreferencesItemId { // General defaultViewerEnabled, rasterOptimizedMemory, - autosaveEnabled, - autosavePeriod, - autosaveSceneEnabled, - autosaveOtherFilesEnabled, startupPopupEnabled, undoMemorySize, taskchunksize, - replaceAfterSaveLevelAs, - backupEnabled, - backupKeepCount, sceneNumberingEnabled, watchFileSystemEnabled, projectRoot, @@ -66,6 +59,13 @@ enum PreferencesItemId { //---------- // Saving + autosaveEnabled, + autosavePeriod, + autosaveSceneEnabled, + autosaveOtherFilesEnabled, + replaceAfterSaveLevelAs, + backupEnabled, + backupKeepCount, rasterBackgroundColor, resetUndoOnSavingLevel, diff --git a/toonz/sources/include/toonzqt/schematicviewer.h b/toonz/sources/include/toonzqt/schematicviewer.h index 7d86d72..3e5c552 100644 --- a/toonz/sources/include/toonzqt/schematicviewer.h +++ b/toonz/sources/include/toonzqt/schematicviewer.h @@ -152,9 +152,9 @@ protected: void showEvent(QShowEvent *se) override; void enterEvent(QEvent *e) override; void leaveEvent(QEvent *e) override; - void mouseDoubleClickEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event) override; - void tabletEvent(QTabletEvent *e); + void tabletEvent(QTabletEvent *e) override; void touchEvent(QTouchEvent *e, int type); void gestureEvent(QGestureEvent *e); diff --git a/toonz/sources/stdfx/ino_line_blur.cpp b/toonz/sources/stdfx/ino_line_blur.cpp index f005ae4..9da636a 100644 --- a/toonz/sources/stdfx/ino_line_blur.cpp +++ b/toonz/sources/stdfx/ino_line_blur.cpp @@ -6536,7 +6536,8 @@ public: bBox = bBox.enlarge(static_cast(margin)); } } - bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info) { + bool doGetBBox(double frame, TRectD &bBox, + const TRenderSettings &info) override { if (false == this->m_input.isConnected()) { bBox = TRectD(); return false; @@ -6546,23 +6547,24 @@ public: return ret; } int getMemoryRequirement(const TRectD &rect, double frame, - const TRenderSettings &info) { + const TRenderSettings &info) override { TRectD bBox(rect); this->get_render_enlarge(frame, info.m_affine, bBox); return TRasterFx::memorySize(bBox, info.m_bpp); } void transform(double frame, int port, const TRectD &rectOnOutput, const TRenderSettings &infoOnOutput, TRectD &rectOnInput, - TRenderSettings &infoOnInput) { + TRenderSettings &infoOnInput) override { rectOnInput = rectOnOutput; infoOnInput = infoOnOutput; this->get_render_enlarge(frame, infoOnOutput.m_affine, rectOnInput); } - bool canHandle(const TRenderSettings &info, double frame) { + bool canHandle(const TRenderSettings &info, double frame) override { // return true;/* geometry処理済の画像に加工することになる */ return false; /* ここでの処理後にgeometryがかかる */ } - void doCompute(TTile &tile, double frame, const TRenderSettings &rend_sets); + void doCompute(TTile &tile, double frame, + const TRenderSettings &rend_sets) override; }; FX_PLUGIN_IDENTIFIER(ino_line_blur, "inoLineBlurFx"); diff --git a/toonz/sources/stdfx/iwa_bokehfx.h b/toonz/sources/stdfx/iwa_bokehfx.h index c0cdf96..8fc309a 100644 --- a/toonz/sources/stdfx/iwa_bokehfx.h +++ b/toonz/sources/stdfx/iwa_bokehfx.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once /*------------------------------------ Iwa_BokehFx @@ -139,11 +139,13 @@ protected: public: Iwa_BokehFx(); - void doCompute(TTile &tile, double frame, const TRenderSettings &settings); + void doCompute(TTile &tile, double frame, + const TRenderSettings &settings) override; - bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info); + bool doGetBBox(double frame, TRectD &bBox, + const TRenderSettings &info) override; - bool canHandle(const TRenderSettings &info, double frame); + bool canHandle(const TRenderSettings &info, double frame) override; }; -#endif \ No newline at end of file +#endif diff --git a/toonz/sources/stdfx/iwa_bokehreffx.h b/toonz/sources/stdfx/iwa_bokehreffx.h index 4cc453e..0aa8893 100644 --- a/toonz/sources/stdfx/iwa_bokehreffx.h +++ b/toonz/sources/stdfx/iwa_bokehreffx.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once /*------------------------------------ Iwa_BokehRefFx @@ -176,11 +176,13 @@ protected: public: Iwa_BokehRefFx(); - void doCompute(TTile& tile, double frame, const TRenderSettings& settings); + void doCompute(TTile& tile, double frame, + const TRenderSettings& settings) override; - bool doGetBBox(double frame, TRectD& bBox, const TRenderSettings& info); + bool doGetBBox(double frame, TRectD& bBox, + const TRenderSettings& info) override; - bool canHandle(const TRenderSettings& info, double frame); + bool canHandle(const TRenderSettings& info, double frame) override; void doCompute_CPU(const double frame, const TRenderSettings& settings, float bokehPixelAmount, float maxIrisSize, int margin, diff --git a/toonz/sources/stdfx/iwa_glarefx.h b/toonz/sources/stdfx/iwa_glarefx.h index 2ac6419..51b9ddb 100644 --- a/toonz/sources/stdfx/iwa_glarefx.h +++ b/toonz/sources/stdfx/iwa_glarefx.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once /*------------------------------------ Iwa_GlareFx @@ -89,13 +89,15 @@ protected: public: Iwa_GlareFx(); - void doCompute(TTile &tile, double frame, const TRenderSettings &settings); + void doCompute(TTile &tile, double frame, + const TRenderSettings &settings) override; - bool doGetBBox(double frame, TRectD &bBox, const TRenderSettings &info); + bool doGetBBox(double frame, TRectD &bBox, + const TRenderSettings &info) override; - bool canHandle(const TRenderSettings &info, double frame); + bool canHandle(const TRenderSettings &info, double frame) override; void getParamUIs(TParamUIConcept *&concepts, int &length) override; }; -#endif \ No newline at end of file +#endif diff --git a/toonz/sources/tnztools/rasterselectiontool.h b/toonz/sources/tnztools/rasterselectiontool.h index e0f6035..e6f85b0 100644 --- a/toonz/sources/tnztools/rasterselectiontool.h +++ b/toonz/sources/tnztools/rasterselectiontool.h @@ -242,7 +242,7 @@ public: bool onPropertyChanged(std::string propertyName) override; bool getNoAntialiasingValue() { return m_noAntialiasing.getValue(); } - bool isSelectionEditable() { return m_rasterSelection.isEditable(); } + bool isSelectionEditable() override { return m_rasterSelection.isEditable(); } protected: void updateTranslation() override; diff --git a/toonz/sources/tnztools/rgbpickertool.cpp b/toonz/sources/tnztools/rgbpickertool.cpp index 6a6e484..261ef4e 100644 --- a/toonz/sources/tnztools/rgbpickertool.cpp +++ b/toonz/sources/tnztools/rgbpickertool.cpp @@ -91,6 +91,13 @@ public: } else { controller->setColorSample(color); } + TTool::Application *app = TTool::getApplication(); + TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel(); + if (level) { + std::vector fids; + level->getFids(fids); + invalidateIcons(level, fids); + } } void undo() const override { setColor(m_oldValue); } @@ -236,17 +243,19 @@ void RGBPickerTool::updateTranslation() { // another glContext void RGBPickerTool::onImageChanged() { + TTool::Application *app = TTool::getApplication(); + TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel(); if (m_currentStyleId != 0 && m_makePick && (m_pickType.getValue() == POLYLINE_PICK || m_pickType.getValue() == RECT_PICK)) { - TTool::Application *app = TTool::getApplication(); - TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette(); - int styleId = ph->getStyleIndex(); - TPalette *palette = ph->getPalette(); - TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel(); + TPaletteHandle *ph = app->getPaletteController()->getCurrentPalette(); + int styleId = ph->getStyleIndex(); + TPalette *palette = ph->getPalette(); if (palette) TUndoManager::manager()->add( new UndoPickRGBM(palette, styleId, m_currentValue, level)); + } + if (m_makePick) { setCurrentColor(m_currentValue); if (level) { std::vector fids; @@ -372,7 +381,7 @@ void RGBPickerTool::leftButtonUp(const TPointD &pos, const TMouseEvent &) { } if (m_pickType.getValue() == FREEHAND_PICK) { closeFreehand(); - if (m_currentStyleId != 0) m_makePick = true; + m_makePick = true; } invalidate(); } @@ -460,18 +469,6 @@ void RGBPickerTool::pick() { TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel(); UndoPickRGBM *cmd = new UndoPickRGBM(palette, styleId, m_currentValue, level); TUndoManager::manager()->add(cmd); - cmd->redo(); - - m_makePick = false; - /* -setCurrentColor(m_currentValue); -if(level) -{ -vector fids; -level->getFids(fids); -invalidateIcons(level,fids); -} -*/ } //--------------------------------------------------------- @@ -527,12 +524,6 @@ void RGBPickerTool::pickStroke() { TXshSimpleLevel *level = app->getCurrentLevel()->getSimpleLevel(); TUndoManager::manager()->add( new UndoPickRGBM(palette, styleId, m_currentValue, level)); - setCurrentColor(m_currentValue); - if (level) { - std::vector fids; - level->getFids(fids); - invalidateIcons(level, fids); - } } } @@ -668,7 +659,7 @@ void RGBPickerTool::closePolyline(const TPointD &drawingPos, //--------------------------------------------------------- /*! Flipbook上でPassive Pickを有効にする -*/ + */ void RGBPickerTool::showFlipPickedColor(const TPixel32 &pix) { if (m_passivePick.getValue()) { QColor col((int)pix.r, (int)pix.g, (int)pix.b); diff --git a/toonz/sources/tnztools/skeletontool.h b/toonz/sources/tnztools/skeletontool.h index f863a2c..9e8f754 100644 --- a/toonz/sources/tnztools/skeletontool.h +++ b/toonz/sources/tnztools/skeletontool.h @@ -35,7 +35,7 @@ public: : m_h0(h0), m_h1(h1), m_dist2(dist2) {} bool operator<(const MagicLink &link) const { return m_dist2 < link.m_dist2; } }; -} +} // namespace SkeletonSubtools class SkeletonTool : public TTool { Q_DECLARE_TR_FUNCTIONS(SkeletonTool) @@ -79,25 +79,25 @@ public: SkeletonTool(); ~SkeletonTool(); - ToolType getToolType() const { return TTool::ColumnTool; } + ToolType getToolType() const override { return TTool::ColumnTool; } - void updateTranslation(); // QString localization stuff + void updateTranslation() override; // QString localization stuff bool doesApply() const; // ritorna vero se posso deformare l'oggetto corrente - void onEnter() {} - void leftButtonDown(const TPointD &pos, const TMouseEvent &); - void leftButtonDrag(const TPointD &pos, const TMouseEvent &); - void leftButtonUp(const TPointD &pos, const TMouseEvent &); - void mouseMove(const TPointD &, const TMouseEvent &e); + void onEnter() override {} + void leftButtonDown(const TPointD &pos, const TMouseEvent &) override; + void leftButtonDrag(const TPointD &pos, const TMouseEvent &) override; + void leftButtonUp(const TPointD &pos, const TMouseEvent &) override; + void mouseMove(const TPointD &, const TMouseEvent &e) override; - void onImageChanged() { invalidate(); } + void onImageChanged() override { invalidate(); } - void reset() { m_temporaryPinnedColumns.clear(); } + void reset() override { m_temporaryPinnedColumns.clear(); } - bool onPropertyChanged(std::string propertyName); + bool onPropertyChanged(std::string propertyName) override; - void draw(); + void draw() override; void drawSkeleton(const Skeleton &skeleton, int row); void drawLevelBoundingBox(int frame, int columnIndex); @@ -122,21 +122,21 @@ public: bool keyDown(QKeyEvent *event) override; - void onActivate(); - void onDeactivate(); + void onActivate() override; + void onDeactivate() override; int getMagicLinkCount() const { return (int)m_magicLinks.size(); } SkeletonSubtools::MagicLink getMagicLink(int index) const; void magicLink(int index); - int getCursorId() const; + int getCursorId() const override; // TRaster32P getToolIcon() const {return Pixmaps::arrow;} - TPropertyGroup *getProperties(int targetType) { return &m_prop; } + TPropertyGroup *getProperties(int targetType) override { return &m_prop; } - void updateMatrix() { setMatrix(getCurrentObjectParentMatrix()); } - void addContextMenuItems(QMenu *menu); + void updateMatrix() override { setMatrix(getCurrentObjectParentMatrix()); } + void addContextMenuItems(QMenu *menu) override; bool select(const TSelection *) { return false; } void togglePinnedStatus(int columnIndex, int frame, bool shiftPressed); diff --git a/toonz/sources/tnztools/stylepickertool.h b/toonz/sources/tnztools/stylepickertool.h index 65a46c7..a838631 100644 --- a/toonz/sources/tnztools/stylepickertool.h +++ b/toonz/sources/tnztools/stylepickertool.h @@ -42,7 +42,7 @@ public: int getCursorId() const override; - bool onPropertyChanged(std::string propertyName); + bool onPropertyChanged(std::string propertyName) override; bool isOrganizePaletteActive() { return m_organizePalette.getValue(); } @@ -57,4 +57,4 @@ public: void updateTranslation() override; }; -#endif \ No newline at end of file +#endif diff --git a/toonz/sources/tnztools/vectorselectiontool.h b/toonz/sources/tnztools/vectorselectiontool.h index 94f79e5..ba90050 100644 --- a/toonz/sources/tnztools/vectorselectiontool.h +++ b/toonz/sources/tnztools/vectorselectiontool.h @@ -312,7 +312,7 @@ public: void setResetCenter(bool update) { m_resetCenter = update; } bool canResetCenter() { return m_resetCenter; } - bool isSelectionEditable() { return m_strokeSelection.isEditable(); } + bool isSelectionEditable() override { return m_strokeSelection.isEditable(); } protected: void onActivate() override; diff --git a/toonz/sources/tnztools/viewtools.h b/toonz/sources/tnztools/viewtools.h index 786ee67..61b4560 100644 --- a/toonz/sources/tnztools/viewtools.h +++ b/toonz/sources/tnztools/viewtools.h @@ -37,7 +37,7 @@ public: int getCursorId() const override; - void updateTranslation() { + void updateTranslation() override { m_cameraCentered.setQStringName(tr("Rotate On Camera Center")); } }; diff --git a/toonz/sources/toonz/convertpopup.cpp b/toonz/sources/toonz/convertpopup.cpp index f0e9dad..659843e 100644 --- a/toonz/sources/toonz/convertpopup.cpp +++ b/toonz/sources/toonz/convertpopup.cpp @@ -511,6 +511,8 @@ ConvertPopup::ConvertPopup(bool specifyInput) ret = ret && connect(m_convertFileFld, SIGNAL(pathChanged()), this, SLOT(onFileInChanged())); + // resize the dialog + onFormatSelected(m_fileFormat->currentText()); // update unable/enable of checkboxes onTlvModeSelected(m_tlvMode->currentText()); @@ -762,6 +764,11 @@ void ConvertPopup::onFormatSelected(const QString &format) { m_saveBackupToNopaint->setEnabled(m_tlvMode->currentText() == TlvMode_Unpainted); } + // For unknown reasons, calling adjustSize twice is needed to + // prevent the dialog from remaining large size when the current + // format is switched from tlv to another format. + adjustSize(); + adjustSize(); } //------------------------------------------------------------------ diff --git a/toonz/sources/toonz/filebrowserpopup.h b/toonz/sources/toonz/filebrowserpopup.h index c1ac1c9..0e2289a 100644 --- a/toonz/sources/toonz/filebrowserpopup.h +++ b/toonz/sources/toonz/filebrowserpopup.h @@ -218,7 +218,7 @@ protected: void showEvent(QShowEvent *) override; protected slots: - void onFilePathDoubleClicked(const TFilePath &path); + void onFilePathDoubleClicked(const TFilePath &path) override; }; //----------------------------------------------------------------------------- @@ -313,7 +313,7 @@ protected slots: // the selection void onSelectionChanged(TSelection *selection); - void onFilePathDoubleClicked(const TFilePath &path); + void onFilePathDoubleClicked(const TFilePath &path) override; void onPreferenceChanged(const QString &); diff --git a/toonz/sources/toonz/imageviewer.h b/toonz/sources/toonz/imageviewer.h index 895a963..bec3163 100644 --- a/toonz/sources/toonz/imageviewer.h +++ b/toonz/sources/toonz/imageviewer.h @@ -146,10 +146,10 @@ protected: void dragCompare(const QPoint &dp); - void tabletEvent(QTabletEvent *e); + void tabletEvent(QTabletEvent *e) override; void touchEvent(QTouchEvent *e, int type); void gestureEvent(QGestureEvent *e); - bool event(QEvent *e); + bool event(QEvent *e) override; public slots: diff --git a/toonz/sources/toonz/layerheaderpanel.h b/toonz/sources/toonz/layerheaderpanel.h index 70adb6f..1f6b49e 100644 --- a/toonz/sources/toonz/layerheaderpanel.h +++ b/toonz/sources/toonz/layerheaderpanel.h @@ -46,8 +46,8 @@ protected: void mousePressEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; - void enterEvent(QEvent *); - void leaveEvent(QEvent *); + void enterEvent(QEvent *) override; + void leaveEvent(QEvent *) override; bool event(QEvent *event) override; private: diff --git a/toonz/sources/toonz/levelsettingspopup.cpp b/toonz/sources/toonz/levelsettingspopup.cpp index f50fb5f..4540711 100644 --- a/toonz/sources/toonz/levelsettingspopup.cpp +++ b/toonz/sources/toonz/levelsettingspopup.cpp @@ -612,6 +612,7 @@ void LevelSettingsPopup::onPreferenceChanged(const QString &propertyName) { int decimals = (pixelsMode) ? 0 : 4; m_widthFld->setDecimals(decimals); m_heightFld->setDecimals(decimals); + adjustSize(); } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/penciltestpopup.h b/toonz/sources/toonz/penciltestpopup.h index 389870e..48b65b9 100644 --- a/toonz/sources/toonz/penciltestpopup.h +++ b/toonz/sources/toonz/penciltestpopup.h @@ -279,9 +279,9 @@ public: ~PencilTestPopup(); protected: - void showEvent(QShowEvent* event); - void hideEvent(QHideEvent* event); - void keyPressEvent(QKeyEvent* event); + void showEvent(QShowEvent* event) override; + void hideEvent(QHideEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; bool event(QEvent* e) override; @@ -320,4 +320,4 @@ public slots: void openSaveInFolderPopup(); }; -#endif \ No newline at end of file +#endif diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp index 1163909..11a9147 100644 --- a/toonz/sources/toonz/preferencespopup.cpp +++ b/toonz/sources/toonz/preferencespopup.cpp @@ -51,6 +51,7 @@ #include #include #include +#include using namespace DVGui; @@ -998,6 +999,13 @@ void PreferencesPopup::insertFootNote(QGridLayout* layout) { //----------------------------------------------------------------------------- QString PreferencesPopup::getUIString(PreferencesItemId id) { + auto CtrlAltStr = []() { + QString str = + QKeySequence(Qt::CTRL + Qt::ALT).toString(QKeySequence::NativeText); + if (str.endsWith("+")) str.chop(1); + return str; + }; + const static QMap uiStringTable = { // General {defaultViewerEnabled, tr("Use Default Viewer for Movie Formats")}, @@ -1040,7 +1048,7 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) { tr("Show Raster Images Darken Blended")}, {showFrameNumberWithLetters, tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell")}, - {iconSize, tr("Level Strip Icon Size*:")}, + {iconSize, tr("Level Strip Thumbnail Size*:")}, {viewShrink, tr("Viewer Shrink:")}, {viewStep, tr("Step:")}, {viewerZoomCenter, tr("Viewer Zoom Center:")}, @@ -1112,7 +1120,7 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) { {cursorBrushStyle, tr("Cursor Style:")}, {cursorOutlineEnabled, tr("Show Cursor Size Outlines")}, {levelBasedToolsDisplay, tr("Toolbar Display Behaviour:")}, - {useCtrlAltToResizeBrush, tr("Use Ctrl+Alt to Resize Brush")}, + {useCtrlAltToResizeBrush, tr("Use %1 to Resize Brush").arg(CtrlAltStr())}, // Xsheet {xsheetLayoutPreference, tr("Column Header Layout*:")}, @@ -1372,18 +1380,9 @@ QWidget* PreferencesPopup::createGeneralPage() { insertUI(defaultViewerEnabled, lay); insertUI(rasterOptimizedMemory, lay); - QGridLayout* autoSaveLay = insertGroupBoxUI(autosaveEnabled, lay); - { - insertUI(autosavePeriod, autoSaveLay); - insertUI(autosaveSceneEnabled, autoSaveLay); - insertUI(autosaveOtherFilesEnabled, autoSaveLay); - } insertUI(startupPopupEnabled, lay); insertUI(undoMemorySize, lay); insertUI(taskchunksize, lay); - insertUI(replaceAfterSaveLevelAs, lay); - QGridLayout* backupLay = insertGroupBoxUI(backupEnabled, lay); - { insertUI(backupKeepCount, backupLay); } insertUI(sceneNumberingEnabled, lay); insertUI(watchFileSystemEnabled, lay); @@ -1621,13 +1620,21 @@ QWidget* PreferencesPopup::createSavingPage() { QWidget* widget = new QWidget(this); QGridLayout* lay = new QGridLayout(); setupLayout(lay); - + QGridLayout* autoSaveLay = insertGroupBoxUI(autosaveEnabled, lay); + { + insertUI(autosavePeriod, autoSaveLay); + insertUI(autosaveSceneEnabled, autoSaveLay); + insertUI(autosaveOtherFilesEnabled, autoSaveLay); + } + insertUI(replaceAfterSaveLevelAs, lay); + QGridLayout* backupLay = insertGroupBoxUI(backupEnabled, lay); + { insertUI(backupKeepCount, backupLay); } QLabel* matteColorLabel = new QLabel(tr("Matte color is used for background when overwriting " "raster levels with transparent pixels\nin non " "alpha-enabled image format."), this); - lay->addWidget(matteColorLabel, 0, 0, 1, 3, Qt::AlignLeft); + lay->addWidget(matteColorLabel, lay->rowCount(), 0, 1, 3, Qt::AlignLeft); insertUI(rasterBackgroundColor, lay); insertUI(resetUndoOnSavingLevel, lay); diff --git a/toonz/sources/toonz/sceneviewer.h b/toonz/sources/toonz/sceneviewer.h index d200041..6b6311b 100644 --- a/toonz/sources/toonz/sceneviewer.h +++ b/toonz/sources/toonz/sceneviewer.h @@ -259,8 +259,8 @@ public: bool canSwapCompared() const; bool isEditPreviewSubcamera() const { return m_editPreviewSubCamera; } - bool getIsFlippedX() const { return m_isFlippedX; } - bool getIsFlippedY() const { return m_isFlippedY; } + bool getIsFlippedX() const override { return m_isFlippedX; } + bool getIsFlippedY() const override { return m_isFlippedY; } void setEditPreviewSubcamera(bool enabled) { m_editPreviewSubCamera = enabled; } @@ -281,10 +281,10 @@ public: void setIsLocator() { m_isLocator = true; } void setIsStyleShortcutSwitchable() { m_isStyleShortcutSwitchable = true; } - int getVGuideCount(); - int getHGuideCount(); - double getVGuide(int index); - double getHGuide(int index); + int getVGuideCount() override; + int getHGuideCount() override; + double getVGuide(int index) override; + double getHGuide(int index) override; void bindFBO() override; void releaseFBO() override; diff --git a/toonz/sources/toonz/subscenecommand.cpp b/toonz/sources/toonz/subscenecommand.cpp index 9876bd7..df6e55b 100644 --- a/toonz/sources/toonz/subscenecommand.cpp +++ b/toonz/sources/toonz/subscenecommand.cpp @@ -488,10 +488,6 @@ TFx *explodeFxSubTree(TFx *innerFx, QMap> &fxs, } else { TFxSet *innerTerminals = innerDag->getTerminalFxs(); int i, terminalCount = innerTerminals->getFxCount(); - if (!terminalCount) { - fxs[innerFx] = QPair(nullptr, -1); - return nullptr; - } QMultiMap sortedFx; for (i = 0; i < terminalCount; i++) { TFx *terminalFx = innerTerminals->getFx(i); @@ -508,6 +504,13 @@ TFx *explodeFxSubTree(TFx *innerFx, QMap> &fxs, return nullptr; } + // in case no nodes connected to the xsheet the xsheet node will not be + // merged, but will just be removed + if (terminalCount == 0) { + fxs[innerFx] = QPair(nullptr, -1); + return innerFx; // just to return non-zero value + } + TFx *root = sortedFx.begin().value(); // If only one node is connected to the Xsheet node, then skip bringing it @@ -836,7 +839,7 @@ void explodeFxs(TXsheet *xsh, TXsheet *subXsh, const GroupData &fxGroupData, innerDag, fxGroupData, outPorts); // in case the child and parent Xsheet nodes will be "merged" - if (!root && innerDag->getTerminalFxs()->getFxCount()) { + if (!root) { TFxSet *internals = innerDag->getTerminalFxs(); for (int j = 0; j < internals->getFxCount(); j++) { TFx *fx = internals->getFx(j); @@ -914,6 +917,7 @@ void explodeFxs(TXsheet *xsh, TXsheet *subXsh, const GroupData &fxGroupData, TFx *outerFx = pair.first; // skip redundant item. in case when only one node is input to the xsheet // node in the inner dag + if (!outerFx) continue; if (outerFx->getAttributes()->getGroupId() == groupId) continue; outerFx->getAttributes()->setGroupId(groupId); outerFx->getAttributes()->setGroupName(L"Group " + @@ -972,6 +976,7 @@ std::set explode(TXsheet *xsh, TXsheet *subXsh, int index, QMap fxMap; for (auto it = fxs.constBegin(); it != fxs.constEnd(); ++it) { + if (it.value().first == nullptr) continue; setGrammerToParams(it.value().first->getParams(), grammer); fxMap.insert(it.key(), it.value().first); } diff --git a/toonz/sources/toonzlib/imagebuilders.h b/toonz/sources/toonzlib/imagebuilders.h index 6a437a0..5284666 100644 --- a/toonz/sources/toonzlib/imagebuilders.h +++ b/toonz/sources/toonzlib/imagebuilders.h @@ -60,8 +60,8 @@ public: bool cacheImagesAsWell) override; /* Exposed to allow Fid to be updated due to a renumber operation - */ - void setFid(const TFrameId &fid); + */ + void setFid(const TFrameId &fid) override; protected: bool getInfo(TImageInfo &info, int imFlags, void *extData) override; diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cpp index 143314c..65d711c 100644 --- a/toonz/sources/toonzlib/preferences.cpp +++ b/toonz/sources/toonzlib/preferences.cpp @@ -337,19 +337,9 @@ void Preferences::definePreferenceItems() { define(defaultViewerEnabled, "defaultViewerEnabled", QMetaType::Bool, false); define(rasterOptimizedMemory, "rasterOptimizedMemory", QMetaType::Bool, false); - define(autosaveEnabled, "autosaveEnabled", QMetaType::Bool, false); - define(autosavePeriod, "autosavePeriod", QMetaType::Int, 15, 1, 60); - define(autosaveSceneEnabled, "autosaveSceneEnabled", QMetaType::Bool, true); - define(autosaveOtherFilesEnabled, "autosaveOtherFilesEnabled", - QMetaType::Bool, true); define(startupPopupEnabled, "startupPopupEnabled", QMetaType::Bool, true); define(undoMemorySize, "undoMemorySize", QMetaType::Int, 100, 0, 2000); define(taskchunksize, "taskchunksize", QMetaType::Int, 10, 1, 2000); - define(replaceAfterSaveLevelAs, "replaceAfterSaveLevelAs", QMetaType::Bool, - true); - define(backupEnabled, "backupEnabled", QMetaType::Bool, true); - define(backupKeepCount, "backupKeepCount", QMetaType::Int, 1, 1, - std::numeric_limits::max()); define(sceneNumberingEnabled, "sceneNumberingEnabled", QMetaType::Bool, false); define(watchFileSystemEnabled, "watchFileSystemEnabled", QMetaType::Bool, @@ -359,8 +349,6 @@ void Preferences::definePreferenceItems() { define(pathAliasPriority, "pathAliasPriority", QMetaType::Int, (int)ProjectFolderOnly); - setCallBack(autosaveEnabled, &Preferences::enableAutosave); - setCallBack(autosavePeriod, &Preferences::setAutosavePeriod); setCallBack(undoMemorySize, &Preferences::setUndoMemorySize); // Interface @@ -431,12 +419,24 @@ void Preferences::definePreferenceItems() { //"levelFormats" need to be handle separately // Saving + define(autosaveEnabled, "autosaveEnabled", QMetaType::Bool, false); + define(autosavePeriod, "autosavePeriod", QMetaType::Int, 15, 1, 60); + define(autosaveSceneEnabled, "autosaveSceneEnabled", QMetaType::Bool, true); + define(autosaveOtherFilesEnabled, "autosaveOtherFilesEnabled", + QMetaType::Bool, true); + define(replaceAfterSaveLevelAs, "replaceAfterSaveLevelAs", QMetaType::Bool, + true); + define(backupEnabled, "backupEnabled", QMetaType::Bool, true); + define(backupKeepCount, "backupKeepCount", QMetaType::Int, 1, 1, + std::numeric_limits::max()); define(rasterBackgroundColor, "rasterBackgroundColor", QMetaType::QColor, QColor(Qt::white)); define(resetUndoOnSavingLevel, "resetUndoOnSavingLevel", QMetaType::Bool, true); setCallBack(rasterBackgroundColor, &Preferences::setRasterBackgroundColor); + setCallBack(autosaveEnabled, &Preferences::enableAutosave); + setCallBack(autosavePeriod, &Preferences::setAutosavePeriod); // Import / Export define(ffmpegPath, "ffmpegPath", QMetaType::QString, ""); diff --git a/toonz/sources/toonzlib/tpalettehandle.cpp b/toonz/sources/toonzlib/tpalettehandle.cpp index 0013507..1fbaa56 100644 --- a/toonz/sources/toonzlib/tpalettehandle.cpp +++ b/toonz/sources/toonzlib/tpalettehandle.cpp @@ -32,7 +32,7 @@ public: void redo() const override { toggleAutopaint(); } - void onAdd() { redo(); } + void onAdd() override { redo(); } int getSize() const override { return sizeof(*this); } @@ -212,4 +212,4 @@ void TPaletteHandle::toggleAutopaint() { if (index > 0) { TUndoManager::manager()->add(new AutopaintToggleUndo(this, index)); } -} \ No newline at end of file +} diff --git a/toonz/sources/toonzqt/colorfield.cpp b/toonz/sources/toonzqt/colorfield.cpp index c37e04e..236366b 100644 --- a/toonz/sources/toonzqt/colorfield.cpp +++ b/toonz/sources/toonzqt/colorfield.cpp @@ -197,7 +197,7 @@ ChannelField::ChannelField(QWidget *parent, const QString &string, int value, QLabel *channelName = new QLabel(string, this); m_channelEdit = new DVGui::IntLineEdit(this, value, 0, maxValue); m_channelSlider = new QSlider(Qt::Horizontal, this); - + m_channelSlider->setFocusPolicy(Qt::NoFocus); channelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter); channelName->setFixedWidth(labelWidth); diff --git a/toonz/sources/toonzqt/functionsegmentviewer.cpp b/toonz/sources/toonzqt/functionsegmentviewer.cpp index ca1d3dc..c4cc812 100644 --- a/toonz/sources/toonzqt/functionsegmentviewer.cpp +++ b/toonz/sources/toonzqt/functionsegmentviewer.cpp @@ -117,9 +117,9 @@ SpeedInOutSegmentPage::SpeedInOutSegmentPage(FunctionSegmentViewer *parent) bool ret = connect(m_speed0xFld, SIGNAL(editingFinished()), this, SLOT(onFirstHandleXChanged())); - ret = ret && connect(m_speed0yFld, SIGNAL(editingFinished()), this, + ret = ret && connect(m_speed0yFld, SIGNAL(editingFinished()), this, SLOT(onFirstHandleYChanged())); - ret = ret && connect(m_firstSpeedFld, SIGNAL(editingFinished()), this, + ret = ret && connect(m_firstSpeedFld, SIGNAL(editingFinished()), this, SLOT(onFirstSpeedChanged())); ret = ret && connect(m_speed1xFld, SIGNAL(editingFinished()), this, @@ -557,11 +557,11 @@ void FunctionExpressionSegmentPage::init(int segmentLength) { /*--- すでにあるカーブをExpressionに切り替えた場合 ---*/ if (kIndex >= 0) { - TDoubleKeyframe keyFrame = curve->getKeyframe(kIndex); - double value = curve->getValue(keyFrame.m_frame); - const TUnit *unit = 0; + TDoubleKeyframe keyFrame = curve->getKeyframe(kIndex); + double value = curve->getValue(keyFrame.m_frame); + const TUnit *unit = 0; if (curve->getMeasure()) unit = curve->getMeasure()->getCurrentUnit(); - if (unit) value = unit->convertTo(value); + if (unit) value = unit->convertTo(value); m_expressionFld->setExpression(QString::number(value).toStdString()); /*--- unitがある場合だけUnitを表示 ---*/ if (unit) @@ -704,20 +704,20 @@ FileSegmentPage::FileSegmentPage(FunctionSegmentViewer *parent) void FileSegmentPage::refresh() { TDoubleKeyframe kf; TDoubleParam *curve = getCurve(); - if (curve) kf = curve->getKeyframeAt(getR0()); + if (curve) kf = curve->getKeyframeAt(getR0()); if (curve && kf.m_isKeyframe) { TFilePath path; int fieldIndex = 0; std::string unitName = ""; if (kf.m_type == TDoubleKeyframe::File) { - path = kf.m_fileParams.m_path; - fieldIndex = kf.m_fileParams.m_fieldIndex; + path = kf.m_fileParams.m_path; + fieldIndex = kf.m_fileParams.m_fieldIndex; if (fieldIndex < 0) fieldIndex = 0; - unitName = kf.m_unitName; + unitName = kf.m_unitName; if (unitName == "") { TMeasure *measure = curve->getMeasure(); if (measure) { - const TUnit *unit = measure->getCurrentUnit(); + const TUnit *unit = measure->getCurrentUnit(); if (unit) unitName = ::to_string(unit->getDefaultExtension()); } } @@ -735,7 +735,7 @@ void FileSegmentPage::init(int segmentLength) { TMeasure *measure = curve->getMeasure(); std::string unitName = ""; if (measure) { - const TUnit *unit = measure->getCurrentUnit(); + const TUnit *unit = measure->getCurrentUnit(); if (unit) unitName = ::to_string(unit->getDefaultExtension()); } m_measureFld->setText(QString::fromStdString(unitName)); @@ -1042,17 +1042,17 @@ FunctionSegmentViewer::FunctionSegmentViewer(QWidget *parent, bool ret = true; ret = ret && connect(m_typeCombo, SIGNAL(currentIndexChanged(int)), m_parametersPanel, SLOT(setCurrentIndex(int))); - ret = ret && connect(m_typeCombo, SIGNAL(activated(int)), this, + ret = ret && connect(m_typeCombo, SIGNAL(activated(int)), this, SLOT(onSegmentTypeChanged(int))); - ret = ret && connect(applyButton, SIGNAL(clicked()), this, + ret = ret && connect(applyButton, SIGNAL(clicked()), this, SLOT(onApplyButtonPressed())); - ret = ret && connect(m_prevCurveButton, SIGNAL(clicked()), this, + ret = ret && connect(m_prevCurveButton, SIGNAL(clicked()), this, SLOT(onPrevCurveButtonPressed())); - ret = ret && connect(m_nextCurveButton, SIGNAL(clicked()), this, + ret = ret && connect(m_nextCurveButton, SIGNAL(clicked()), this, SLOT(onNextCurveButtonPressed())); - ret = ret && connect(m_prevLinkButton, SIGNAL(clicked()), this, + ret = ret && connect(m_prevLinkButton, SIGNAL(clicked()), this, SLOT(onPrevLinkButtonPressed())); - ret = ret && connect(m_nextLinkButton, SIGNAL(clicked()), this, + ret = ret && connect(m_nextLinkButton, SIGNAL(clicked()), this, SLOT(onNextLinkButtonPressed())); assert(ret); @@ -1104,7 +1104,7 @@ void FunctionSegmentViewer::setSegmentByFrame(TDoubleParam *curve, int frame) { if (k1 >= 1) segmentIndex = k1 - 1; else { - int k0 = m_curve->getPrevKeyframe(frame); + int k0 = m_curve->getPrevKeyframe(frame); if (k0 >= 0) segmentIndex = k0; } } else { @@ -1276,9 +1276,9 @@ void FunctionSegmentViewer::onCurveChanged() { void FunctionSegmentViewer::onStepFieldChanged(const QString &text) { if (!segmentIsValid()) return; - int step = 1; + int step = 1; if (text != "") step = text.toInt(); - if (step < 1) step = 1; + if (step < 1) step = 1; KeyframeSetter setter(m_curve, m_segmentIndex); setter.setStep(step); } @@ -1383,8 +1383,8 @@ void FunctionSegmentViewer::onApplyButtonPressed() { /*--- from - * toに合わせてキーフレームを作成しようと試みる。すでに有る場合はスキップ * ---*/ - if (fromFrame < 0) fromFrame = 0; - if (toFrame < 0) toFrame = 0; + if (fromFrame < 0) fromFrame = 0; + if (toFrame < 0) toFrame = 0; if (fromFrame >= toFrame) fromFrame = toFrame + 1; if (!m_curve->isKeyframe(fromFrame)) @@ -1469,7 +1469,7 @@ void FunctionSegmentViewer::onPrevCurveButtonPressed() { int r0 = (int)prevKey.m_frame; int r1 = (int)currentKey.m_frame; - + m_panel->update(); m_sheet->getSelection()->selectSegment(m_curve, currentKeyIndex - 1, QRect(col, r0, 1, r1 - r0 + 1)); m_sheet->updateAll(); @@ -1502,7 +1502,7 @@ void FunctionSegmentViewer::onNextCurveButtonPressed() { int r0 = (int)nextKey.m_frame; int r1 = (int)nextNextKey.m_frame; - + m_panel->update(); m_sheet->getSelection()->selectSegment(m_curve, currentKeyIndex + 1, QRect(col, r0, 1, r1 - r0 + 1)); m_sheet->updateAll(); diff --git a/toonz/sources/toonzqt/styleselection.cpp b/toonz/sources/toonzqt/styleselection.cpp index 8a5d799..41b2a14 100644 --- a/toonz/sources/toonzqt/styleselection.cpp +++ b/toonz/sources/toonzqt/styleselection.cpp @@ -716,8 +716,9 @@ void TStyleSelection::eraseUnusedStyle() { for (j = 0; j < page->getStyleCount(); j++) { int styleId = page->getStyleId(j); if (m != 0 && usedStyleIds[styleId]) continue; - if (i == 0 && j == 0) // Il primo stile della prima pagina non deve - // essere mai cancellato + if (i == 0 && + (j == 0 || j == 1)) // Il primo stile della prima pagina non deve + // essere mai cancellato { usedStyleIds[styleId] = true; continue;