qsplitter

QSplitter becoming undistinguishable between QWidget and QTabWidget

故事扮演 提交于 2020-06-24 06:16:29
问题 I am puting a QWidget and a QTabWidget next to each other in one horisontal splitter. And the splitter loses it's shape, you can know that there is a splitter only by hovering mouse on it. How to make it visible? Thanks. 回答1: Since the QSplitterHandle (which is what most people think of as the 'splitter') is derived from QWidget, you can add other widgets to it. Here is what I have done to solve this exact problem in the past: // Now add the line to the splitter handle // Note: index 0 handle

How to initialize the splitter handle position in Qt?

旧巷老猫 提交于 2020-01-14 07:37:06
问题 I want to initialize the splitter handle position like the following instead of in the middle. I cannot set it in the property. How to solve this? Thank you for your help. 回答1: You can use QSplitter::setSizes in this why to reposition the handle: ui->splitter->setSizes(QList<int>() << 100 << 200); 回答2: You should set the horizontal stretch for the two widgets in the splitter. For instance by setting the horizontal stretch of the left widget to 1 and the right widget to 2 , the right widget

Qt QSplitter and unresponsive GUI (cpu 100%)

☆樱花仙子☆ 提交于 2019-12-21 06:49:13
问题 I'm trying to implement the following layout |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| | | | | | | | QTABWIDGET | QGLWIDGET | | | | | | | |_______________|________________| | | | | | TEXTEDIT | |________________________________| Between the TabWidget and GLWidget the layout is governed by a QSplitter with horizontal orientation. Another QSplitter with vertical orientation is needed between the previous splitter and QTextEdit widget so that I can choose to hide the textedit. Currently my

PYQT QSplitter issue

a 夏天 提交于 2019-12-12 13:33:51
问题 I use QSplitter and I found out that the minumum width of a widget in the splitter is 32 pixels (and 23 pixels in height). Does anybody body knows how to change this default. In other words, you can't drag the splitter so that one of the widgets (assume that there are 2 widgets in the spllitter) in the spllitter will be less than 32 pixels in width. The code: class Example(QtGui.QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): self.resize(400,400)

QSplitter in two directions

强颜欢笑 提交于 2019-12-12 02:24:18
问题 I want to make an app that includes four widgets that are resizable using QSplitter. In this app I would like that all four widgets are resized when I resize the splitter. I realised this by having a horizontal splitter contain two vertical splitters. This way however the vertical splitting only concerns two widgets and not all four. Is there a way to to this "matrix" splitting? 回答1: Have you tried connecting the splitterMoved(int,int) signal of one to the moveSplitter(int,int) slot of the

How to remove QWidgets from QSplitter

与世无争的帅哥 提交于 2019-12-04 00:22:41
问题 In my app have a window splitted by a QSplitter, and I need to remove an widget. How can I do that? I can't find useful methods 回答1: Many things in Qt cannot be "traditionally" removed. Instead call hide() on it and destruct it. From QSplitter documentation: When you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again. 回答2: It's not clear to me if you want to preserve the widget and put it somewhere else, or if you want to

Qt - Making a Splitter Horizontal and Vertical at same time

北战南征 提交于 2019-12-03 17:44:19
问题 I have a QGridLayout with a QSplitter on it. In that QSplitter I have two elements with a splitter that lets me move the splitter from left to right. Fine, there it's fine. But then I want to add another splitter but that moves up to down. (I'll explain with an image.) So it's mostly having 2 splitters, one that moves left-to-right and other that moves up-to-down. I hope you understand. QGridLayout *layout = new QGridLayout(this); QSplitter *splitter = new QSplitter(); text1 = new

Qt - Making a Splitter Horizontal and Vertical at same time

天涯浪子 提交于 2019-12-03 06:31:35
I have a QGridLayout with a QSplitter on it. In that QSplitter I have two elements with a splitter that lets me move the splitter from left to right. Fine, there it's fine. But then I want to add another splitter but that moves up to down. (I'll explain with an image.) So it's mostly having 2 splitters, one that moves left-to-right and other that moves up-to-down. I hope you understand. QGridLayout *layout = new QGridLayout(this); QSplitter *splitter = new QSplitter(); text1 = new QPlainTextEdit(); text2 = new QPlainTextEdit(); splitter->addWidget(text1); splitter->addWidget(text2); text1-

How to remove QWidgets from QSplitter

拟墨画扇 提交于 2019-12-01 03:15:36
In my app have a window splitted by a QSplitter, and I need to remove an widget. How can I do that? I can't find useful methods Tuminoid Many things in Qt cannot be "traditionally" removed. Instead call hide() on it and destruct it. From QSplitter documentation: When you hide() a child its space will be distributed among the other children. It will be reinstated when you show() it again. It's not clear to me if you want to preserve the widget and put it somewhere else, or if you want to destroy the widget. Destroying the widget: If you can get a pointer to the widget, you can simply delete it.

How to manage QSplitter in Qt Designer

假装没事ソ 提交于 2019-11-29 05:27:47
When I press a button, I bring up a dialog where user select things and press 'Ok' at the end. I want a splitter in this dialog. Left pane will show tree and right will show something else. How do I do that right? From Qt example itself: QSplitter *splitter = new QSplitter(parent); QListView *listview = new QListView; QTreeView *treeview = new QTreeView; QTextEdit *textedit = new QTextEdit; splitter->addWidget(listview); splitter->addWidget(treeview); splitter->addWidget(textedit); So in this example, splitter is created without any dialog resource. If I have to create this way, that would