PyQt布局问题:QScrollView和QGridLayout? [英] PyQt layout question: QScrollView and QGridLayout?

查看:91
本文介绍了PyQt布局问题:QScrollView和QGridLayout?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Zaurus 5500 PDA的小屏幕上的QApplication(PyQt)我试图在QScrollView中将我的数据输出布局为中央小部件。我希望
更喜欢使用QGridLayout,但无法将其添加到滚动视图中。


sc = QScrollView(self)

layout = QGridLayout(...,sc.viewport())

sc.addChild(布局)

导致TypeError。


有没有办法让它发挥作用?填充框视口有很多

填充框和白色空间标签来建立网格非常麻烦。我需要4种不同的布局来换位。


祝你好运

Volker


-

Volker Lenhardt

电子邮件: vo*************@uni-duisburg-essen.de

For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I
try to layout my data output in a QScrollView as the central widget. I''d
prefer to use QGridLayout, but cannot add it to the scroll view.

sc=QScrollView(self)
layout=QGridLayout(..., sc.viewport())
sc.addChild(layout)

results in a TypeError.

Is there a way to get it to work? Filling a box viewport with lots of
padding boxes and white space labels to establish grids is very
cumbersome. And I need 4 different layouts to change places.

Best wishes
Volker

--
Volker Lenhardt
E-Mail: vo*************@uni-duisburg-essen.de

推荐答案

周四17 2005年11月2:56,Volker Lenhardt写道:
On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote:
对于我的Zaurus 5500 PDA的小屏幕上的QApplication(PyQt)我试图在QScrollView中布置我的数据输出作为中央部件。我会更喜欢使用QGridLayout,但不能将它添加到滚动视图中。

sc = QScrollView(self)
layout = QGridLayout(...,sc。 viewport())
sc.addChild(布局)

导致TypeError。

有没有办法让它工作?填充具有大量填充框和白色空间标签的框视口以建立网格是非常麻烦的。我需要4种不同的布局来改变位置。
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I
try to layout my data output in a QScrollView as the central widget. I''d
prefer to use QGridLayout, but cannot add it to the scroll view.

sc=QScrollView(self)
layout=QGridLayout(..., sc.viewport())
sc.addChild(layout)

results in a TypeError.

Is there a way to get it to work? Filling a box viewport with lots of
padding boxes and white space labels to establish grids is very
cumbersome. And I need 4 different layouts to change places.




QGridLayout不是QWidget的子类,这就是addChild()是什么$ b $期待。你可能想要QGrid。


Phil



QGridLayout is not a sub-class of QWidget, which is what addChild() is
expecting. You probably want QGrid.

Phil


2005年11月17日星期四下午2:56,Volker Lenhardt写道:
On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote:
对于我的Zaurus 5500 PDA的小屏幕上的QApplication(PyQt),我尝试在QScrollView中将我的数据输出布局为中央小部件。我会更喜欢使用QGridLayout,但不能将它添加到滚动视图中。

sc = QScrollView(self)
layout = QGridLayout(...,sc。 viewport())
sc.addChild(布局)

导致TypeError。

有没有办法让它工作?填充具有大量填充框和白色空间标签的框视口以建立网格是非常麻烦的。我需要4种不同的布局来改变位置。
For a QApplication (PyQt) on the small screen of my Zaurus 5500 PDA I
try to layout my data output in a QScrollView as the central widget. I''d
prefer to use QGridLayout, but cannot add it to the scroll view.

sc=QScrollView(self)
layout=QGridLayout(..., sc.viewport())
sc.addChild(layout)

results in a TypeError.

Is there a way to get it to work? Filling a box viewport with lots of
padding boxes and white space labels to establish grids is very
cumbersome. And I need 4 different layouts to change places.




QGridLayout不是QWidget的子类,这就是addChild()是什么$ b $期待。你可能想要QGrid。


Phil



QGridLayout is not a sub-class of QWidget, which is what addChild() is
expecting. You probably want QGrid.

Phil


Phil Thompson schrieb:
Phil Thompson schrieb:
2005年11月17日星期四下午2:56,Volker Lenhardt写道:
On Thursday 17 November 2005 2:56 pm, Volker Lenhardt wrote:
更喜欢使用QGridLayout,但无法将其添加到滚动视图中。

sc = QScrollView(self)
layout = QGridLayout(...,sc.viewport())
sc.addChild(布局)
导致TypeError。

有没有让它发挥作用的一种方法?填充具有大量填充框和白色空间标签的框视口以建立网格是非常麻烦的。我需要4种不同的布局来改变位置。
prefer to use QGridLayout, but cannot add it to the scroll view.

sc=QScrollView(self)
layout=QGridLayout(..., sc.viewport())
sc.addChild(layout)

results in a TypeError.

Is there a way to get it to work? Filling a box viewport with lots of
padding boxes and white space labels to establish grids is very
cumbersome. And I need 4 different layouts to change places.



QGridLayout不是QWidget的子类,这是addChild()所期望的。你可能想要QGrid。

Phil


QGridLayout is not a sub-class of QWidget, which is what addChild() is
expecting. You probably want QGrid.

Phil




我希望找到一个更确定的答案。在QGrid中没有MultiCellWidget,没有

Col / RowStretching,没有Col / RowSpacing。我必须用一大堆QV / QHBox和QGrids修补一个

VBox,更不用说

空格QLabel来填充未使用的网格单元格。


我必须删除所有这些以更改为另一种数据布局。


你确定没有办法在

的帮助下填写QScrollView一些QLayout?


仍然希望

Volker



I hoped to find a more assuring answer. There''s no MultiCellWidget, no
Col/RowStretching, no Col/RowSpacing in QGrid. I''ve got to patch up one
VBox with a whole bunch of QV/QHBoxes and QGrids not to mention the
white space QLabels to fill not used grid cells.

And I have to delete all of them to change to another data layout.

Are you sure that there''s no way to fill a QScrollView with the help of
some QLayout?

Still hopefully
Volker


这篇关于PyQt布局问题:QScrollView和QGridLayout?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆