Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Help needed with slots and signals for menu

Help needed with slots and signals for menu

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 398 Views
  • 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.
  • I Offline
    I Offline
    impo
    wrote on last edited by
    #1

    I am having trouble with the slot and signals of a menu class for a program.

    It says QObject::connect: No such slot MainWindow::on_menu_triggered(QAction*) in ..\001\SudokuSolver\mainwindow.cpp:179.

    Line 179 is QObject::connect(&menu, SIGNAL(triggered(QAction*)), this, SLOT(on_menu_triggered(QAction*)));

    and there is an on_menu_triggered(QAction*) function and it is this:

    void MainWindow::on_menu_triggered(QAction* action){
    cout << "Hi Mom";
    }

    the cout is just to check I'm actually reaching the on_menu_triggered function (which I am not)
    The declaration of on_menu_triggered(QAction* action) is in the .h file under public slots. Any ideas? Thanks

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Is on_menu_triggered(QAction* action) declared in public slots: or private slots: section?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      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