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. menuitem->setEnabled() segv

menuitem->setEnabled() segv

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

    I have a main window with a layout. in the layout are 2 widgets. During my mainwindow initialisation i create the widgets, add them to the layout and call centralwidget() on the Layout.
    The last thing I do in my mainwindow init is to disable practically all menu items except file/new. This all works as expected.

    As part of file/new method I enable all relevant menuitems via setEnabled(true). Each one of these calls causes a segv for no apparent reason -- no additional debug info, debug console messaging or messages from static_assert are printed.

    What is causing this?

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

      hi
      Have you tried to single step it to see if somehow you have infinite recursions?
      Else its hard to imagine what could make it
      crash since i assume it cant be a dangling pointer or the normal suspects.

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        QtUsr001
        wrote on last edited by
        #3

        ok I will follow up on that advice.

        thanks.

        JonBJ 1 Reply Last reply
        0
        • Q QtUsr001

          ok I will follow up on that advice.

          thanks.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @QtUsr001
          I would like a written guarantee from you as to what menuitem is pointing to when you go menuitem->setEnabled() :)

          I wouldn't expect a debug message for this, just a SEGV. But you should be able to sit in the debugger and break/traceback on the statement to see what it tells you *menuitem looks like.

          1 Reply Last reply
          1

          • Login

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