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. Extending QTabWidget
Forum Updated to NodeBB v4.3 + New Features

Extending QTabWidget

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

    Hi!
    I’d like to tweak my tab widget a bit.
    My goals are to add pin option to QTabWidget tab, like Visual Studio has for example and the other one is to show line edit inside QTabWidget tab to rename it when it’s double clicked. I couldn’t find anything useful in documentation.
    Additionally I’d like to float tabs left and right.

    Thanks in advance!

    Regards,
    Jake


    Code is poetry

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You could take a look at "QTabBar":http://qt-project.org/doc/qt-4.8/qtabbar.html for a starting point

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jake007
        wrote on last edited by
        #3

        Hi!
        Thanks. It's a starting point.
        But I still could't figure out, how to make some tabs float right and some tabs float left.


        Code is poetry

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What do you mean by "some float right and some float left" ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Jake007
            wrote on last edited by
            #5

            Like in Visual Studio for example.
            Screenshot bellow.

            !http://oi43.tinypic.com/qowvg3.jpg(VS)!


            Code is poetry

            1 Reply Last reply
            0
            • raven-worxR Offline
              raven-worxR Offline
              raven-worx
              Moderators
              wrote on last edited by
              #6

              this isn't easy to achieve.
              You could use 2 QTabBars, but then you would have the problem that every tabbar must have a selected tab. So you won't be able to split them up and visually display only 1 selected tab.
              So your only way to go would be to do all the painting yourself. So you will need to study the Qt source code of QTabBar and take over some parts. For painting you will need to initialize the styling options correct, etc.

              Alternatively you can do some hacking with stylesheets and intercepting events to simulate it with multiple toolbars.

              Showing a lineEdit overlay at the correct position on double-click shouldn't be that hard though.

              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
              If you have a question please use the forum so others can benefit from the solution in the future

              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