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. QWidgetAction - what does QToolbar do to it ?

QWidgetAction - what does QToolbar do to it ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 510 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.
  • D Offline
    D Offline
    Dariusz
    wrote on last edited by
    #1

    Hey

    Does QToolbar deletes its QWidgetActions / recreate them on each drag/drop/ reordering of actions ? I keep hitting memorry errors on my custom widgets while in toolbar and I'm trying to debug why... Only thing comes to my mind is that qtoolbar is deleting/recreating them...

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Since it's your own widget - why not simply adding debug output or breakpoints to your dtors and see if you're right?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1
      • D Offline
        D Offline
        Dariusz
        wrote on last edited by Dariusz
        #3

        Well I can see QToolbar deleting my actions when I perform drag on toolbar to place it in another location. But it never recreates them again ? I'm at loss :- ( I'm trying to figure out where the error is and for that I need to understand the toolbar/action system better...

        As far as I can tell, when action is "hidden" when toolbar is to short to display all actions. On initial creation I can press arrow and see missing actions. But when I drag&drop. Every hidden action gets deleted and never re-created again...

        and I removed deleteWidget overload and it stopped deleting the actions...sigh...

        D 1 Reply Last reply
        0
        • D Dariusz

          Well I can see QToolbar deleting my actions when I perform drag on toolbar to place it in another location. But it never recreates them again ? I'm at loss :- ( I'm trying to figure out where the error is and for that I need to understand the toolbar/action system better...

          As far as I can tell, when action is "hidden" when toolbar is to short to display all actions. On initial creation I can press arrow and see missing actions. But when I drag&drop. Every hidden action gets deleted and never re-created again...

          and I removed deleteWidget overload and it stopped deleting the actions...sigh...

          D Offline
          D Offline
          Dariusz
          wrote on last edited by
          #4

          @Nope I cant get it to work.

          if I run this

          void testAction::deleteWidget(QWidget *widget) {
              qInfo() << "icWALineDouble DELETE";
              mParent->deleteLater();
              mParent = nullptr;
          }
          

          or this

          void testAction::deleteWidget(QWidget *widget) {
             QWidgetAction::deleteWidget(widget);
          }
          

          And I perform re-arrangement of toolbar - move it left/right & any of actions were hidden. They get deleted but they never recover back when I dragg teh toolbar back in.

          Is this a bug or something?

          Why would toolbar not recreate actions it had before re-arrangement of itself?

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by
            #5

            We can only guess so please provide a minimal, compilable testcase for your issue.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            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