Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Solved Error when adding slot to QAction

    General and Desktop
    slots qaction
    2
    2
    1160
    Loading More Posts
    • 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
      Suroh6 last edited by 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 :)

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @Suroh6 last edited by

        @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 Reply Quote 0
        • First post
          Last post