Qt5 Charts and Ubuntu 16.04
-
Hello all,
So I've run into an issue here that can't seem to be resolved. I installed Qt5 v. 5.11.2, everything is installed but for some reason QtCreator is barking at me saying "found not working imports: [file location] module "QtCharts" is not installed.
I went into the .pro file updated QT+= charts
but this also is happening in PyQt5 as well. "module "QtCharts" is not installed"
What gives? Is something broken in Qt5 with Ubuntu 16.04? I can't seem to find it anywhere or install it. I can't upgrade the OS or compile from scratch either because of certain project requirements I have to meet. This is super frustrating. Any help or direction would be greatly appreciated. I have come to a complete dead halt in my software production.
-
QtChart is an optional module, start the maintenance tool and make sure the module is ticked
@VRonin
Sure is ticked.
I've even unticked it and reticked it.Yup. Tried this many times. In fact during my installation process it was infact already checked. I reopened the maintenance tool, unchecked it, ran it. Closed, rebooted, and rechecked it. Nothing.
Even PyQt5 is complaining it doesn't exist.
I have to wait 600 seconds before replying, my apologies if I can't reply right away... -
Hi,
How did you install PyQt5 ?
-
@SGaist
via terminal.
sudo apt-get install python3-pyqt5 pyqt5-dev-toolsPyQt5 works fine otherwise. It's just the charts and data visualizations that are not working. The same goes for QtCreator and Qt5.
It seems that although it is technically installed, QtCreator cannot see it and nor can PyQt5. I just did a search for 'charts' in / to see if I can find where these libraries are installed and it returned a lot.
So I have /home/user/Qt/5.11.2/gcc_64/lib/cmake/Qt5Charts
among other directories. So it's there. It exists.I also have a folder called chartsqml2
/home/user/Qt/5.11.2/Src/qtcharts/src/chartsqml2I'm starting to think there's an issue with Qt5 and the Ubuntu 16.04 environment. Possible bug?
I can't upgrade to 17.10 or 18.04. The requirement states I have to use 16.04.Ugh - I need more reputation points, or replying in this thread is going to be torture. I have to wait 10 minutes before I can even reply to anyone.
-
So your PyQt5 version is using your distribution's Qt. That's why it can't find the QtChar module.
-
So your PyQt5 version is using your distribution's Qt. That's why it can't find the QtChar module.
Well, regardless if I am using PyQt5 or even QtCreator. I downloaded QtCreator directly from the Qt5 website. So it's 5.11.2.
Even in QtCreator, I go to compile using qmake and there's an instant segmentation fault if I so much as use a qtchart in any way. It's installed using the Qt Maintenance Tool too. It does not even give me a reason, just exists unexpectedly. I am using QtCharts 2.2
Using the gcc 64-bit compiler as well.ChartView { ... } -
Might be a silly question, did try to run the application using the debugger ?
-
@SGaist
Yup.
Debugger starts and then instantly segfaults with a SIGSEGV (segfault). No line of code, no function. Goes right into low level assembly.0x7fffcbae5665 <+0x0055> 4c 8b 00 mov (%rax),%r8barfs right there.
I'm now trying on a completely different computer, also running Ubuntu 16.04 with QtCreator and Qt5.11.2
I just re-ran the exact same test and it reproduced the same, exact issue. I'm starting to think that this is a bug with 16.04 and Qt5.11.2.Would anyone be willing to re-test using a VM with Ubuntu 16.04 (I'm using Ubuntu Mate specifically). With 5.11.2? If this is a reproducible issue, then we can file this?
I just did this test with both a VM and a native install of Ubuntu Mate 16.04. Both had identical issues.
-
@SGaist
Yup.
Debugger starts and then instantly segfaults with a SIGSEGV (segfault). No line of code, no function. Goes right into low level assembly.0x7fffcbae5665 <+0x0055> 4c 8b 00 mov (%rax),%r8barfs right there.
I'm now trying on a completely different computer, also running Ubuntu 16.04 with QtCreator and Qt5.11.2
I just re-ran the exact same test and it reproduced the same, exact issue. I'm starting to think that this is a bug with 16.04 and Qt5.11.2.Would anyone be willing to re-test using a VM with Ubuntu 16.04 (I'm using Ubuntu Mate specifically). With 5.11.2? If this is a reproducible issue, then we can file this?
I just did this test with both a VM and a native install of Ubuntu Mate 16.04. Both had identical issues.
@Bits-n-Flips said in Qt5 Charts and Ubuntu 16.04:
@SGaist
Yup.
Debugger starts and then instantly segfaults with a SIGSEGV (segfault). No line of code, no function. Goes right into low level assembly.0x7fffcbae5665 <+0x0055> 4c 8b 00 mov (%rax),%r8barfs right there.
I'm now trying on a completely different computer, also running Ubuntu 16.04 with QtCreator and Qt5.11.2
I just re-ran the exact same test and it reproduced the same, exact issue. I'm starting to think that this is a bug with 16.04 and Qt5.11.2.Would anyone be willing to re-test using a VM with Ubuntu 16.04 (I'm using Ubuntu Mate specifically). With 5.11.2? If this is a reproducible issue, then we can file this?
I just did this test with both a VM and a native install of Ubuntu Mate 16.04. Both had identical issues.
Alright, so after some finangling I figured out it was segfaulting because the charts required that the C++ side of things (in QtCreator) NEED to use QApplication instead of QGuiApplication which is traditionally used when setting up default. So I got that to work in QtCreator. We're good on that side.
Now onto PyQt5...
How would I be able to get the qt5 charts working in PyQt5? It's missing a library since it's using an older version? -
and solved with pyqt5!
do a pip3 install of PyQtChartand boom. Done.
That was a little round about but I'm glad it wasn't too messy overall. It could have been a lot worse...So QtCreator Qt5.11.2 works with Qt5 charts
as well as PyQt5.So for anyone else reading this forum post and is using Ubuntu 16.04 (I have seen some other posts around the web complaining of similar issues), follow the instructions in this thread and you should be good as well.
-
Glad you found out thanks for sharing !