cutter icon indicating copy to clipboard operation
cutter copied to clipboard

Apply Q_DISABLE_COPY_MOVE macro in some widgets

Open Petross404 opened this issue 3 years ago • 4 comments

Your checklist for this pull request

Detailed description

This PR applies the Q_DISABLE_COPY_MOVE macro in order to delete the copy and move constructors of some widgets.

Test plan (required)

No visual or other changes. Just compile and use Cutter normally.

Petross404 avatar Oct 20 '21 19:10 Petross404

In file included from /home/runner/work/cutter/cutter/src/widgets/ColorThemeComboBox.cpp:1:0:
/home/runner/work/cutter/cutter/src/widgets/ColorThemeComboBox.h:12:43: error: ISO C++ forbids declaration of ‘Q_DISABLE_COPY_MOVE’ with no type [-fpermissive]
     Q_DISABLE_COPY_MOVE(ColorThemeComboBox)
                                           ^
/home/runner/work/cutter/cutter/src/widgets/ColorThemeComboBox.h:12:43: error: expected ‘;’ at end of member declaration
[141/182] Building CXX object src/CMakeFiles/Cutter.dir/common/ColorThemeWorker.cpp.o

XVilka avatar Oct 21 '21 08:10 XVilka

I am out of ideas. Ok, abstract classes can't make use of this macro but what about the rest?

Is it because the destructors aren't default?

 In file included from /home/runner/work/cutter/cutter/build/src/Cutter_autogen/include/ui_ColorThemeEditDialog.h:26:0,
                 from /home/runner/work/cutter/cutter/src/dialogs/preferences/ColorThemeEditDialog.cpp:2:
/home/runner/work/cutter/cutter/src/widgets/ColorThemeListView.h:23:43: error: ISO C++ forbids declaration of ‘Q_DISABLE_COPY_MOVE’ with no type [-fpermissive]
     Q_DISABLE_COPY_MOVE(ColorThemeListView)

Petross404 avatar Oct 21 '21 16:10 Petross404

I guess, but that's not a problem, is it? Simply don't apply the macro there?

xarkes avatar Nov 06 '21 09:11 xarkes

I guess, but that's not a problem, is it? Simply don't apply the macro there?

I will look into this in the following days. Thanks

Petross404 avatar Nov 08 '21 10:11 Petross404