[SOLVED] Signal/Slot Autoconnection does not work properly on Windows Compact 7 Build



  • Hello,

    I have created an app with a QTabWidget on my desktop. I went into designer and right clicked the tab widget to automatically create a currentChanged(QWidget *arg1) slot when the tabs are clicked:

    @void MainWindow::on_tabWidget_currentChanged(QWidget *arg1)
    {
    this->close();
    }@

    In the desktop version everything works perfectly. Then, when I build it for Windows Compact 7 and run it on my embedded board it states that there is no signal for the slot that I made. This is followed by the app not working properly because nothing happens when I click the tabs. Furthermore, when I add the autoconnection the words on my tabs disappear. It is very odd. Anyone know what may be happening?

    Thank you!

    UPDATE

    Just as an update, I tried manually connecting the signal and slot to force the connection using

    @connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(on_tabWidget_currentChanged(QWidget*)));@

    However it still did not work. In Windows Compact 7 I used kernel tracker and got the following error message:

    QMetaObject::connectSlotsByName:no matching signal for on_tabWidget_currentChanged(QWidget*)



  • The parameter of signal and slot need to match. In your case its int and QWidget*, which does not match and will thus not connect successfully.
    You will need to create a slot taking an int, which can be connected to the currentChanged signal, and do your work based on the index of the tab clicked.


  • Lifetime Qt Champion

    Hi,

    To add to D0IT, are you sure it's working correctly on the desktop version ? You should also have that error logged on the console



  • D0IT's solution has worked. And yes, oddly enough it does work on the desktop version, but D0IT's corrections need to be made in order for it to work on the embedded version

    Thanks to both!

    [quote author="SGaist" date="1375039983"]Hi,

    To add to D0IT, are you sure it's working correctly on the desktop version ? You should also have that error logged on the console[/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.