Forums

OverviewFelgo 2 Support (Qt 5) › TabControl problem

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #17429

    Davide Manuel

    Hi there.

     

    I’m developping an app for android and i’m using tabcontrol as navigation.

    My problem is that i can’t set the tab text size and i’m getting an ugly tabbar, as seeing in the pic:

     

    My code is simple as :

    TabControl {
            id: navigation
            showIcon: true
            tabPosition: Qt.BottomEdge
            NavigationItem {
                id: ddd
                icon: IconType.shoppingcart
                title: "page1"
                NavigationStack {
                    PageOne{
                    }
                }
            }
            NavigationItem {
                icon: IconType.history
                title: "page2"
                NavigationStack {
                    PageTwo{
                    }
                }
            }
            NavigationItem {
                icon: IconType.user
                title: "Page3"
                NavigationStack {
                    PageThree{
    
                    }
                }
            }
        }

     

    And i’m getting this:

     

    I’ve tried to use textFont property on tabcontrol, but can’t figure out how to use it.

     

    Thx for any help.

     

    #17430

    Davide Manuel

    Editing: i tried to use Theme to set the global tab text size, but no success.

    onInitTheme: {
      Theme.tabBar.textSize = sp(8) 
    }

     

    #17432

    Günther
    Felgo Team

    Hi!

    I don’t see your screenshot anywhere, but the following code snippet works for me (note that the Theme.tabBar.textSize property does not require using sp):

    App {
      
      onInitTheme: {
        Theme.tabBar.textSize = 8
      }
      
      TabControl {
        id: navigation
        showIcon: true
        tabPosition: Qt.BottomEdge
        NavigationItem {
          id: ddd
          icon: IconType.shoppingcart
          title: "page1"
          NavigationStack {
            Page{
              title: "Page 1"
            }
          }
        }
        NavigationItem {
          icon: IconType.history
          title: "page2"
          NavigationStack {
            Page {
              title: "Page 2"
            }
          }
        }
        NavigationItem {
          icon: IconType.user
          title: "Page3"
          NavigationStack {
            Page {
              title: "Page 3"
            }
          }
        }
      }
    }

     

    Best,
    Günther

    #17436

    Davide Manuel

    Hi Gunther.

    Strange, i’m seeing the pic on my post.

    I just pasted it. There’s another way to send pics here?

     

    By the way, your right. Just removed the sp and now is fine.

     

    Thx

     

    P.S: how may i set the topic closed?

     

    #17439

    Günther
    Felgo Team

    Hi,

    You can consider the topic closed if all questions are answered 😉

    The forum does not support posting images directly at the moment. It is possible to use external services for uploading/sharing an image via url.
    Best,
    Günther

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support