You are not logged in.
env:
Qt 6.10.1-1
Qwt 6.3.0-1 https://archlinux.org/packages/extra/x86_64/qwt/
codes:
#include <qwt_plot.h>
#include <qapplication.h>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QwtPlot plot;
return a.exec();
}error message:
QWidget: Must construct a QApplication before a QWidgetcalls stack:
1 ?? 0x7ffff5c9890c
2 raise 0x7ffff5c3e3a0
3 abort 0x7ffff5c2557a
4 QMessageLogger::fatal(const char *, ...) const 0x7ffff46982e0
5 ?? 0x7ffff55455b5
6 QFramePrivate::QFramePrivate() 0x7ffff5644f3b
7 QFrame::QFrame(QWidget *, QFlags<Qt::WindowType>) 0x7ffff5644fbf
8 QwtPlot::QwtPlot(QWidget *) 0x7ffff773d122
9 main main.cpp 7 0x5555555588e9more info:
According to the last update date of Qwt, it is built with an older version of Qt.
Last edited by jronald (2025-12-16 01:24:26)
Offline
Try "return a.exec();" but also your main.cpp doesn't have 12 lines so there's a good chance that that's not even the code that caused this weird looking a backtrace.
Offline
Sorry, the codes has been edited for simplicity.
It's consistent now.
Offline
Does
#include <QApplication>
#include <QFrame>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QFrame frame;
return a.exec();
}work as expected?
Does "QwtPlot *plot = new QwtPlot;" work?
Offline
Does
#include <QApplication> #include <QFrame> int main(int argc, char **argv) { QApplication a(argc, argv); QFrame frame; return a.exec(); }work as expected?
Yes, no error.
Does "QwtPlot *plot = new QwtPlot;" work?
No, same error.
Last edited by jronald (2025-12-15 17:06:24)
Offline
Probably some weird Qwt bug that makes it confused about the state of QApplication.
#include <QTimer>
…
QwtPlot *plot = nullptr;
QTimer::singleShot(5, [=](){ plot = new QwtPlot;} );
return a.exec();
…Offline
#include <QTimer> … QwtPlot *plot = nullptr; QTimer::singleShot(5, [=](){ plot = new QwtPlot;} ); return a.exec(); …
Same error.
Even for
QTimer::singleShot(10000, [&](){ plot = new QwtPlot;} );same error after 10 seconds.
BTW Qwt in the official repo of archlinux is built with an older version of Qt, which is in 2024.
So it mgiht be not compatible with the current version of Qt.
Last edited by jronald (2025-12-15 17:38:20)
Offline
...
BTW Qwt in the official repo of archlinux is built with an older version of Qt, which is in 2024.
Yea, loking at it
Depends On : qt5-base qt5-svg
Optional Deps : qt5-tools: For Designer plugin
Required By : gnuradio linssid qgis srsguiSo libqwt.so links against qt5, so trying to use it with qt6 won't relly work.
And as none of the reverse dependencies in the repo seem to support Qt6 (only qgis seems to support it ATM as "experimental"), there's probably little incentive to change that right now.
Updating qwt to Qt6 would probably mean a to introduce it as separate qwt6 package, or a create a qwt5 package for backward compatibility with those reverse deps.
Best you can probaly do is try to see if using qwt-qt6 from AUR instead works.
Last edited by stu (2025-12-15 18:58:56)
Offline
Oh, I was under the impression you *were* using https://aur.archlinux.org/packages/qwt-qt6
Sorry.
I'm actually surprised you're not running into linker errors…
Offline
I've also not considered with the major version of Qt, too unix ![]()
It works now, thanks.
Last edited by jronald (2025-12-16 04:35:44)
Offline