Reply
Thread Tools
Posts: 13 | Thanked: 2 times | Joined on Sep 2009
#1
Hello,

I'm using python + qt + maemo 5 sdk to develop a very simple test application.

I'm using Qt designer, to basically create small widget which consists of a scrollarea + label and a pushbutton.

So after I finished creating this widget in designer I ran:
pyside-uic main.ui -o ui.py

I then import this form main.py, and it displays my spiffy widget.

The problem is no matter what I do, I can't make the label scroll.

the portion of ui.py of interest looks like this:
Form.setObjectName("Form")
Form.resize(540, 396)
Form.setSizeIncrement(QtCore.QSize(0, 0))
Form.setAutoFillBackground(True)
self.scrollArea = QtGui.QScrollArea(Form)
self.scrollArea.setGeometry(QtCore.QRect(170, 80, 120, 80))
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtGui.QWidget(self.scrollArea)
self.scrollAreaWidgetContents.setGeometry(QtCore.Q Rect(0, 0, 118, 78))
self.scrollAreaWidgetContents.setObjectName("scrol lAreaWidgetContents")
self.label = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label.setGeometry(QtCore.QRect(20, 10, 61, 51))
self.label.setObjectName("label")
self.scrollArea.setWidget(self.scrollAreaWidgetCon tents)


Any help would be appreciated.
 
caco3's Avatar
Posts: 560 | Thanked: 423 times | Joined on May 2010 @ Switzerland
#2
Hi irooniam

Could you find a solution for it?
I have the same problem
I am using Python with PyQt
I do not even know how to add a QScrollArea as it is missing in my Qt Designer.
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#3
Originally Posted by irooniam View Post
the portion of ui.py of interest looks like this:
Form.setObjectName("Form")
Form.resize(540, 396)
Form.setSizeIncrement(QtCore.QSize(0, 0))
Form.setAutoFillBackground(True)
self.scrollArea = QtGui.QScrollArea(Form)
self.scrollArea.setGeometry(QtCore.QRect(170, 80, 120, 80))
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.scrollAreaWidgetContents = QtGui.QWidget(self.scrollArea)
self.scrollAreaWidgetContents.setGeometry(QtCore.Q Rect(0, 0, 118, 78))
self.scrollAreaWidgetContents.setObjectName("scrol lAreaWidgetContents")
self.label = QtGui.QLabel(self.scrollAreaWidgetContents)
self.label.setGeometry(QtCore.QRect(20, 10, 61, 51))
self.label.setObjectName("label")
self.scrollArea.setWidget(self.scrollAreaWidgetCon tents)
You've set the geometry of the scrollAreaWidgetContents QWidget as smaller than that of the QScrollArea, so there's no need to scroll. Try increasing the width/height of the QWidget (you may even need to use setMinimumSize - I'm not sure whether Qt would decide to shrink it to fit anyway).
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:21.