Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. ToolbarMenuLayout and programmatcally add or remove buttons
Forum Updated to NodeBB v4.3 + New Features

ToolbarMenuLayout and programmatcally add or remove buttons

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 2 Posters 1.9k Views 1 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.
  • I Offline
    I Offline
    Ices_Eyes
    wrote on last edited by
    #1

    Hi all :)
    I have an app with different pages that have different toolbar layouts. In one of these pages I neeed to have 3 or 4 button in the toolbar depending by some event: 2 buttons are always there, the first, ie the back button, and the last, ie the menu button. The page is divided into 2 tabs. The third button is always visible if in the first tab, but never on the second one. Finally, the fourth button is again never visible on the second tab, but it is sometimes visible in the first one, depending on some properties. Now, I have correctly managed to obtain the visibility for the buttons, but their layout is really poor. I mean that, for example, if in the first tab, with just three button, the middle one is not in the center of the toolbar, since the hidden second one still occupy a position in the bar.

    I'm not sure i've been able to fully explain the problem, but in case, is there a solution to it? :P

    Thanks all :)

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Peppy
      wrote on last edited by
      #2

      And thus we have signals and slot system...do whatever you want with S&S system, just use the right signals and slots...

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Ices_Eyes
        wrote on last edited by
        #3

        The problem I have is that if I change the toolbar after it has been shown, it does not change in the view... That's why the question...

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Peppy
          wrote on last edited by
          #4

          try @QWidget::update();@

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Ices_Eyes
            wrote on last edited by
            #5

            That'not available in pure QML... Or do I miss something?

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Peppy
              wrote on last edited by
              #6

              So the only one reason is, I think do it in C++...

              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