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. QWidget::insertAction: Attempt to insert null action?
QtWS25 Last Chance

QWidget::insertAction: Attempt to insert null action?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 638 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.
  • L Offline
    L Offline
    lansing
    wrote on last edited by
    #1

    My project has a lot of QAction, I had declared them in the header and in the source, I gave them default to nullptr and instantiated them all at once with a loop. After that I assigned them to the different menus. However at the end, I have missed a couple of QActions somewhere and Qt Creator is giving me a warning

    QWidget::insertAction: Attempt to insert null action?

    How do I find out which one are they?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      If it is a warning, you can set environment variable QT_FATAL_WARNINGS and app will crash whenever that message is printed. Then it should be trivial to check which action it is using an attached debugger.

      (Z(:^

      L 1 Reply Last reply
      3
      • sierdzioS sierdzio

        If it is a warning, you can set environment variable QT_FATAL_WARNINGS and app will crash whenever that message is printed. Then it should be trivial to check which action it is using an attached debugger.

        L Offline
        L Offline
        lansing
        wrote on last edited by
        #3

        @sierdzio said in QWidget::insertAction: Attempt to insert null action?:

        QT_FATAL_WARNINGS

        Thank you it works. Setting this and the debugger points me right to the spot that causes the warning.

        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