Questions tagged [qtabwidget]

The QTabWidget class, part of the Qt framework, provides a stack of tabbed widgets.

The QTabWidget class provides a stack of tabbed widgets. A tab widget provides a tab bar and a "page area" that is used to display pages related to each tab.

Qt documentation for QTabWidget can be found here for Qt 5 and here for Qt 4.8.

365 questions
2
votes
1 answer

How to start project with TabWidget without QWidget

Everytime you create new project from Qt Creator there is on top QWidget which you can delete. You can of course write the code manually as this: app = QApplication(sys.argv) ex = Main() sys.exit(app.exec_()) where Main class is inherited from…
Erik Šťastný
  • 1,487
  • 1
  • 15
  • 41
2
votes
1 answer

How to set QWidget in QTabWidget header?

I want to insert QLabel and QLineEdit in the header of QTabWidget. I've read the documentation of Qt but didn't able to find any function that can set any Qwidget in the Header of QTabWidget. How can i do this? Or do i have to override the…
secretgenes
  • 1,291
  • 1
  • 19
  • 39
2
votes
1 answer

Qt - How to add multiple QGroupBox to a QTabWidget?

I'm going to create multiple tabs with multiple group box inside each tab like below.  _______ ______ |              |            | |  Tab1    |  Tab2   | |              |______|_________________ | |    Group Box 1 |…
Ghasem Pahlavan
  • 661
  • 9
  • 20
2
votes
1 answer

QTabWidget or QTabBar displaying the same QWidget in different tabs using C++

I'm working with a QTabWidget right now displaying just one QWidget with different elements (labels, buttons, ...). Working with Ubuntu and Qt5.5. QTabWidget *tw; QString title = "1"; ui->tw->addTab(&tab, title); // tab is my QWidget I'd like to…
MichaW.
  • 37
  • 5
2
votes
1 answer

Closable QTabWidget tabs, but not all of them

In a Qt/C++ piece of code, I have a QTabWidget class with different tabs. I would like to add a last "+" tab, so when the user is clicking on it, I create a new tab. However I would like to have all my tabs closable ('x' at the right of the tab),…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
2
votes
2 answers

How to add a scrollbar to parent QWidget

I understand how to add a scrollArea to a particular widget. However in my case Qwidget has multiple child widgets and these are all set using QVBoxLayout. Now how can I add a scroll bar in this case? Here QWidget is not the center widget, its one…
user408307
  • 21
  • 1
  • 2
2
votes
1 answer

Widget on corner QTabBar is not in corner

I have a pushbutton to add a tab in a QTabWidget. But when I change the button's size, it's not in the corner anymore. So how can I bring it to the corner like in the first picture? Not change size: Change size: Here is my code: from PyQt4 import…
mozart
  • 129
  • 11
2
votes
1 answer

QTabBar to preserve tab position

In my app I have a QTabBar widget that uses scroll buttons if there are many tabs. Now, on currentChanged(int) signal I call a method that renames previous and current tab (calls setTabText()). Unfortunately this repaints whole QTabBar and as a…
bkarasm
  • 213
  • 1
  • 6
2
votes
1 answer

PySide Qt4 - Qtabwidget - Disable drag and drop of a single q tab widget

I have a qtabwidget with one or more tabs in it at any given time. I would like the user to be able to rearrange the second through last tab in any order, but the first tab to remain at index 0. From everything I've found, there is no way to enable…
2
votes
2 answers

QTabWidget I'd like to hid sub-tabs

I have a QTabwidget and 4 QWidget sub-tabs and I'd like to hide 3 sub tabs when I am not using them. With a 'Enable' button, I want the hidden sub-tabs to appear again. In order to hide them, I tried removeTab function as…
user3734823
  • 99
  • 1
  • 1
  • 10
2
votes
2 answers

Qt - Declaring a QLabel array and adding it to a QTabWidget's tab

I have declared a QLabel array (which i will be using as picture boxes) and the function call which is going to fill the array in the header file of the project as: void fillArray(); QLabel *label_array[7]; Then i called the declared function in…
Devenis
  • 23
  • 5
2
votes
2 answers

Change color of QTabWidget tab's

I want to customize a QTabWidget, so that every tab has it's own background color. I know, that this cannot be done with stylesheets, so I subclassed QTabBar and changed it's paintEvent. Then, I replaced the default QTabBar of QTabWidget with my own…
user2494129
  • 717
  • 2
  • 13
  • 24
2
votes
2 answers

dynamically adding a tab qt 5.1

I am having a difficult time figuring out how i should do this. I have a QWidget main window and its has a QTabWidget inside a VBoxLayout. The main function of the window is to hold the chats of people who are chatting with our software. So what I…
TheMan68
  • 1,429
  • 6
  • 26
  • 48
2
votes
2 answers

PyQt4 menu acction to add new tab to QTabWidget

I'm working on a small application for work w/ python and PyQt4 for the GUI. What I'm trying to accomplish is having a tabbed GUI where when a user clicks on a menu item, the action taken adds a tab to the QTabWidget. I'm currently having trouble…
Seth Koberg
  • 965
  • 2
  • 9
  • 15
2
votes
1 answer

PyQt multiple tablewidgets and tabwidgets

My objective is to display 10 or more QTabWidget in a single QMainWindow, each tab holding a unique QLabel and QTableWidget. Something like this: Even though i managed to get the intended result by using the following code, i am wondering if there…
Chris Aung
  • 9,152
  • 33
  • 82
  • 127