Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    QTabWidget tabPosition west and text alignment horizontal

    General and Desktop
    3
    6
    9971
    Loading More Posts
    • 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.
    • N
      neel2818 last edited by

      Hi All,

      I have one query regarding QtabWidget.
      In QTabWidget if tab position is west then text is align to vertical. i want to text to be align in horizontal if tab position is west.

      I have used QTabWidget in my code. and tab position is west and i want to align text in horizontal.

      Can you please give me some example with code or give some useful link.

      Thanks,
      Neel

      1 Reply Last reply Reply Quote 0
      • H
        HuXiKa last edited by

        I think you have to create your own subclass of QTabWidget / QTabBar to achive this.

        If you can find faults of spelling in the text above, you can keep them.

        1 Reply Last reply Reply Quote 0
        • A
          andre last edited by

          Or possibly, a QProxyStyle can do the trick, in which you override the rendering of the tabs.

          1 Reply Last reply Reply Quote 0
          • N
            neel2818 last edited by

            but how to do that .. can you please give me with example ....

            1 Reply Last reply Reply Quote 0
            • A
              andre last edited by

              Both approaches are not trivial. It is not so easy to do, nor to give a simple sample for it. You will have to start digging into the documentation for it. [[doc:QProxyStyle]] could be a place to start.

              1 Reply Last reply Reply Quote 0
              • N
                neel2818 last edited by

                I have reimplemented the paintEvent of QTabBar then i am able to change the text alignment to horizontal.
                But another question i also want to add space between two tabs which configurable property. i have added space by drawControl method in painting but when i add space then after that size of the tab decrease. what is the reason ?

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post