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. QTabWidget tabPosition west and text alignment horizontal
Forum Updated to NodeBB v4.3 + New Features

QTabWidget tabPosition west and text alignment horizontal

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 10.7k 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.
  • N Offline
    N Offline
    neel2818
    wrote on last edited by
    #1

    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
    0
    • H Offline
      H Offline
      HuXiKa
      wrote on last edited by
      #2

      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
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • N Offline
          N Offline
          neel2818
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            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
            0
            • N Offline
              N Offline
              neel2818
              wrote on last edited by
              #6

              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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved