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. Error when adding slot to QAction
Qt 6.11 is out! See what's new in the release blog

Error when adding slot to QAction

Scheduled Pinned Locked Moved Solved General and Desktop
slotsqaction
2 Posts 2 Posters 1.8k 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.
  • S Offline
    S Offline
    Suroh6
    wrote on last edited by Suroh6
    #1

    When I attempt to add a slot to a QAction (Part of a menu) via the designer I'm getting an error that says "Error finding/adding slot" The class containing Ui::MainWindow cannot be found in MainWindow.h, MainWindow.cpp and a header I added at the very bottom it says please verify include directories, I'm not really sure what to make of this as it's included in the proper places any suggestions?

    I solved it myself, it appears due to my inheritance of the ui_mainwindow i was getting the diamond inheritance issue :)

    kshegunovK 1 Reply Last reply
    0
    • S Suroh6

      When I attempt to add a slot to a QAction (Part of a menu) via the designer I'm getting an error that says "Error finding/adding slot" The class containing Ui::MainWindow cannot be found in MainWindow.h, MainWindow.cpp and a header I added at the very bottom it says please verify include directories, I'm not really sure what to make of this as it's included in the proper places any suggestions?

      I solved it myself, it appears due to my inheritance of the ui_mainwindow i was getting the diamond inheritance issue :)

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @Suroh6 said:

      I solved it myself, it appears due to my inheritance of the ui_mainwindow i was getting the diamond inheritance issue :)

      Multiple inheritance from QObject derived classes is not supported, but you shouldn't have that in the first place. Aside from that there's no problem with inheriting from QObject (directly or indirectly) and another class. In fact it's done as a standard way of providing interfaces for plugin implementations.

      Read and abide by the 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