mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +00:00
Small enhancements in the SdbWidget class. (#2796)
* Small enhancements in SdbWidget class. Destructors of child classes should be marked with the `override` keyword. Also since Qt's widgets aren't movable or copyable, we can explicitly let the compiler know with the `Q_DISABLE_COPY_MOVE` macro. * Define Q_DISABLE_COPY_MOVE macro for versions < 5.13.0 in SdbWidget
This commit is contained in:
parent
12df7a001d
commit
311cd0307e
@ -80,7 +80,7 @@ void SdbWidget::on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int colum
|
||||
}
|
||||
}
|
||||
|
||||
SdbWidget::~SdbWidget() {}
|
||||
SdbWidget::~SdbWidget() = default;
|
||||
|
||||
void SdbWidget::on_lockButton_clicked()
|
||||
{
|
||||
|
@ -16,9 +16,25 @@ class SdbWidget : public CutterDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
|
||||
# define Q_DISABLE_COPY(SdbWidget) \
|
||||
SdbWidget(const SdbWidget &s) = delete; \
|
||||
SdbWidget &operator=(const SdbWidget &s) = delete;
|
||||
|
||||
# define Q_DISABLE_MOVE(SdbWidget) \
|
||||
SdbWidget(SdbWidget &&s) = delete; \
|
||||
SdbWidget &operator=(SdbWidget &&s) = delete;
|
||||
|
||||
# define Q_DISABLE_COPY_MOVE(SdbWidget) \
|
||||
Q_DISABLE_COPY(SdbWidget) \
|
||||
Q_DISABLE_MOVE(SdbWidget)
|
||||
#endif
|
||||
|
||||
Q_DISABLE_COPY_MOVE(SdbWidget)
|
||||
|
||||
public:
|
||||
explicit SdbWidget(MainWindow *main);
|
||||
~SdbWidget();
|
||||
~SdbWidget() override;
|
||||
|
||||
private slots:
|
||||
void on_treeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column);
|
||||
|
Loading…
Reference in New Issue
Block a user