How to make a finger scrollable frame for widgets in Qt 4.5?

How to make a finger scrollable frame for widgets in Qt 4.5?

Sascha Makela
Karma: 368
2010-03-19 19:00 UTC
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:
http://labs.trolltech.com/blogs/?p=1480

Any idea how can I do it?

Cheers,
Sascha

  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Timo Härkönen
Karma: 294
2010-03-20 06:23 UTC
Hi

2010/3/19 Sascha Mäkelä <sascha.makela@gmail.com>

> 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:
> http://labs.trolltech.com/blogs/?p=1480
>
> Any idea how can I do it?
>
>
You should be able to make scrollable views use kinetic scrolling by setting
setProperty("FingerScrollable", true) on them.

For more info see:

http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling
http://wiki.maemo.org/Qt/Finger_Scrolling

-Timo


> Cheers,
> Sascha
>
>
>

  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Sascha Makela
Karma: 368
2010-03-20 06:31 UTC
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.

Thanks for you help anyway,
Sascha

On Sat, Mar 20, 2010 at 08:23, Timo Härkönen <timop.harkonen@gmail.com>wrote:

> Hi
>
> 2010/3/19 Sascha Mäkelä <sascha.makela@gmail.com>
>
> 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:
>> http://labs.trolltech.com/blogs/?p=1480
>>
>> Any idea how can I do it?
>>
>>
> You should be able to make scrollable views use kinetic scrolling by
> setting
> setProperty("FingerScrollable", true) on them.
>
> For more info see:
>
> http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling
> http://wiki.maemo.org/Qt/Finger_Scrolling
>
> -Timo
>
>
>> Cheers,
>> Sascha
>>
>>
>>
>

  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Luca Donaggio
Karma: 290
2010-03-22 10:26 UTC
This is an example in python using PySide bindings dor Qt4.6:

from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtMaemo5 import *
import sys

class StackedWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
# This attribute makes the whole Stacked Window thing work
self.setAttribute(Qt.WA_Maemo5StackedWindow)
# Create button and layout
self.cw = QWidget(self)
# This is ugly, but otherwise widgets don't horizontally expand
inside the ScrollArea
self.cw.setMinimumSize(800,0)
self.vbox = QVBoxLayout(self.cw)
self.button = QMaemo5ValueButton(self)
self.button.setText(QString('Push me'))
self.button.setValueText(QString('I told you to push me!'))
self.vbox.addWidget(self.button)
self.label = QLabel(self)

self.label.setText(QString('Long\nmultiline\nlabel.\n\n\n\n\nVeeery\nlong\nand\nvery\nmultiline\nlabel!'))
self.vbox.addWidget(self.label)
self.vbox.setSizeConstraint(QLayout.SetMinAndMaxSize)
#Create a ScrollArea and put the container widget inside
self.sa = QScrollArea(self)
self.sa.setWidget(self.cw)
self.setCentralWidget(self.sa)
# Connect button to signal
self.connect(self.button, SIGNAL("clicked()"), self.openSubWin)

def openSubWin(self):
# Create subwindow
self.subWindow = SubWindow(self)
self.subWindow.show()

class SubWindow(QMainWindow):
def __init__(self, parent):
# Notice that you must give a parent window as parameter to the
constuctor
QMainWindow.__init__(self, parent)
# Also set the Stacked Window parameter for every subwindow in the
stack
self.setAttribute(Qt.WA_Maemo5StackedWindow)
# Just some content...
self.label = QLabel(self)
self.label.setText(QString("This is a second window in the stack"))
self.setCentralWidget(self.label)

if __name__ == '__main__':
app = QApplication(sys.argv)
sw = StackedWindow()
sw.show()
sys.exit(app.exec_())



On Sat, Mar 20, 2010 at 7:31 AM, Sascha Mäkelä <sascha.makela@gmail.com>wrote:

> 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.
>
> Thanks for you help anyway,
> Sascha
>
>
> On Sat, Mar 20, 2010 at 08:23, Timo Härkönen <timop.harkonen@gmail.com>wrote:
>
>> Hi
>>
>> 2010/3/19 Sascha Mäkelä <sascha.makela@gmail.com>
>>
>> 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:
>>> http://labs.trolltech.com/blogs/?p=1480
>>>
>>> Any idea how can I do it?
>>>
>>>
>> You should be able to make scrollable views use kinetic scrolling by
>> setting
>> setProperty("FingerScrollable", true) on them.
>>
>> For more info see:
>>
>> http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling
>> http://wiki.maemo.org/Qt/Finger_Scrolling
>>
>> -Timo
>>
>>
>>> Cheers,
>>> Sascha
>>>
>>>
>>>
>>
>
>
>


--
Luca Donaggio

  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Sascha Makela
Karma: 368
2010-03-22 11:40 UTC
Thanks, but I'm using C++ and I don't know Python. But I think you are
using QScrollArea. I've tried that too, but it didn't work. I'm using Qt
Creator 1.3.82 (or 81, I can't remember exactly). I hope Qt 4.6 will correct
this issue.

Cheers,
Sascha


On Mon, Mar 22, 2010 at 12:26, Luca Donaggio <donaggio@gmail.com> wrote:

> This is an example in python using PySide bindings dor Qt4.6:
>
> from PySide.QtCore import *
> from PySide.QtGui import *
> from PySide.QtMaemo5 import *
> import sys
>
> class StackedWindow(QMainWindow):
> def __init__(self):
> QMainWindow.__init__(self)
> # This attribute makes the whole Stacked Window thing work
> self.setAttribute(Qt.WA_Maemo5StackedWindow)
> # Create button and layout
> self.cw = QWidget(self)
> # This is ugly, but otherwise widgets don't horizontally expand
> inside the ScrollArea
> self.cw.setMinimumSize(800,0)
> self.vbox = QVBoxLayout(self.cw)
> self.button = QMaemo5ValueButton(self)
> self.button.setText(QString('Push me'))
> self.button.setValueText(QString('I told you to push me!'))
> self.vbox.addWidget(self.button)
> self.label = QLabel(self)
>
> self.label.setText(QString('Long\nmultiline\nlabel.\n\n\n\n\nVeeery\nlong\nand\nvery\nmultiline\nlabel!'))
> self.vbox.addWidget(self.label)
> self.vbox.setSizeConstraint(QLayout.SetMinAndMaxSize)
> #Create a ScrollArea and put the container widget inside
> self.sa = QScrollArea(self)
> self.sa.setWidget(self.cw)
> self.setCentralWidget(self.sa)
> # Connect button to signal
> self.connect(self.button, SIGNAL("clicked()"), self.openSubWin)
>
> def openSubWin(self):
> # Create subwindow
> self.subWindow = SubWindow(self)
> self.subWindow.show()
>
> class SubWindow(QMainWindow):
> def __init__(self, parent):
> # Notice that you must give a parent window as parameter to the
> constuctor
> QMainWindow.__init__(self, parent)
> # Also set the Stacked Window parameter for every subwindow in the
> stack
> self.setAttribute(Qt.WA_Maemo5StackedWindow)
> # Just some content...
> self.label = QLabel(self)
> self.label.setText(QString("This is a second window in the stack"))
> self.setCentralWidget(self.label)
>
> if __name__ == '__main__':
> app = QApplication(sys.argv)
> sw = StackedWindow()
> sw.show()
> sys.exit(app.exec_())
>
>
>
>
> On Sat, Mar 20, 2010 at 7:31 AM, Sascha Mäkelä <sascha.makela@gmail.com>wrote:
>
>> 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.
>>
>> Thanks for you help anyway,
>> Sascha
>>
>>
>> On Sat, Mar 20, 2010 at 08:23, Timo Härkönen <timop.harkonen@gmail.com>wrote:
>>
>>> Hi
>>>
>>> 2010/3/19 Sascha Mäkelä <sascha.makela@gmail.com>
>>>
>>> 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:
>>>> http://labs.trolltech.com/blogs/?p=1480
>>>>
>>>> Any idea how can I do it?
>>>>
>>>>
>>> You should be able to make scrollable views use kinetic scrolling by
>>> setting
>>> setProperty("FingerScrollable", true) on them.
>>>
>>> For more info see:
>>>
>>> http://wiki.maemo.org/Qt4_Hildon#Kinetic_scrolling
>>> http://wiki.maemo.org/Qt/Finger_Scrolling
>>>
>>> -Timo
>>>
>>>
>>>> Cheers,
>>>> Sascha
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>
>
> --
> Luca Donaggio
>

  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Ville Vainio
Karma: 292
2010-03-22 12:16 UTC
On Mon, Mar 22, 2010 at 1:40 PM, Sascha Mäkelä <sascha.makela@gmail.com> wrote:
> Thanks, but I'm using C++ and I don't know Python. But I think you are
> using QScrollArea. I've tried that too, but it didn't work. I'm using Qt
> Creator 1.3.82 (or 81, I can't remember exactly). I hope Qt 4.6 will correct
> this issue.

Yeah, Qt 4.6 provides "free" kinetic scrolling for scroll areas. Qt
4.5 on Maemo is a relic.

--
Ville M. Vainio
http://tinyurl.com/vainio
  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Marcin Juszkiewicz
Karma: 599
2010-03-22 12:29 UTC
Dnia poniedziałek, 22 marca 2010 o 13:16:11 Ville M. Vainio napisał(a):
> Yeah, Qt 4.6 provides "free" kinetic scrolling for scroll areas. Qt
> 4.5 on Maemo is a relic.

But 4.5 is still the version which all users have available.

Qt 4.6 will land in rootfs when nokia will release PR 1.2 firmware, but this
can be November 2010 ;(

Regards,
--
JID: hrw@jabber.org
Website: http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz


  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Ville Vainio
Karma: 292
2010-03-22 12:38 UTC
On Mon, Mar 22, 2010 at 2:29 PM, Marcin Juszkiewicz
<marcin@juszkiewicz.com.pl> wrote:

>> Yeah, Qt 4.6 provides "free" kinetic scrolling for scroll areas. Qt
>> 4.5 on Maemo is a relic.
>
> But 4.5 is still the version which all users have available.
>
> Qt 4.6 will land in rootfs when nokia will release PR 1.2 firmware, but this
> can be November 2010 ;(

While nobody has officially said anything about PR1.2 timing,
everything seems to indicate that it's going to happen pretty soon:

http://talk.maemo.org/showthread.php?t=42285

--
Ville M. Vainio
http://tinyurl.com/vainio
  •  Reply

Re: How to make a finger scrollable frame for widgets in Qt 4.5?

Marcin Juszkiewicz
Karma: 599
2010-03-22 12:49 UTC
Dnia poniedziałek, 22 marca 2010 o 13:38:14 Ville M. Vainio napisał(a):
> > Qt 4.6 will land in rootfs when nokia will release PR 1.2 firmware, but
> > this can be November 2010 ;(
>
> While nobody has officially said anything about PR1.2 timing,
> everything seems to indicate that it's going to happen pretty soon:
>
> http://talk.maemo.org/showthread.php?t=42285

Yeah, users...

So far @nokia people gave so many "release on next week" type of messages that
November 2010 is as good assumption as any other.

Regards,
--
JID: hrw@jabber.org
Website: http://marcin.juszkiewicz.com.pl/
LinkedIn: http://www.linkedin.com/in/marcinjuszkiewicz


  •  Reply