Fix -Wweak-vtables warnings

This commit is contained in:
Sergio Martins
2020-10-14 14:25:24 +01:00
parent 07db9f9a7a
commit 819725351a
10 changed files with 37 additions and 5 deletions

View File

@@ -113,6 +113,9 @@ macro(set_compiler_flags targetName)
target_compile_definitions(${targetName} PRIVATE DOCKS_DEVELOPER_MODE QT_FORCE_ASSERTS)
if(NOT MSVC)
target_compile_options(${targetName} PRIVATE -Wall -Wextra -Werror -Wno-error=deprecated-declarations)
if (APPLE)
target_compile_options(${targetName} PRIVATE -Wweak-vtables)
endif()
endif()
endif()
endmacro()

View File

@@ -32,6 +32,8 @@ public:
init();
}
~MyTitleBar() override;
void init()
{
setFixedHeight(60);
@@ -56,6 +58,8 @@ public:
}
};
MyTitleBar::~MyTitleBar() = default;
// Inheriting from SeparatorWidget instead of Separator as it handles moving and mouse cursor changing
class MySeparator : public Layouting::SeparatorWidget
{
@@ -65,6 +69,8 @@ public:
{
}
~MySeparator() override;
void paintEvent(QPaintEvent *) override
{
QPainter p(this);
@@ -72,6 +78,8 @@ public:
}
};
MySeparator::~MySeparator() = default;
KDDockWidgets::TitleBar * CustomWidgetFactory::createTitleBar(KDDockWidgets::Frame *frame) const
{
return new MyTitleBar(frame);

View File

@@ -40,6 +40,8 @@ public:
m_inCtor = false;
}
~Private() override;
void setIsFocused(bool);
void onFocusObjectChanged(QObject *);
bool isInFocusScope(WidgetType *) const;
@@ -51,6 +53,9 @@ public:
QPointer<WidgetType> m_lastFocusedInScope;
};
FocusScope::Private::~Private()
{
}
FocusScope::FocusScope(QWidgetAdapter *thisWidget)
: d(new Private(this, thisWidget))

View File

@@ -30,7 +30,7 @@ class FocusScope
public:
///@brief constructor
explicit FocusScope(QWidgetAdapter *thisWidget);
~FocusScope();
virtual ~FocusScope();
///@brief Returns true if this FocusScope is focused.
///This is similar to the QWidget::hasFocus(), except that it counts with the children being focused too.

View File

@@ -79,6 +79,8 @@ public:
, LayoutGuestWidgetBase(this)
{
}
~LayoutGuestWidget() override;
};
}

View File

@@ -207,9 +207,7 @@ class MyHostWidget : public QWidget
s_testObject->m_hostWidgets << this;
}
~MyHostWidget() {
s_testObject->m_hostWidgets.removeOne(this);
}
~MyHostWidget() override;
void paintEvent(QPaintEvent *) override
{
@@ -218,6 +216,10 @@ class MyHostWidget : public QWidget
}
};
MyHostWidget::~MyHostWidget() {
s_testObject->m_hostWidgets.removeOne(this);
}
static bool serializeDeserializeTest(const std::unique_ptr<ItemContainer> &root)
{
// Serializes and deserializes a layout

View File

@@ -106,3 +106,5 @@ QWidget *KDDockWidgets::Private::widgetForWindow(QWindow *window)
return window->property("kddockwidgets_qwidget").value<QWidget*>();
}
LayoutGuestWidget::~LayoutGuestWidget() = default;

View File

@@ -29,7 +29,8 @@ class EventFilter : public QObject
{
public:
EventFilter(QEvent::Type type) : m_type(type) {}
bool eventFilter(QObject *, QEvent *e)
~EventFilter() override;
bool eventFilter(QObject *, QEvent *e) override
{
if (e->type() == m_type)
m_got = true;
@@ -41,6 +42,8 @@ public:
bool m_got = false;
};
EventFilter::~EventFilter() = default;
static bool isGammaray()
{
static bool is = qtHookData[3] != 0;
@@ -142,3 +145,5 @@ void Testing::setWarningObserver(WarningObserver *observer)
{
s_warningObserver = observer;
}
WarningObserver::~WarningObserver() = default;

View File

@@ -39,6 +39,7 @@ namespace Testing {
class WarningObserver
{
public:
virtual ~WarningObserver();
virtual void onFatal() = 0;
};

View File

@@ -206,9 +206,13 @@ public:
{
}
~EmbeddedWindow() override;
MainWindow *const mainWindow;
};
EmbeddedWindow::~EmbeddedWindow() = default;
struct ExpectedAvailableSize // struct for testing MultiSplitterLayout::availableLengthForDrop()
{
KDDockWidgets::Location location;