Skip to content

Semi-support Qt6 for wxQt port.#24345

Closed
dsa-t wants to merge 6 commits intowxWidgets:masterfrom
dsa-t:wxqt-qt6
Closed

Semi-support Qt6 for wxQt port.#24345
dsa-t wants to merge 6 commits intowxWidgets:masterfrom
dsa-t:wxqt-qt6

Conversation

@dsa-t
Copy link
Contributor

@dsa-t dsa-t commented Feb 21, 2024

Gets wxQt with Qt6 building with CMake, and samples (widgets, cube, pyramid) running.

Sort of implements #24208.

glib-2.0 is needed to work around removal of QAbstractEventDispatcher::hasPendingEvents() in Qt6.

wxQtEventSignalHandler::HandleDestroyedSignal is removed due to assert when using Qt 6.6.2 linux desktop installed via aqt. When using distro's default 6.2.4+dfsg-2ubuntu1.1, it just hangs.
Scenario: in widgets sample, select last entry in "All controls", then hold Up arrow key.

Assert details

ASSERT failure in QTreeWidget: "Called object is not of the correct type (class destructor may have already run)", file .../qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h, line 129

libc.so.6!__pthread_kill_implementation(int no_tid, int signo, pthread_t threadid) (pthread_kill.c:44)
libc.so.6!__pthread_kill_internal(int signo, pthread_t threadid) (pthread_kill.c:78)
libc.so.6!__GI___pthread_kill(pthread_t threadid, int signo) (pthread_kill.c:89)
libc.so.6!__GI_raise(int sig) (raise.c:26)
libc.so.6!__GI_abort() (abort.c:79)
libQt6Core.so.6!qAbort() (Unknown Source:0)
libQt6Core.so.6![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libQt6Core.so.6!QMessageLogger::fatal(char const*, ...) const (Unknown Source:0)
libQt6Core.so.6!qt_assert_x(char const*, char const*, char const*, int) (Unknown Source:0)
libwx_qtu_core-3.3.so.0!QtPrivate::assertObjectType<wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl> >(QObject * o) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:129)
libwx_qtu_core-3.3.so.0!QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)()>::call(void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)(), wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>*, void**)(void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)(wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl> * const) f, wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl> * o, void ** arg) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:144)
libwx_qtu_core-3.3.so.0!QtPrivate::FunctionPointer<void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)()>::call<QtPrivate::List<>, void>(void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)(), wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>*, void**)(QtPrivate::FunctionPointer<void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)()>::Function f, wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl> * o, void ** arg) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:182)
libwx_qtu_core-3.3.so.0!QtPrivate::QCallableObject<void (wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void ** a, bool * ret) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:520)
libQt6Core.so.6![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libQt6Core.so.6!QObject::destroyed(QObject*) (Unknown Source:0)
libQt6Widgets.so.6!QWidget::~QWidget() (Unknown Source:0)
libwx_qtu_core-3.3.so.0!wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl>::~wxQtEventSignalHandler(wxQtEventSignalHandler<QTreeWidget, wxTreeCtrl> * const this) (/home/alex/wx-debug/wxWidgets-qt/include/wx/qt/private/winevent.h:76)
libwx_qtu_core-3.3.so.0!wxQTreeWidget::~wxQTreeWidget(wxQTreeWidget * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/treectrl.cpp:128)
libwx_qtu_core-3.3.so.0!wxQTreeWidget::~wxQTreeWidget(wxQTreeWidget * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/treectrl.cpp:128)
libwx_qtu_core-3.3.so.0!wxWindow::~wxWindow(wxWindow * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/window.cpp:379)
libwx_qtu_core-3.3.so.0!wxControlBase::~wxControlBase(wxControlBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/ctrlcmn.cpp:47)
wxControl::~wxControl(wxControl * const this) (/home/alex/wx-debug/wxWidgets-qt/include/wx/qt/control.h:11)
libwx_qtu_core-3.3.so.0!wxSystemThemedControl<wxControl>::~wxSystemThemedControl(wxSystemThemedControl<wxControl> * const this) (/home/alex/wx-debug/wxWidgets-qt/include/wx/systhemectrl.h:64)
libwx_qtu_core-3.3.so.0!wxTreeCtrlBase::~wxTreeCtrlBase(wxTreeCtrlBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/treebase.cpp:176)
libwx_qtu_core-3.3.so.0!wxTreeCtrl::~wxTreeCtrl(wxTreeCtrl * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/treectrl.cpp:598)
libwx_qtu_core-3.3.so.0!wxTreeCtrl::~wxTreeCtrl(wxTreeCtrl * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/treectrl.cpp:598)
libwx_qtu_core-3.3.so.0!wxWindowBase::Destroy(wxWindowBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/wincmn.cpp:570)
libwx_qtu_core-3.3.so.0!wxWindowBase::DestroyChildren(wxWindowBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/wincmn.cpp:602)
libwx_qtu_core-3.3.so.0!wxWindow::~wxWindow(wxWindow * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/window.cpp:370)
libwx_qtu_core-3.3.so.0!wxControlBase::~wxControlBase(wxControlBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/ctrlcmn.cpp:47)
wxControl::~wxControl(wxControl * const this) (/home/alex/wx-debug/wxWidgets-qt/include/wx/qt/control.h:11)
libwx_qtu_core-3.3.so.0!wxGenericDirCtrl::~wxGenericDirCtrl(wxGenericDirCtrl * const this) (/home/alex/wx-debug/wxWidgets-qt/src/generic/dirctrlg.cpp:420)
libwx_qtu_core-3.3.so.0!wxGenericDirCtrl::~wxGenericDirCtrl(wxGenericDirCtrl * const this) (/home/alex/wx-debug/wxWidgets-qt/src/generic/dirctrlg.cpp:420)
DirCtrlWidgetsPage::CreateDirCtrl(DirCtrlWidgetsPage * const this, bool defaultPath) (/home/alex/wx-debug/wxWidgets-qt/samples/widgets/dirctrl.cpp:302)
DirCtrlWidgetsPage::Reset(DirCtrlWidgetsPage * const this) (/home/alex/wx-debug/wxWidgets-qt/samples/widgets/dirctrl.cpp:255)
DirCtrlWidgetsPage::CreateContent(DirCtrlWidgetsPage * const this) (/home/alex/wx-debug/wxWidgets-qt/samples/widgets/dirctrl.cpp:236)
WidgetsFrame::OnPageChanged(WidgetsFrame * const this, wxBookCtrlEvent & event) (/home/alex/wx-debug/wxWidgets-qt/samples/widgets/widgets.cpp:801)
libwx_baseu-3.3.so.0!wxAppConsoleBase::HandleEvent(const wxAppConsoleBase * const this, wxEvtHandler * handler, wxEventFunction func, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:642)
libwx_baseu-3.3.so.0!wxAppConsoleBase::CallEventHandler(const wxAppConsoleBase * const this, wxEvtHandler * handler, wxEventFunctor & functor, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:654)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEventIfMatchesId(const wxEventTableEntryBase & entry, wxEvtHandler * handler, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1444)
libwx_baseu-3.3.so.0!wxEvtHandler::SearchDynamicEventTable(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1904)
libwx_baseu-3.3.so.0!wxEvtHandler::TryHereOnly(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1627)
libwx_baseu-3.3.so.0!wxEvtHandler::TryBeforeAndHere(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/include/wx/event.h:3990)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEventLocally(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1564)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1537)
libwx_qtu_core-3.3.so.0!wxWindowBase::TryAfter(wxWindowBase * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/wincmn.cpp:3519)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1550)
libwx_qtu_core-3.3.so.0!wxWindowBase::TryAfter(wxWindowBase * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/wincmn.cpp:3519)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1550)
libwx_qtu_core-3.3.so.0!wxBookCtrlBase::DoSetSelection(wxBookCtrlBase * const this, size_t n, int flags) (/home/alex/wx-debug/wxWidgets-qt/src/common/bookctrl.cpp:538)
libwx_qtu_core-3.3.so.0!wxTreebook::SetSelection(wxTreebook * const this, size_t n) (/home/alex/wx-debug/wxWidgets-qt/include/wx/treebook.h:130)
libwx_qtu_core-3.3.so.0!wxTreebook::OnTreeSelectionChange(wxTreebook * const this, wxTreeEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/generic/treebkg.cpp:603)
libwx_baseu-3.3.so.0!wxAppConsoleBase::HandleEvent(const wxAppConsoleBase * const this, wxEvtHandler * handler, wxEventFunction func, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:642)
libwx_baseu-3.3.so.0!wxAppConsoleBase::CallEventHandler(const wxAppConsoleBase * const this, wxEvtHandler * handler, wxEventFunctor & functor, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:654)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEventIfMatchesId(const wxEventTableEntryBase & entry, wxEvtHandler * handler, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1444)
libwx_baseu-3.3.so.0!wxEventHashTable::HandleEvent(wxEventHashTable * const this, wxEvent & event, wxEvtHandler * self) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1049)
libwx_baseu-3.3.so.0!wxEvtHandler::TryHereOnly(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1631)
libwx_baseu-3.3.so.0!wxEvtHandler::TryBeforeAndHere(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/include/wx/event.h:3990)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEventLocally(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1564)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1537)
libwx_qtu_core-3.3.so.0!wxWindowBase::TryAfter(wxWindowBase * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/wincmn.cpp:3519)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1550)
libwx_baseu-3.3.so.0!wxEvtHandler::SafelyProcessEvent(wxEvtHandler * const this, wxEvent & event) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1653)
libwx_baseu-3.3.so.0!wxEvtHandler::ProcessPendingEvents(wxEvtHandler * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/event.cpp:1411)
libwx_baseu-3.3.so.0!wxAppConsoleBase::ProcessPendingEvents(wxAppConsoleBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:551)
libwx_qtu_core-3.3.so.0!wxQtIdleTimer::idle(wxQtIdleTimer * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/evtloop.cpp:74)
libwx_qtu_core-3.3.so.0!QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (wxQtIdleTimer::*)()>::call(void (wxQtIdleTimer::*)(), wxQtIdleTimer*, void**)(void (wxQtIdleTimer::*)(wxQtIdleTimer * const) f, wxQtIdleTimer * o, void ** arg) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:145)
libwx_qtu_core-3.3.so.0!QtPrivate::FunctionPointer<void (wxQtIdleTimer::*)()>::call<QtPrivate::List<>, void>(void (wxQtIdleTimer::*)(), wxQtIdleTimer*, void**)(QtPrivate::FunctionPointer<void (wxQtIdleTimer::*)()>::Function f, wxQtIdleTimer * o, void ** arg) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:182)
libwx_qtu_core-3.3.so.0!QtPrivate::QCallableObject<void (wxQtIdleTimer::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void ** a, bool * ret) (/home/alex/qt/6.6.2/gcc_64/include/QtCore/qobjectdefs_impl.h:520)
libQt6Core.so.6![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libQt6Core.so.6!QTimer::timeout(QTimer::QPrivateSignal) (Unknown Source:0)
libQt6Core.so.6!QObject::event(QEvent*) (Unknown Source:0)
libQt6Widgets.so.6!QApplicationPrivate::notify_helper(QObject*, QEvent*) (Unknown Source:0)
libQt6Core.so.6!QCoreApplication::notifyInternal2(QObject*, QEvent*) (Unknown Source:0)
libQt6Core.so.6!QTimerInfoList::activateTimers() (Unknown Source:0)
libQt6Core.so.6![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libglib-2.0.so.0!g_main_context_dispatch (Unknown Source:0)
libglib-2.0.so.0![Unknown/Just-In-Time compiled code] (Unknown Source:0)
libglib-2.0.so.0!g_main_context_iteration (Unknown Source:0)
libQt6Core.so.6!QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (Unknown Source:0)
libQt6Core.so.6!QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (Unknown Source:0)
libwx_qtu_core-3.3.so.0!wxQtEventLoopBase::DoRun(wxQtEventLoopBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/qt/evtloop.cpp:122)
libwx_baseu-3.3.so.0!wxEventLoopBase::Run(wxEventLoopBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/evtloopcmn.cpp:87)
libwx_baseu-3.3.so.0!wxAppConsoleBase::MainLoop(wxAppConsoleBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:362)
libwx_baseu-3.3.so.0!wxAppConsoleBase::OnRun(wxAppConsoleBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/appbase.cpp:280)
libwx_qtu_core-3.3.so.0!wxAppBase::OnRun(wxAppBase * const this) (/home/alex/wx-debug/wxWidgets-qt/src/common/appcmn.cpp:349)
libwx_baseu-3.3.so.0!wxEntry(int & argc, wxChar ** argv) (/home/alex/wx-debug/wxWidgets-qt/src/common/init.cpp:570)
libwx_baseu-3.3.so.0!wxEntry(int & argc, char ** argv) (/home/alex/wx-debug/wxWidgets-qt/src/common/init.cpp:581)
main(int argc, char ** argv) (/home/alex/wx-debug/wxWidgets-qt/samples/widgets/widgets.cpp:327)

Copy link
Contributor

@MaartenBent MaartenBent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition.
AppVeyor is still set to Qt 5.11 so requiring 5.15 causes problems there.

vadz pushed a commit that referenced this pull request Jun 15, 2024
QGLWidget is deprecated (and removed in Qt 6) and doesn't work under
KDE6 with Wayland.

See #24345.

Closes #24208.

Closes #24577.
@vadz
Copy link
Contributor

vadz commented May 10, 2025

@AliKet Is there anything still worth keeping here or should this one be closed?

@AliKet
Copy link
Contributor

AliKet commented May 10, 2025

Can safely be closed as everything here is in master now, thanks.

@vadz vadz closed this May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants