I've finally decided to make the transition from WxPython to QT! I'm using Qt Designer5.9, but I'm having issues placing a new slot. My goal is to press a button
on the GUI and have a function run that I have written in another python program.
In Qt Designer, I "go to slot
", select clicked()
and this appears.
mainwindow.cpp
void MainWindow::on_pushButton_2_clicked()
{
}
Which is exactly what I want, but the wrong language! My python is bad enough let alone anything else. So by running this tutorial I know that if I pass through ui->textEdit->append(("Hello World"));
I can do something custom, but after converting using pyuic to convert to .py it's not obvious how it's being implemented. My function is easy to import as shown below, I just need to know where to put it.
import myfunction
myfunction()
Can anyone give me an example of what needs to be written in C++ in Qt Designer so I can call my python function after .ui conversion??