This is an example in python using PySide bindings dor Qt4.6:<br><br>from PySide.QtCore import *<br>from PySide.QtGui import *<br>from PySide.QtMaemo5 import *<br>import sys<br> <br>class StackedWindow(QMainWindow):<br> def __init__(self):<br>
QMainWindow.__init__(self)<br> # This attribute makes the whole Stacked Window thing work<br> self.setAttribute(Qt.WA_Maemo5StackedWindow)<br> # Create button and layout<br> self.cw = QWidget(self)<br>
# This is ugly, but otherwise widgets don't horizontally expand inside the ScrollArea<br> self.cw.setMinimumSize(800,0)<br> self.vbox = QVBoxLayout(self.cw)<br> self.button = QMaemo5ValueButton(self)<br>
self.button.setText(QString('Push me'))<br> self.button.setValueText(QString('I told you to push me!')) <br> self.vbox.addWidget(self.button)<br> self.label = QLabel(self)<br>
self.label.setText(QString('Long\nmultiline\nlabel.\n\n\n\n\nVeeery\nlong\nand\nvery\nmultiline\nlabel!'))<br> self.vbox.addWidget(self.label)<br> self.vbox.setSizeConstraint(QLayout.SetMinAndMaxSize)<br>
#Create a ScrollArea and put the container widget inside<br> <a href="http://self.sa">self.sa</a> = QScrollArea(self)<br> self.sa.setWidget(self.cw)<br> self.setCentralWidget(<a href="http://self.sa">self.sa</a>)<br>
# Connect button to signal<br> self.connect(self.button, SIGNAL("clicked()"), self.openSubWin)<br> <br> def openSubWin(self):<br> # Create subwindow<br> self.subWindow = SubWindow(self)<br>
self.subWindow.show() <br><br>class SubWindow(QMainWindow):<br> def __init__(self, parent):<br> # Notice that you must give a parent window as parameter to the constuctor<br> QMainWindow.__init__(self, parent)<br>
# Also set the Stacked Window parameter for every subwindow in the stack<br> self.setAttribute(Qt.WA_Maemo5StackedWindow)<br> # Just some content...<br> self.label = QLabel(self)<br> self.label.setText(QString("This is a second window in the stack"))<br>
self.setCentralWidget(self.label)<br><br>if __name__ == '__main__':<br> app = QApplication(sys.argv)<br> sw = StackedWindow()<br> sw.show()<br> sys.exit(app.exec_())<br><br><br><br><div class="gmail_quote">
On Sat, Mar 20, 2010 at 7:31 AM, Sascha Mäkelä <span dir="ltr"><<a href="mailto:sascha.makela@gmail.com">sascha.makela@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Yes I'm using that. I just don't know what "view" I should use. I've tried QScrollArea, QFrame, QWidget and also the QMainWindow, but nothing seems to work. I'm using successfully "FingerScrollable" in QListWidget. But I want a "frame" where I can have multiple object in it.<div>
<br></div><div>Thanks for you help anyway,</div><div>Sascha<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Sat, Mar 20, 2010 at 08:23, Timo Härkönen <span dir="ltr"><<a href="mailto:timop.harkonen@gmail.com" target="_blank">timop.harkonen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi<br><br><div class="gmail_quote">2010/3/19 Sascha Mäkelä <span dir="ltr"><<a href="mailto:sascha.makela@gmail.com" target="_blank">sascha.makela@gmail.com</a>></span><div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm trying to make a finger scrollable area which has many buttons and other widgets in it, because I cannot fit them on the screen. I have something similar in mind as in this video clip: <a href="http://labs.trolltech.com/blogs/?p=1480" target="_blank">http://labs.trolltech.com/blogs/?p=1480</a><div>
<br></div><div>Any idea how can I do it?</div><div><br></div></blockquote></div><div><br>You should be able to make scrollable views use kinetic scrolling by setting<br>setProperty("FingerScrollable", true) on them.<br>
<br>For more info see:<br><br><a href="http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling" target="_blank">http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling</a><br><a href="http://wiki.maemo.org/Qt/Finger_Scrolling" target="_blank">http://wiki.maemo.org/Qt/Finger_Scrolling</a><br>
<br>-Timo<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div></div><div>Cheers,</div><div>Sascha</div>
<br>_______________________________________________<br>
maemo-developers mailing list<br>
<a href="mailto:maemo-developers@maemo.org" target="_blank">maemo-developers@maemo.org</a><br>
<a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
<br></blockquote></div><br>
</blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
maemo-developers mailing list<br>
<a href="mailto:maemo-developers@maemo.org">maemo-developers@maemo.org</a><br>
<a href="https://lists.maemo.org/mailman/listinfo/maemo-developers" target="_blank">https://lists.maemo.org/mailman/listinfo/maemo-developers</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Luca Donaggio<br>