maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   qt qgraphicsscene and kinetic scrolling (https://talk.maemo.org/showthread.php?t=44224)

hopbeat 2010-02-12 09:09

qt qgraphicsscene and kinetic scrolling
 
Hello,

I have a problem with QListWidget that I embed in QGraphicsScene.
I try:

Code:

listWidget = new QListWidget();
QAbstractKineticScroller *scroller;
scroller = listWidget->property("kineticScroller").value<QAbstractKineticScroller *>();
scroller->setEnabled(true);
new QListWidgetItem("something", listWidget);
scene->addWidget(listWidget);

The list shows, but there are two problems:
-kinetic scrolling doesn't work (using scrollbar neither). Only using keys works.
-items are highlighted (and signals emitted) only on double press.

Any idea what may be wrong? And how this should be done?[/LIST]

krk969 2010-02-12 09:58

Re: qt qgraphicsscene and kinetic scrolling
 
hopbeat

by default most qt widgets have kinetic scrolling enabled by default that includes qlistwidget. this is qt4.6

you wouldnt need to implement an abstractscroller for that purpose.

what version do you use ?

hopbeat 2010-02-12 10:42

Re: qt qgraphicsscene and kinetic scrolling
 
@krk969, I have 4.6.2 20100128.
Yes, I know that this scrolling should be enabled by default, but it isn't. Adding scroller doesn't fix this.

There is QGraphicsView above this that handles mouse events. Maybe this interferes?

krk969 2010-02-12 11:10

Re: qt qgraphicsscene and kinetic scrolling
 
Quote:

Originally Posted by hopbeat (Post 522753)
@krk969, I have 4.6.2 20100128.
Yes, I know that this scrolling should be enabled by default, but it isn't. Adding scroller doesn't fix this.

There is QGraphicsView above this that handles mouse events. Maybe this interferes?

yeah not sure, as on its own listwidtget and graphicsview they support the kinetic scrolling by default.
if that embedding is interfering, will have to try it out to say anything.:confused:

maxximuscool 2010-02-12 11:15

Re: qt qgraphicsscene and kinetic scrolling
 
when will this awesome qt4.6 be integrated into N900? I can't wait to use all apps in Portrait mode with more eye candy UI

krk969 2010-02-12 11:28

Re: qt qgraphicsscene and kinetic scrolling
 
Quote:

Originally Posted by maxximuscool (Post 522781)
when will this awesome qt4.6 be integrated into N900? I can't wait to use all apps in Portrait mode with more eye candy UI

there are apps using 4.6 available in extras-devel.
but thats how far it will go, they have blocked it for extras-testing as QT4.6 is still under development and so stays in extras-devel.

So, if you dont mind that risk , you can still have the fun ;)

jsa 2010-02-12 11:42

Re: qt qgraphicsscene and kinetic scrolling
 
Quote:

Originally Posted by hopbeat (Post 522640)
Any idea what may be wrong? And how this should be done?

I'm not sure, but could this be related to your situation? http://bugreports.qt.nokia.com/browse/QTBUG-7761

Quote:

Originally Posted by maxximuscool (Post 522781)
when will this awesome qt4.6 be integrated into N900? I can't wait to use all apps in Portrait mode with more eye candy UI

Qt 4.6 won't have any effect to the built-in applications, because they're GTK+/Hildon. It also won't automatically make existing Qt applications spin between portrait and landspace or have any whizzbang animations unless the developers have made it so.

hopbeat 2010-02-12 14:23

Re: qt qgraphicsscene and kinetic scrolling
 
Setting:

Code:

QGraphicsView::mouseReleaseEvent(event);
event->ignore();
return;

and mousePressEvent, mouseReleaseEvent in proper mouse handlers for the context where I want the list to receive events doest fix the problem.

Sasler 2010-02-12 15:47

Re: qt qgraphicsscene and kinetic scrolling
 
Have you tried to add a Dynamic Property called FingerScrollable (bool) to it?


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

vBulletin® Version 3.8.8