Change the return type of QtGetScrollBarsContainer() under wxQt

Neither QListWidget nor QTextEdit derive from QScrollArea and the cast to it is
just UB. Instead, using the common base class QAbstractScrollArea is safer and
eliminates the need to these dangerous and insidious crosscast'ings.
This commit is contained in:
ali kettab 2023-12-15 17:18:00 +01:00
parent 484785fb88
commit 5fb8a54e14
9 changed files with 20 additions and 21 deletions

View file

@ -13,7 +13,7 @@
#include "wx/frame.h"
class QMainWindow;
class QScrollArea;
class QAbstractScrollArea;
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
{
@ -51,7 +51,7 @@ public:
virtual void RemoveChild( wxWindowBase *child ) override;
QMainWindow *GetQMainWindow() const;
virtual QScrollArea *QtGetScrollBarsContainer() const override;
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const override;
protected:
virtual wxPoint GetClientAreaOrigin() const override;