Proper way to display a RootCanvas from within a Qt GUI app?

Greetings ROOT community,

I am developing a small desktop app that relies on Qt for the GUI, and uses ROOT for generating scatter plots representing geological data. I use ROOT TApplication instance for visualizing a processed dataset that is read from a CSV file. Overall, the project is successful, but TApplication can only be called once, so my program needs to be closed after each run.
I’ve been trying to display the output of my program using TRootCanvas, but without connecting it to TApplication. Unfortunately, I encounter a segmentation fault each time TRootCanvas::Show() is called, and a call to TRootCanvas::PrintCanvas() results in a compile-time error (“undefined reference to TRootCanvas::PrintCanvas()”). There are no errors when a TApplication instance is run and everything works correctly.

This is what works for me (TPlot is a self-defined class in my code; it includes a ROOT TCanvas cnv as a public member):

[…]
TApplication app(“app”, nullptr, nullptr);
std::unique_ptr plot(new TPlot());
plot->plot();
TRootCanvas *rc = (TRootCanvas *)plot->cnv->GetCanvasImp();
rc->Connect(“CloseWindow()”, “TApplication”, gApplication, “Terminate()”);
app.Run(kTRUE);
[…]

Now this is what doesn’t work:

[…]
std::unique_ptr plot(new TPlot());
plot->plot();
TRootCanvas *rc = (TRootCanvas *)plot->cnv->GetCanvasImp();
rc->Show(); // leads to segmentation fault and rc->PrintCanvas() leads to “undefined reference” error.
[…]

Am I missing the proper member function to display TRootCanvas, or should I replace it with some newer ROOT class (I’ve seen mentions about some upcoming classes elsewhere on this message board)?

Any advice will be greatly appreciated - kind regards to all
Jakub


Please read tips for efficient and successful posting and posting code

ROOT Version: 6.28
Platform: Ubuntu 22.04
Compiler: GCC 11


Dear @jakub-witkowski ,

Thanks for reaching out to the forum!

For the undefined reference error, did you make sure to append ${root-config --cflags --glibs} to your compiler invocation?

About the segfault, could you be able to provide us with the stack trace output?

For general counseling about the implementation of your app, I will ask the help of @linev and @couet .

Cheers,
Vincenzo

Hi Vincenzo, and thanks for answering.

Yes, the Qmake for my project includes:
QMAKE_LIBDIR_FLAGS += root-config --cflags --libs
and an INCLUDEPATH to the ROOT installation.
The stack trace is a monster, but here it, below.

Thanks for your time!
Jakub


 *** Break *** segmentation violation
===========================================================
There was a crash (#6 0x00007f0097c8cfc2 in SigHandler(ESignals) () from /snap/root-framework/931/usr/local/lib/libCore.so).
This is the entire stack trace of all threads:
===========================================================
Thread 12 (Thread 0x7f0060fff640 (LWP 140670) "Thread (pooled)"):
#0  __futex_abstimed_wait_common64 (private=0, cancel=true, abstime=0x7f0060ff96f0, op=137, expected=0, futex_word=0x55ac1202ccc0) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=0, abstime=0x7f0060ff96f0, clockid=64, expected=0, futex_word=0x55ac1202ccc0) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word
entry=0x55ac1202ccc0, expected=expected
entry=0, clockid=clockid
entry=1, abstime=abstime
entry=0x7f0060ff96f0, private=private
entry=0) at ./nptl/futex-internal.c:139
#3  0x00007f0095693e9b in __pthread_cond_wait_common (abstime=0x7f0060ff96f0, clockid=1, mutex=0x55ac1202cc70, cond=0x55ac1202cc98) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_timedwait64 (cond=0x55ac1202cc98, mutex=0x55ac1202cc70, abstime=0x7f0060ff96f0) at ./nptl/pthread_cond_wait.c:652
#5  0x00007f00960fac99 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#6  0x00007f00960f7b97 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#7  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#8  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#9  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 11 (Thread 0x7f006cdfe640 (LWP 140669) "Thread (pooled)"):
#0  __futex_abstimed_wait_common64 (private=1476395152, cancel=true, abstime=0x7f006cdf86f0, op=137, expected=0, futex_word=0x55ac122f5fe4) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=1476395152, abstime=0x7f006cdf86f0, clockid=64, expected=0, futex_word=0x55ac122f5fe4) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word
entry=0x55ac122f5fe4, expected=expected
entry=0, clockid=clockid
entry=1, abstime=abstime
entry=0x7f006cdf86f0, private=private
entry=0) at ./nptl/futex-internal.c:139
#3  0x00007f0095693e9b in __pthread_cond_wait_common (abstime=0x7f006cdf86f0, clockid=1, mutex=0x55ac122f5f90, cond=0x55ac122f5fb8) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_timedwait64 (cond=0x55ac122f5fb8, mutex=0x55ac122f5f90, abstime=0x7f006cdf86f0) at ./nptl/pthread_cond_wait.c:652
#5  0x00007f00960fac99 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#6  0x00007f00960f7b97 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#7  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#8  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#9  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 10 (Thread 0x7f008e396640 (LWP 140668) "Thread (pooled)"):
#0  __futex_abstimed_wait_common64 (private=-2080374640, cancel=true, abstime=0x7f008e3906f0, op=137, expected=0, futex_word=0x55ac11a7c960) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=-2080374640, abstime=0x7f008e3906f0, clockid=-2080374736, expected=0, futex_word=0x55ac11a7c960) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word
entry=0x55ac11a7c960, expected=expected
entry=0, clockid=clockid
entry=1, abstime=abstime
entry=0x7f008e3906f0, private=private
entry=0) at ./nptl/futex-internal.c:139
#3  0x00007f0095693e9b in __pthread_cond_wait_common (abstime=0x7f008e3906f0, clockid=1, mutex=0x55ac11a7c910, cond=0x55ac11a7c938) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_timedwait64 (cond=0x55ac11a7c938, mutex=0x55ac11a7c910, abstime=0x7f008e3906f0) at ./nptl/pthread_cond_wait.c:652
#5  0x00007f00960fac99 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#6  0x00007f00960f7b97 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#7  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#8  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#9  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 9 (Thread 0x7f006d5ff640 (LWP 140667) "Thread (pooled)"):
#0  __futex_abstimed_wait_common64 (private=-8454144, cancel=true, abstime=0x7f006d5f96f0, op=137, expected=0, futex_word=0x55ac12531234) at ./nptl/futex-internal.c:57
#1  __futex_abstimed_wait_common (cancel=true, private=-8454144, abstime=0x7f006d5f96f0, clockid=0, expected=0, futex_word=0x55ac12531234) at ./nptl/futex-internal.c:87
#2  __GI___futex_abstimed_wait_cancelable64 (futex_word=futex_word
entry=0x55ac12531234, expected=expected
entry=0, clockid=clockid
entry=1, abstime=abstime
entry=0x7f006d5f96f0, private=private
entry=0) at ./nptl/futex-internal.c:139
#3  0x00007f0095693e9b in __pthread_cond_wait_common (abstime=0x7f006d5f96f0, clockid=1, mutex=0x55ac125311e0, cond=0x55ac12531208) at ./nptl/pthread_cond_wait.c:503
#4  ___pthread_cond_timedwait64 (cond=0x55ac12531208, mutex=0x55ac125311e0, abstime=0x7f006d5f96f0) at ./nptl/pthread_cond_wait.c:652
#5  0x00007f00960fac99 in QWaitCondition::wait(QMutex*, QDeadlineTimer) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#6  0x00007f00960f7b97 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#7  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#8  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#9  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 8 (Thread 0x7f00748ce640 (LWP 140658) "pool-LSR-Plot-G"):
#0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007f009416b04c in g_cond_wait_until () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f00940eb3e1 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f00940eb566 in g_async_queue_timeout_pop () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f009414d759 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f009414aa51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#7  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 7 (Thread 0x7f00777fe640 (LWP 140653) "WaylandEventThr"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x7f00777f8780, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f0090789e51 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6WaylandClient.so.6
#2  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#3  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 6 (Thread 0x7f0077fff640 (LWP 140652) "WaylandEventThr"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x7f0077ff9780, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f0090789e51 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6WaylandClient.so.6
#2  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#3  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#4  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 5 (Thread 0x7f008d36c640 (LWP 140646) "dconf worker"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x55ac11a86710, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f00941711f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f00941193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f009103833d in ?? () from /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4  0x00007f009414aa51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 4 (Thread 0x7f008db6d640 (LWP 140645) "gdbus"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x55ac120e4ab0, nfds=6, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f00941711f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f009411b2b3 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f008f2d107a in ?? () from /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4  0x00007f009414aa51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 3 (Thread 0x7f008eb97640 (LWP 140643) "gmain"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x55ac11a6e2a0, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f00941711f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f00941193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f0094119431 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4  0x00007f009414aa51 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 2 (Thread 0x7f009070b640 (LWP 140642) "QDBusConnection"):
#0  0x00007f0095718bcf in __GI___poll (fds=0x55ac11a30e60, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#1  0x00007f00941711f6 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f00941193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f0096204f4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#4  0x00007f0095f68fc3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#5  0x00007f009605d20c in QThread::exec() () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#6  0x00007f0091b58f5a in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6DBus.so.6
#7  0x00007f00960f29dd in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#8  0x00007f0095694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#9  0x00007f0095726850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
Thread 1 (Thread 0x7f0094bdbd40 (LWP 140641) "LSR-Plot-GUI"):
#0  0x00007f00956ea42f in __GI___wait4 (pid=140693, stat_loc=stat_loc
entry=0x7fff2bb88368, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x00007f00956ea3ab in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7fff2bb88368, options=options
entry=0) at ./posix/waitpid.c:38
#2  0x00007f0095650bdb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3  0x00007f0097c91588 in TUnixSystem::Exec(char const*) () from /snap/root-framework/931/usr/local/lib/libCore.so
#4  0x00007f0097c91eaa in TUnixSystem::StackTrace() () from /snap/root-framework/931/usr/local/lib/libCore.so
#5  0x00007f0097c95d2d in TUnixSystem::DispatchSignals(ESignals) () from /snap/root-framework/931/usr/local/lib/libCore.so
#6  0x00007f0097c8cfc2 in SigHandler(ESignals) () from /snap/root-framework/931/usr/local/lib/libCore.so
#7  0x00007f0097c95c2b in sighandler(int) () from /snap/root-framework/931/usr/local/lib/libCore.so
#8  <signal handler called>
#9  0x000055ac12170460 in ?? ()
#10 0x000055ac111d0db5 in MainWindow::on_pushButton_5_clicked (this=0x7fff2bb8be50) at ../../Plotting_App/LSR-Plot-GUI/mainwindow.cpp:337
#11 0x000055ac111e43c2 in MainWindow::qt_static_metacall (_o=0x7fff2bb8be50, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff2bb8b250) at moc_mainwindow.cpp:226
#12 0x000055ac111e44d9 in MainWindow::qt_metacall (this=0x7fff2bb8be50, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff2bb8b250) at moc_mainwindow.cpp:253
#13 0x00007f0095fba2df in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#14 0x00007f009689e802 in QAbstractButton::clicked(bool) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#15 0x00007f009689ea4a in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#16 0x00007f00968a0520 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#17 0x00007f00968a079e in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#18 0x00007f00967d5c3e in QWidget::event(QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#19 0x00007f0096781fb2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#20 0x00007f009678a8e0 in QApplication::notify(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#21 0x00007f0095f5d67a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#22 0x00007f0096789c30 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#23 0x00007f00967e7be1 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#24 0x00007f00967ea84b in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#25 0x00007f0096781fb2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#26 0x00007f0095f5d67a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#27 0x00007f00943c4ff0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#28 0x00007f009441cb7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#29 0x00007f00948a7700 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#30 0x00007f009411bd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f0094171258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007f00941193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f0096204f4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#34 0x00007f0095f68fc3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#35 0x00007f0095f65a8e in QCoreApplication::exec() () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#36 0x000055ac111ceff9 in main (argc=1, argv=0x7fff2bb8bfe8) at ../../Plotting_App/LSR-Plot-GUI/main.cpp:10
===========================================================

The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#9  0x000055ac12170460 in ?? ()
#10 0x000055ac111d0db5 in MainWindow::on_pushButton_5_clicked (this=0x7fff2bb8be50) at ../../Plotting_App/LSR-Plot-GUI/mainwindow.cpp:337
#11 0x000055ac111e43c2 in MainWindow::qt_static_metacall (_o=0x7fff2bb8be50, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff2bb8b250) at moc_mainwindow.cpp:226
#12 0x000055ac111e44d9 in MainWindow::qt_metacall (this=0x7fff2bb8be50, _c=QMetaObject::InvokeMetaMethod, _id=4, _a=0x7fff2bb8b250) at moc_mainwindow.cpp:253
#13 0x00007f0095fba2df in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#14 0x00007f009689e802 in QAbstractButton::clicked(bool) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#15 0x00007f009689ea4a in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#16 0x00007f00968a0520 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#17 0x00007f00968a079e in QAbstractButton::mouseReleaseEvent(QMouseEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#18 0x00007f00967d5c3e in QWidget::event(QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#19 0x00007f0096781fb2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#20 0x00007f009678a8e0 in QApplication::notify(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#21 0x00007f0095f5d67a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#22 0x00007f0096789c30 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#23 0x00007f00967e7be1 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#24 0x00007f00967ea84b in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#25 0x00007f0096781fb2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Widgets.so.6
#26 0x00007f0095f5d67a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#27 0x00007f00943c4ff0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#28 0x00007f009441cb7c in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#29 0x00007f00948a7700 in ?? () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Gui.so.6
#30 0x00007f009411bd3b in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007f0094171258 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007f00941193e3 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007f0096204f4a in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#34 0x00007f0095f68fc3 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#35 0x00007f0095f65a8e in QCoreApplication::exec() () from /home/kuba/Qt/6.6.1/gcc_64/lib/libQt6Core.so.6
#36 0x000055ac111ceff9 in main (argc=1, argv=0x7fff2bb8bfe8) at ../../Plotting_App/LSR-Plot-GUI/main.cpp:10

Hi Jakub,

You need to properly organize Qt/ROOT applications event loop.
Instead calling TApplication::Run() one must regularly invoke gSystem->ProcessEvents().
Most simple implementation shown in this example

This example shows usage of web-based widgets of the ROOT - including web-based TCanvas.

On Linux X11-based platforms it is still possible to use TRootCanvas class - but it has to be properly configured. Here is most important part of Qt-based application which let embed normal ROOT graphics into Qt.

You can reuse several classes from this project to build your own Qt-ROOT application.
Here is minimal example. It uses only few classes which are independent from the rest of Go4 framework.

But I really recommend to check web-based demo in ROOT itself. It works on all platforms and we will try to support it. Older X11-based approach works only on Linux - and not always like some distributions with Wayland.

Regards,
Sergey

Thank you, Sergey, I will explore these recommendations.

Greetings,
Jakub