1

Is there any straightforward (without listening to key events) way to display the list of opened tabs in Qt, like following (in Visual Studio). I just want to make sure Qt does not offer such a feature, before implementing such a widget by myself.

enter image description here

At least in a primitive way like in NotePad++ (meant no offense). Now, when I am using QTabBar and press Ctrl+Tab it shows something like this,

enter image description here

And I don't know actually what is that !

Morpheus
  • 1,722
  • 5
  • 27
  • 38
  • I don't understand what exactly you are asking. You want to display the names of the tabs from some tab bar in some other widget? If so, what exactly do you see as the problem? – Thomas Feb 25 '13 at 14:56
  • I want to show the list of opened tab names, when user hit Ctrl+Tab and hold the Ctrl. So, before implementing a dialog for that by myself, I wanted to make sure Qt does not offer such a feature. – Morpheus Feb 25 '13 at 15:35

1 Answers1

0

The default behaviour of ctrl-tab is to cycle through the tabs. You will need to customize that to display your own dialog. You don't need to connect to any signals to do this, simply pass a reference to the tab widget/bar into the dialog. You can then use that reference to retrieve the names and to change the tab.

Thomas
  • 4,980
  • 2
  • 15
  • 30
  • Thank you. It seems then it is up to me to implement it. By any chance do you know what that 2nd image is about ? and how to remove it ? It happens when I press Ctrl+Tab and hold the Ctrl in my Qt app. – Morpheus Feb 25 '13 at 16:23
  • I have no idea what 2nd image you are talking about. I have never seen any images in a tab bar that I did not put there myself. – Thomas Feb 25 '13 at 16:30
  • just saw that ther is a cloasable property that can be set to have close buttons, if that is what you want, see: `bool tabsClosable() const` and `void setTabsClosable( bool closable )`. – Thomas Feb 25 '13 at 16:32