Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qtabwidget
    Log in to post

    • UNSOLVED Customizing tab created with QTabWidget.
      General and Desktop • qml qwidget qtabwidget custom • • Asimo  

      7
      0
      Votes
      7
      Posts
      94
      Views

      @ChrisW67 Thank you so much for your recommendations! I will try.
    • UNSOLVED QTabWidget, persistent - visible - tab ?
      General and Desktop • qtabwidget qtabbar • • Dariusz  

      1
      0
      Votes
      1
      Posts
      31
      Views

      No one has replied

    • UNSOLVED How to keep border around QTabWidget with tabBarAutoHide enabled
      General and Desktop • qmainwindow qtabwidget qdockwidget border • • dporobic  

      1
      0
      Votes
      1
      Posts
      69
      Views

      No one has replied

    • SOLVED Command like "Qtab Clicked Connect" that can call a function?
      General and Desktop • connect qtabwidget clicked • • msyasak  

      7
      0
      Votes
      7
      Posts
      210
      Views

      Thank you @JonB, "currentChanged.connect" is worked.
    • UNSOLVED Push buttons on the buttom like a tab
      General and Desktop • widget qtabwidget push button • • deleted286  

      7
      0
      Votes
      7
      Posts
      298
      Views

      @jsulm Thank you
    • UNSOLVED QTabWidget style the top buttons...
      General and Desktop • qtabwidget css qstyle qstylesheet • • Dariusz  

      8
      0
      Votes
      8
      Posts
      196
      Views

      @Ketan__Patel__0011 said in QTabWidget style the top buttons...: @Dariusz said in QTabWidget style the top buttons...: FUSION If you want to set "FUSION" Style for your application add this line in your main function qApp->setStyle(QStyleFactory::create("Fusion")); Hey Yeah that's the style im using. I'm trying to reproduce in css the button style now with black outline, then the white "ping" of border and gradient background. Are there any more style presets I can download? I know there is also windows/windowvista ones but... more ? There seem to be a large preset/plugin system build for styles but I dont see any on web available for use... mhmm ?
    • UNSOLVED QTabWidget, how to load some data in QScrollArea from a database inside QTabWidget
      General and Desktop • database sqlite qtabwidget qscrollarea • • moslehuddin  

      2
      0
      Votes
      2
      Posts
      146
      Views

      @moslehuddin You should be more precise when asking a question. What exactly are you asking? How to get data from a database? How to show it? Both? How to use QScrollArea? Qt SQL: https://doc-snapshots.qt.io/qt5-5.14/qtsql-index.html How to show the data: https://doc.qt.io/qt-5/qsqltablemodel.html and https://doc.qt.io/qt-5/qtableview.html How to use QScrollArea: https://doc.qt.io/qt-5/qscrollarea.html
    • SOLVED Qt5 tabwidget - addwidget exception thrown read access violation
      General and Desktop • qtabwidget addtab • • jonndoe47  

      14
      0
      Votes
      14
      Posts
      951
      Views

      Ack, I hated COBOL. I don't use Qt Creator and write all the code from scratch. I suppose I have to learn it sometime. But I use Visual Studio to write in so it's got auto complete for that anyway. Plus, yes I know using Qt Creator means I wouldn't have made those glaring bad errors , but then I learn something, finding and tracking bugs down and asking questions gets you to understand the code a lot more, this is my personal opinion and it's the best way that works for me.
    • UNSOLVED How to Add multiple Qtoolbar in QtabWidget
      General and Desktop • qt5 qtabwidget qtwidgets qtoolbar tabs • • vicky_mac  

      4
      0
      Votes
      4
      Posts
      933
      Views

      @vicky_mac A QStackedWidget works like a book. You have pages with your content. You can flip these pages to change your widget inplace (without opening another window or something else). So one possibility is to put one of each QTabWidget (each with a different tabBar position) on a page of a QStackedWidget. You could flip the pages by clicking a dummy tab on each tabBar or you use a button to go to the next page. I know, this is not exactly what the widget in your image looks like :) @vicky_mac said in How to Add multiple Qtoolbar in QtabWidget: Haven't used QT much If you want a widget, that looks exactly like the one shown above, you could still try to subclass and create your own, custom TabWidget, but I fear, that it might be a little too challenging. Here's all you need to know about QStackedWidget (https://doc.qt.io/qt-5/qstackedwidget.html#details)
    • UNSOLVED How to set the base size of QDockWidget?
      General and Desktop • resize qtabwidget qdockwidget layouts • • Sailanarmo  

      3
      0
      Votes
      3
      Posts
      692
      Views

      @SGaist That's a fair question and to answer that it's because on the actual dock widget itself, in the production code, there are two widgets that get placed inside the dock widget itself. The topFrame contains the layout for the QTabWidget as you have pointed out. The code that is not present, botFrame contains another QGridLayout. These two then get placed inside the QGridLayout which is the layout of QGroupBox. Then to answer Why am I subclassing a layout to put widgets in it? I guess this is a personal decision and can be argued either way. For now, I will say that you are correct, that the Widget should manage the way the GridLayout adds widgets to them. However, I will argue that since QGridLayout is it's own class; the Widget does not "own" the widgets, rather, the layout owns the widgets since QWidget does not have a addWidgets function in it. Therefore, QGridLayout owns and is responsible for the Widgets that it owns. Hence the decision that the QWidget is the parent, which has a QGridLayout, which the QGridLayout as the Child, has the widgets that belong inside of it. This is a programming decision that I made with these arguments.
    • UNSOLVED Scroll tab bar without activating tabs
      General and Desktop • qtabwidget qtabbar tabs scroll qtabbar • • bckman  

      1
      0
      Votes
      1
      Posts
      133
      Views

      No one has replied

    • SOLVED expanding QPlainTextEdit boxes in QTabWidgets
      Tools • designer qtabwidget qplaintextedit • • mzimmers  

      10
      0
      Votes
      10
      Posts
      757
      Views

      Usually, it's the bigger widget added that sets the overall size of the QTabWidget.
    • SOLVED How to get usesScrollButtons buttons to scroll tabs when it has many tabs For MAC?
      General and Desktop • macos qtabwidget qtabbar qscrollbar • • Yash001  

      11
      0
      Votes
      11
      Posts
      2089
      Views

      Thank You @SGaist and @AndyS. I am able to get QToolButton of QTabBar by applying Fusion style. I applied Fusion Style By: #include "mainwindow.h" #include <QTimer> #include <QtGlobal> #include <QFile> #include <QLocale> #include <QSplashScreen> #include <QGuiApplication> #include <qstylefactory.h> int main(int argc, char *argv[]) { QLocale::setDefault(QLocale::system()); QApplication a(argc, argv); a.setStyle(QStyleFactory::create("Fusion")); MainWindow w; w.showMaximized(); return a.exec(); }
    • SOLVED Remove shadow from QTabWidget
      General and Desktop • qtabwidget shadow border • • gde23  

      3
      0
      Votes
      3
      Posts
      2162
      Views

      @mrjj Thx for the hint setStyleSheet("QTabWidget::pane {border-bottom: 0px;}"); did the trick
    • UNSOLVED Searching a QTable widget items using wild cards!
      General and Desktop • qtabwidget item search wildcards • • Lasith  

      3
      0
      Votes
      3
      Posts
      1586
      Views

      separate QTableWidget into a QTableView and a QStandardItemModel add a QSortFilterProxyModel as the model of QTableView and set the QStandardItemModel as the QSortFilterProxyModel's sourceModel call QSortFilterProxyModel::setFilterWildcard or QSortFilterProxyModel::setFilterRegExp to perform the searching See Basic Sort/Filter Model Example
    • SOLVED QTabWidget TabBar font size weirdness
      General and Desktop • stylesheet qtabwidget font size qtabbar • • pauledd  

      3
      0
      Votes
      3
      Posts
      5883
      Views

      Thank you! I see you specified height and width manually. That works so far. I will use that.
    • SOLVED default background color of QTabWidget and QWidget/QGroupBox
      General and Desktop • qwidget layout qt4 qtabwidget groupbox • • helloworld12345  

      4
      0
      Votes
      4
      Posts
      6908
      Views

      @raven-worx Great, it works. Actually I did try setting QTabWidget setAutoFillBackground(True) previously, but it didn't work. Now I tried set VGroupBox setAutoFillBackground(True), then the color changed to light grey which is the exact default color I need. Thanks so much, raven-worx.
    • UNSOLVED QTabWidget: style each tab differently
      General and Desktop • c++ qt5 qtabwidget style qtabbar • • Sebbo  

      5
      0
      Votes
      5
      Posts
      1705
      Views

      @raven-worx ah right, couldn't be easier. :) Maybe I'll come up with another solution for my issue like subclassing and repainting the tabbar. For now that'll do the trick. Cheers
    • SOLVED QTabWidget new tabs retain old tab information/widget
      General and Desktop • qwidget qtabwidget qtabbar • • SolaVitae  

      12
      0
      Votes
      12
      Posts
      3981
      Views

      super :) its easy to overlook stuff in own code :)
    • UNSOLVED QOpenGLWidget force initialisation
      General and Desktop • qopenglwidget qtabwidget • • sparis  

      2
      0
      Votes
      2
      Posts
      817
      Views

      You'll need to change the context to the second GL widgets before using it. As each time you render or do anything with OpenGL setup/parameters that you have the right context selected first for each widget.
    • UNSOLVED QTabWidget get the tab page's widgets
      General and Desktop • qwidget pyqt5 qtabwidget • • chronix  

      6
      0
      Votes
      6
      Posts
      4812
      Views

      @Masonsu your QTextEdit is an implementation detail of your Chatlog widget. You should use e.g. a slot in Chatlog that will internally append the text to your QTextEdit. So if you change it for something else. You don't have to rewrite everything because of that.
    • SOLVED Drag tabs between QTabWidgets
      General and Desktop • drag and drop qtabwidget qtabbar drag tab • • Joel Bodenmann  

      6
      0
      Votes
      6
      Posts
      6583
      Views

      Had a similar Issue. Was able to find a solution. Below is a generic PyQt5 example that solves the problem using right click. import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * class Tabs(QTabWidget): def __init__(self, parent): super().__init__(parent) self.parent = parent self.setAcceptDrops(True) self.tabBar = self.tabBar() self.tabBar.setMouseTracking(True) self.indexTab = None self.setMovable(True) self.addTab(QWidget(self), 'Tab One') self.addTab(QWidget(self), 'Tab Two') def mouseMoveEvent(self, e): if e.buttons() != Qt.RightButton: return globalPos = self.mapToGlobal(e.pos()) tabBar = self.tabBar posInTab = tabBar.mapFromGlobal(globalPos) self.indexTab = tabBar.tabAt(e.pos()) tabRect = tabBar.tabRect(self.indexTab) pixmap = QPixmap(tabRect.size()) tabBar.render(pixmap,QPoint(),QRegion(tabRect)) mimeData = QMimeData() drag = QDrag(tabBar) drag.setMimeData(mimeData) drag.setPixmap(pixmap) cursor = QCursor(Qt.OpenHandCursor) drag.setHotSpot(e.pos() - posInTab) drag.setDragCursor(cursor.pixmap(),Qt.MoveAction) dropAction = drag.exec_(Qt.MoveAction) def dragEnterEvent(self, e): e.accept() if e.source().parentWidget() != self: return print(self.indexOf(self.widget(self.indexTab))) self.parent.TABINDEX = self.indexOf(self.widget(self.indexTab)) def dragLeaveEvent(self,e): e.accept() def dropEvent(self, e): print(self.parent.TABINDEX) if e.source().parentWidget() == self: return e.setDropAction(Qt.MoveAction) e.accept() counter = self.count() if counter == 0: self.addTab(e.source().parentWidget().widget(self.parent.TABINDEX),e.source().tabText(self.parent.TABINDEX)) else: self.insertTab(counter + 1 ,e.source().parentWidget().widget(self.parent.TABINDEX),e.source().tabText(self.parent.TABINDEX)) class Window(QWidget): def __init__(self): super().__init__() self.TABINDEX = 0 tabWidgetOne = Tabs(self) tabWidgetTwo = Tabs(self) layout = QHBoxLayout() self.moveWidget = None layout.addWidget(tabWidgetOne) layout.addWidget(tabWidgetTwo) self.setLayout(layout) if __name__ == '__main__': app = QApplication(sys.argv) window = Window() window.show() sys.exit(app.exec_())
    • UNSOLVED Layout each tab in QTabBar
      General and Desktop • layout qtabwidget qtabbar tabs • • freddy311082  

      6
      0
      Votes
      6
      Posts
      3806
      Views

      @Paul-Colby Yes paaul, it doesn't work for me neither any other advise ? regards
    • UNSOLVED Several dock-related questions
      Tools • qtabwidget qdockwidget • • Speeder  

      4
      0
      Votes
      4
      Posts
      1179
      Views

      QDockWidget and QMainWindow are tied. That doesn't prevent you to use another QMainWindow as a central widget for your QMainWindow even though that would be a bit strange. Note that if you only want to work with dock widgets nothing forbids you to not use any central widget.
    • UNSOLVED QTabWidget - reorder Tabs with the designer
      General and Desktop • qtabwidget • • Andy314  

      1
      0
      Votes
      1
      Posts
      516
      Views

      No one has replied

    • UNSOLVED [SOLVED] QTabWidget tabName and qplaintextedit::textChanged() signal problem
      General and Desktop • qstring qtabwidget qplaintextedit • • takoo  

      31
      0
      Votes
      31
      Posts
      7054
      Views

      @mrjj that is right :D
    • SOLVED Background color of QToolBox pages inside a QTabWidget in Windows 7
      General and Desktop • stylesheet qtabwidget windows 7 qtoolbox • • kzarog  

      15
      0
      Votes
      15
      Posts
      6496
      Views

      Do this for the widgets inside the ToolBox: widget->setBackgroundRole(QPalette::Base);
    • UNSOLVED QTabWidget, Signal & Slot
      General and Desktop • c++ signal & slot qtabwidget • • Xavier59  

      13
      0
      Votes
      13
      Posts
      4413
      Views

      In that case why not add a spinner or busy indicator and show the widget directly ? It will at least remove the feeling that your application is stuck.
    • UNSOLVED CSS padding inside QTabWidget tabs hiding text
      General and Desktop • qtabwidget css qtabbar • • drdydx  

      6
      0
      Votes
      6
      Posts
      1832
      Views

      @Chris-Kawa Maybe you can ping @AndyS again so we can take a look on it. I had no time for it to think about an own patch.
    • SOLVED QTabWidget's border on Windows 7
      General and Desktop • qtabwidget windows 7 border • • YuriQ  

      4
      0
      Votes
      4
      Posts
      1358
      Views

      @maximus Yes, I decided not to do it.
    • [Solved] QTabWidgets: I can't remove one tab
      General and Desktop • qtabwidget tabs remove • • Alberto  

      6
      0
      Votes
      6
      Posts
      2032
      Views

      To be precise: click the gear, choose 'Edit' en put the string [Solved] in front of the title of your post
    • [Resuelto] QTabWidget esconder una pestaña
      Spanish • qtabwidget tabs • • Alberto  

      2
      0
      Votes
      2
      Posts
      1646
      Views

      Resuelto. El problema era que cuando hace el primer remove los indices cambian, así que cuando elimino el indice 1 los indices pasan de ser 0,1,2 a ser 0,1. El segundo remove intenta eliminar el indice 2 pero este dejó de existir cuando hace el primer remove. Así que la solución es esta: Partes::Partes(QWidget *parent) : QDialog(parent), ui(new Ui::Partes) { ui->setupUi(this); ui->Pestanas->setCurrentIndex(0); ui->Pestanas->removeTab(1); ui->Pestanas->removeTab(1); } Or: Partes::Partes(QWidget *parent) : QDialog(parent), ui(new Ui::Partes) { ui->setupUi(this); ui->Pestanas->setCurrentIndex(0); ui->Pestanas->removeTab(2); ui->Pestanas->removeTab(1); } Como puedo marcar este post como resuelto?
    • [SOLVED] How To Style Tab Background on Mac OSX
      General and Desktop • stylesheet qtabwidget qss qtabbar • • maximo  

      2
      0
      Votes
      2
      Posts
      1684
      Views

      The solution is an undocumented trick: QTabBar { background-color: transparent; qproperty-drawBase:0; } This lets you make the dark grey area (called the "tab bar base") as transparent. Or, alternatively, you can style it by changing the background-color value to a color.
    • [SOLVED] Synchronizing tab ordering with button ordering
      General and Desktop • layout qtabwidget qtabbar • • Jakob  

      4
      0
      Votes
      4
      Posts
      990
      Views

      Great ! Thanks for sharing your solution :)
    • [SOLVED] Adding QMenubar under every tab of QTabWidget
      General and Desktop • python qtabwidget qmenubar • • Streakflash  

      6
      0
      Votes
      6
      Posts
      1809
      Views

      @Streakflash Yeah I agree. But a lot of stuff is not really possible from Designer. Sadly.
    • QTabBar: Getting list of indexes of visible tabs
      General and Desktop • qwidget qtabwidget qtabbar • • Zee_07  

      5
      0
      Votes
      5
      Posts
      2632
      Views

      Thanks mrjj and Chris Kawa for your valuable response. Actually I want to create my own customized scroll-button for tabBar with either end button( two buttons like << and >> including qt already provided scroll-buttons < and >) So that we can directly go to the fist or last tab. In Qt scroll-button for Qtabbar provides only step forward or backward functionality means we can scroll only one tab at a time. Suppose my QTabBar contains 100 tab and currently visible tabs are 55,56,and 57 and if we want to go on first then we have to click approx 49 times or stay in clicked state for few seconds. if you guys have any approach for doing this efficiently then please. It would be highly appreciated.
    • QtCreator Designer change tab order
      General and Desktop • qtcreator qtabwidget • • Andy314139  

      4
      0
      Votes
      4
      Posts
      4073
      Views

      @Andy314139 yeah the xml file is annoying. awful design. Use shift+f4 to switch between edit and UI , works so much better.
    • QTableWidget inside QTabWidget not resizing when window is maximized.
      General and Desktop • qtablewidget qtabwidget • • Chrisw01  

      3
      0
      Votes
      3
      Posts
      1677
      Views

      Yes, both vertical and horizontal types.