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

@ -10,7 +10,7 @@
class QListWidget;
class QModelIndex;
class QScrollArea;
class QAbstractScrollArea;
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
{
@ -87,7 +87,7 @@ protected:
virtual int DoListHitTest(const wxPoint& point) const override;
virtual QScrollArea *QtGetScrollBarsContainer() const override;
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const override;
#if wxUSE_CHECKLISTBOX
bool m_hasCheckBoxes;