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. [solved] Transform QTabBar into QComboBox in QTabWidget
Forum Updated to NodeBB v4.3 + New Features

[solved] Transform QTabBar into QComboBox in QTabWidget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.3k 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.
  • L Offline
    L Offline
    lucadanieli
    wrote on last edited by
    #1

    Hi all,

    I'm facing this problem and I don't find answer on the various threads.

    This is my project:
    I have an editor box, and I want to split it many times in the main window, each splitter having his own TabBar/ComboBox. What I have done is to create a QTabWidget in each splitter. This is actually working very well.

    Now, I would like to have a ComboBox instead of TabBar. Is there any way to make this?

    Luca

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

      Hi and welcome to devnet,

      Rather than trying to modify QTabWidget why not create your own "stacked widget" using a QComboBox and QStackedWidget ?

      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
      • L Offline
        L Offline
        lucadanieli
        wrote on last edited by
        #3

        Yes, you are right.
        Actually I didn't understood very well how "classes" are useful. Now I have done it with my supervisor, and he taught me that a new class can contain a TabBar/ComboBox and the StackedWidget associated to it.

        Any way, I think that a setBarMode(TabBar/ComboBox) would be useful in next releases of Qt.

        Thank you for the help :)
        Luca

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

          You're welcome !

          setBarMode wouldn't make any sense here. The widget name is pretty self explanatory.

          Since you have it all working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          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

          • Login

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