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. Effects of Qt 4 QMenuBar::clear()

Effects of Qt 4 QMenuBar::clear()

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 385 Views 2 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.
  • O Offline
    O Offline
    oddity
    wrote on last edited by
    #1

    When I read the documentation for Qt 4.8's void QMenuBar::clear() method, and it says, "Removes all the actions from the menu bar." I interpret that to mean that if I call this on a QMenuBar instance I have created, it deletes--using delete--all the QMenu objects, and any QActions I may have added (using new, of course, in doing so) .

    Reasonable interpretation?

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

      Hi,

      The best way to ensure that is to go through the code. It's Qt 5 but the code for that class didn't moved much.

      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
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by Kent-Dorfman
        #3

        I would argue that remove and delete are two different things. I think it would depend upon how the actions were created. Do you still have pointer references to the actions after clear(), or were they created by something like the following pseudo-code?

        addAction(new Action("something"))

        If you meet the AI on the road, kill it.

        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