Qt Forum

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

    Unsolved menuitem->setEnabled() segv

    General and Desktop
    3
    4
    115
    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.
    • Q
      QtUsr001 last edited by

      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 Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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 Reply Quote 1
        • Q
          QtUsr001 last edited by

          ok I will follow up on that advice.

          thanks.

          JonB 1 Reply Last reply Reply Quote 0
          • JonB
            JonB @QtUsr001 last edited by JonB

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