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. QML TabBar bunch up when not visible?

QML TabBar bunch up when not visible?

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

    I have a TabBar in QML which has 3 tabs, one of the tabs, the one in the middle is only visible when the application is connected to another device.

    The issue is that whilst the tab's visible property works and the tab is visible or hidden when its connected or not connected, the space that the tab occupies in the tabbar is still reserved.

    Is there anyway to bunch up or move the tabs after this one so there isn't a space? Of course I could re-order them but I would rather show a nice animation of the tabs moving when they are or are not visible.

    Kind Regards,
    Sy

    J.HilkJ 1 Reply Last reply
    0
    • SPlattenS SPlatten

      I have a TabBar in QML which has 3 tabs, one of the tabs, the one in the middle is only visible when the application is connected to another device.

      The issue is that whilst the tab's visible property works and the tab is visible or hidden when its connected or not connected, the space that the tab occupies in the tabbar is still reserved.

      Is there anyway to bunch up or move the tabs after this one so there isn't a space? Of course I could re-order them but I would rather show a nice animation of the tabs moving when they are or are not visible.

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      hi @SPlatten

      I haven't used QML TabBar yet, but if it behaves like other QMl objects, you could tie the width to the visibility of the tab. Make its with 0 when not visible and x when visible

      That way you can also easily add animation via Behavior on width { NumberAnimation {...}}


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      1
      • SPlattenS Offline
        SPlattenS Offline
        SPlatten
        wrote on last edited by SPlatten
        #3

        Presently the width is not set I think its worked out from the text, I will play around and see if I can use empty text if not visible.

        So far that did nothing, it seems the tabbar occupies the space available to it. I just found information on a TabView which looks different in the way its rendered it doesn't use the full width and tabs are sized dynamically, I'l give that a try.

        Dammit!!! According to the page I just read:
        https://doc.qt.io/qt-5/qml-qtquick-controls-tabview.html

        It should be available, my QML page starts with this:

            import QtQuick 2.7
            import QtQuick.Controls 2.1
            import QtQuick.Controls.Styles 1.4
            import QtQuick.Layouts 1.3
            import QtGraphicalEffects 1.0
        

        The version of Qt it 5.8, I have no control over that, but according to the link I posted tabview should be available from Qt 5.1 with QtQuick.Controls 1.4

        So why when I type in TabView is it underlined in red with "Unknonwn component. (M300)" ?

        Just found this:
        https://forum.qt.io/topic/31720/solved-objectmodel-unknown-component-m300/10

        Checked "Enable Qt Quick Compiler", this triggered a Build, didn't help same "Unknown component. (M300)".

        Kind Regards,
        Sy

        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