Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface)
-
-
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
How cann I connect the signals manually to a slot?
Using connect(). https://doc.qt.io/qt-5/signalsandslots.html
"How do I prevent of auto-connection?" - do not use the naming convention (like on_pushButton_clicked()) - rename your slots to for example pushButtonClicked()
-
@jsulm ,
I use the qt-creator module to create form sheets.
Does it not work ? Must I setup everything without using the form file(=.ui)?
What is the problem? because I can create and run the widget on the host PC.
Do you think this is more a problem of the Touch-screen drivers?
Has anybody a idea? -
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
Does it not work ?
It does. What sometimes causes problems is the auto-connect feature - I was only talking about this and not whole Qt Designer (ui).
-
@jsulm ,
hi,
Thanks a lot for your answer!
Sorry for this delay but I was involved in an other project.
I use Qt5.10.1! and make a new widget.-
Here I open forms --> MainWindow.ui
-
Next I create two button
-
then I execute go to slot
-
this makes a new slot:
mainwindow.cpp
and mainwindow.h
Where must I modify the names? In both files mainwindow.cpp and mainwindow.h
-
-
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
Where must I modify the names?
This way you probably can't as designer generates the slot for you.
I create slots by myself, so can name them as I lake. -
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
You create your slots by yourself
You write the code by yourself.
If you renamed the slot then you have to connect signal and slot manually now:connect(ui->pushButton, &QPushButton::clicked, this, MainWindow::MyPushButtonClicked);
Please take a look at https://doc.qt.io/qt-5/signalsandslots.html
-
@jsulm
I'm really sorry but it's crazy.
When I go forward step by step you get again new errors.
I made it as you suggested but I get new problems:
I think I yuse this connect command in a wrong way:
When I compile it I get this errors:/home/kurt/qt-projekte/AsimpleWidget/mainwindow.cpp:9: error: invalid use of void expression connect(ui->MyPushButton, &QPushButton::clicked, this, MainWindow::MyPushButtonClicked());
and
/home/kurt/qt-projekte/AsimpleWidget/mainwindow.cpp:10: error: invalid use of void expression connect(ui->MyRadioButton,&QRadioButton::clicked, this, MainWindow::MyRadioButtonClicked());
I think this void makes some problems.
Thanks for a hint whats wrong -
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
MainWindow::MyRadioButtonClicked()
Hi
in the connect you should not have the ()
MainWindow::MyRadioButtonClicked**()**
when using the new syntax. ( the one with no SIGNAL and SLOT macros)connect(ui->MyRadioButton,&QRadioButton::clicked, this, MainWindow::MyRadioButtonClicked); // no () in the end
-
Hi @jsulm ,
I think it's like Sisyphean task because I f you solve one problem you get the next one.
Thank you for your patience. But I got the next problem:/home/kurt/qt-projekte/AsimpleWidget/mainwindow.cpp:9: error: no matching function for call to ‘MainWindow::connect(QPushButton*&, void (QAbstractButton::*)(bool), MainWindow* const, <unresolved overloaded function type>)’ connect(ui->MyPushButton, &QPushButton::clicked, this, MainWindow::MyPushButtonClicked);
and
/opt/qt5pi/sysroot/usr/local/qt5pi/include/QtCore/qobject.h:275: error: no type named ‘type’ in ‘struct std::enable_if<false, QMetaObject::Connection>’
Now seems to be something wrong in the sysroot?
-
@K-Str said in Has anyone ever got a widget running on a rpi3 with LCD-Display (HDMI and SPI-Interface):
connect(ui->MyPushButton, &QPushButton::clicked, this, MainWindow::MyPushButtonClicked);
Hi
You are missing a & ( sorry my bad, i missed it before)connect(ui->MyPushButton, &QPushButton::clicked, this, -->& MainWindow::MyPushButtonClicked);
-
Hi @jsulm ,
thank you very much for your assistance!
Now I can compile it without any failures!
I think this is a problem with qts touch screen drivers for the raspberry.
Maybe the system does not forward any signal from the touch screen.
It's funny because it works if I use on the pure system. I can make everything.
It works also If I create a widget using qt IDE on raspberry itself.
But it does not work if I try to cross compile and ruining remotely.
Has anybody an idea whats happened?
Thanks to everybody in advance for any help.