Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Signal/Slot Autoconnection does not work properly on Windows Compact 7 Build
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rizoritis
    wrote on last edited by
    #1

    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*)

    1 Reply Last reply
    0
    • D Offline
      D Offline
      D0IT
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • R Offline
          R Offline
          rizoritis
          wrote on last edited by
          #4

          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]

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved