All of these demos will be preset for the raspberry 'RPI3
but can easily be changed for x86_64 changing and uncommenting one line of code
I also tried this on Manjaro archlinux RPI3
'RPI3
PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -I/usr/include/arm-linux-gnueabihf/qt5 -fPIC
but lets say you want to test on an x86_64
well just comment out the the PRAGMA line for the RPI3
and uncomment the x86_64 PRAGMA line
'x86_64
PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -Wno-deprecated-declarations -fPIC -I/usr/include/x86_64-linux-gnu/qt5
I like archlinux Manjaro too very cutting edge software versions!
'Manjaro archlinux RPI
PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -I/usr/include/qt5 -fPIC
dowload the source code
PRAGMA INCLUDE <QtWidgets/QApplication> <QtWidgets/QMainWindow> <QtWidgets/QComboBox> <QtWidgets/QHBoxLayout> <QtWidgets/QLabel>
PRAGMA LDFLAGS -lQt5Widgets -lQt5Gui -lQt5Core -lpthread -latomic
PRAGMA COMPILER g++
'RPI3
PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -I/usr/include/arm-linux-gnueabihf/qt5 -fPIC
'x86_64
'PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -Wno-deprecated-declarations -fPIC -I/usr/include/x86_64-linux-gnu/qt5
'Manjaro archlinux RPI
'PRAGMA OPTIONS -Wno-write-strings -Wno-pointer-arith -I/usr/include/qt5 -fPIC
OPTION PARSE FALSE
DECLARE app TYPE QApplication*
DECLARE window TYPE QMainWindow*
DECLARE hbox TYPE QHBoxLayout*
DECLARE combo TYPE QComboBox*
DECLARE label TYPE QLabel*
DECLARE w TYPE QWidget*
'DECLARE combotext TYPE QString
app = new QApplication(argc, argv)
DECLARE distros = { "Arch", "Xubuntu", "Redhat", "Debian","Mandriva" } TYPE QStringList
'--- Create a widget instead of a window
w = new QWidget()
hbox = new QHBoxLayout()
combo = new QComboBox()
combo->addItems(distros)
hbox->addWidget(combo)
hbox->addSpacing(15)
label = new QLabel("Arch")
hbox->addWidget(label)
'--- Set the hbox as the layout of the widget
'--- this fixes having a window and a widget that are not joined
w->setLayout(hbox )
QObject::connect(combo, qOverload<const QString &>(&QComboBox::activated),label, &QLabel::setText)
w->resize(350, 150)
w->setWindowTitle("Qcombox demo")
w->show()
return app->exec()