FAQ Database Discussion Community


QTabWidget does not respect spacing from layout

qt,qt5,qtabwidget
I have this test case: // Scroll QScrollArea *sa = new QScrollArea(ui->centralWidget); sa->setWidgetResizable( true ); // Layout for widgets QVBoxLayout *vl_2 = new QVBoxLayout(); vl_2->setSpacing(0); // Widget to attach the scroll to and the layout QWidget *widget = new QWidget() widget->setLayout(vl_2); sa->setWidget(widget); // Test widgets QComboBox *cb_1 = new QComboBox();...

QTableView inside QTabWidget does not show data

c++,qt,sqlite,qtableview,qtabwidget
I have a QTabWidget, each tab contains a QTableView. The tableviews use QTableModels which reads data from an sqlite database. The models are kept as member variables, so I don't think it's a scope problem (which is the most frequent problem I've found by searching for the issue). Other db...

How to prevent tab buttons from shrinking in QTabWidget

qt,tabs,qt5,qtabwidget,qtabbar
How do I prevent the tab buttons of a Qt5 QTabWidget from shrinking, thus obscuring the full tab names, when I shrink the containing window? Here's a self-contained example of the problem: #include <QApplication> #include <QMainWindow> #include <QtGui> #include <QTableWidget> QTableWidget* makeTableWidget( QWidget* parent ) { QTableWidget* tableWidget = new...

Prevent tab cycling with Ctrl+Tab by default with QTabWidget

python,qt,pyqt,pyside,qtabwidget
I have the following example code that makes a three tab layout (with buttons on the third tab). By default, I can Ctrl+Tab/Ctrl+Shift+Tab to cycle between the tabs. How do I disable this functionality? In my non-example code, this is not desired behaviour. from PyQt4 import QtGui import sys def...

Inline renaming of a tab in QTabBar/QTabWidget

c++,qt,qtabwidget,qtabbar
I really want to have a QTabWidget that can be renamed by double-click on tab caption. I have googled and found this solution, but it's more like an outline for a developer who knows his way through Qt and subclassing it's widgets. I'm kind of stuck how to implement all...

QTabWidget. How to move one tab to right position?

python,qt,tabs,pyqt4,qtabwidget
Standard layout tabs from left to right. All tabs are nearby. How to change the position of the one tab, so that it was attached to the right edge? Like This: Is it possible to do?...