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. removing qaction from action editor still leave it in moc file
Forum Updated to NodeBB v4.3 + New Features

removing qaction from action editor still leave it in moc file

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 717 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.
  • T Offline
    T Offline
    tony67
    wrote on last edited by
    #1

    Hi All,
    I removed an action from my main window action editor. I removed the associated cpp ui and h files. However when I compile my moc_mainwindow.cpp report an error for the removed action.

    "moc_mainwindow.cpp:178: error: undefined reference to `MainWindow::on_actionOptions_2_triggered()'"
    

    That is linked to code

    void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
    {
        if (_c == QMetaObject::InvokeMetaMethod) {
            MainWindow *_t = static_cast<MainWindow *>(_o);
            switch (_id) {
    
    
            case 10: _t->on_actionOptions_2_triggered(); break;
    
    
    

    However I deleted the action from the action editor and also removed any cpp/h/ui associated with it.
    Can/Should I just delete the moc file line? Or is there a better way?
    Thanks

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      just rebuild the project (delete the moc file and run moc again)

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

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

        Hi,

        Did you remove the declaration of on_actionOptions_2_triggered ?

        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

        • Login

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