maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   FingerScrollable in Qt 4.6 (https://talk.maemo.org/showthread.php?t=52991)

Khertan 2010-05-18 18:13

FingerScrollable in Qt 4.6
 
Hi,

I m currently trying to fix the issue that come with qt4.6.

The context: i start the dev of a new texteditor using qt4.5 and pyqt. At the moment i have a really simple editor, in qt4.5 the fingerscrollable was working. Since i update to qt4.6 and last pyqt this doesn't work anymore.

I just use a qtextedit in a qframe. From what i understand from qt bug tracker it s not a bug to not have fingerscrollable QTextEdit widget but a feature ...

Maybe someone can help me ?

source are on http://gitorious.org/khteditor/
(the qtextedit is located in editor.py)

Other question : why my toolbar button isn t working too ?
(located in editor_window.py)

Thx a lot,

gri 2010-05-18 18:59

Re: FingerScrollable in Qt 4.6
 
If you were using c++, you could use code of the imtk project. It looks like it supports kinetic scroll areas where you can put widgets inside.

http://gitorious.org/imtk/imtk/blobs...c/scrollarea.h

slobodsky 2010-05-18 19:20

Re: FingerScrollable in Qt 4.6
 
I don't care about Maemo-related bugs from April 15th, because most of them have roots in buggy Qt 4.6.2. If they'll stay here after PR1.2, then I'll fix or work around them.

Anyway I can neither consider my applications stable nor promote it to extras-testing before it.

aspidites 2010-05-18 19:24

Re: FingerScrollable in Qt 4.6
 
Toolbar works fine for me. I'm playing with the code right now, but I think there are some parenting issues going on.

[edit]
As per platform notes kinetic scrolling is implemented in all widgets that inherit from QAbstractKineticScroller

Have to head to work, else I'd whip up a patch for you.

Khertan 2010-05-18 21:06

Re: FingerScrollable in Qt 4.6
 
Hi i see your gitourious patch ...

Thx

Khertan 2010-05-18 21:09

Re: FingerScrollable in Qt 4.6
 
What make me fear about the future of the use of Qt for things other than fart apps is things like that ...

http://bugreports.qt.nokia.com/brows...mment-tabpanel

Venemo 2010-05-18 21:15

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by Khertan (Post 664867)
What make me fear about the future of the use of Qt for things other than fart apps is things like that ...

http://bugreports.qt.nokia.com/brows...mment-tabpanel

What's the problem with that?
It seems to me that they answered the bug politely and handled the issue according to the specifications.

FingerScrollable works for me with the controls that it is intended to work with.

Khertan 2010-05-18 21:27

Re: FingerScrollable in Qt 4.6
 
http://bugreports.qt.nokia.com/browse/QTBUG-10792

Khertan 2010-05-18 21:32

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by Venemo (Post 664878)
What's the problem with that?
It seems to me that they answered the bug politely and handled the issue according to the specifications.

FingerScrollable works for me with the controls that it is intended to work with.

It s working for you ? are you using Qt 4.6 ?

I didn't understand ...they answer that not having a fingerscrollable QTextEdit is a feature ... i didn't found that very polite as it was a working under 4.5 ... why removing it ...

This is like saying that user doesn't have to see files extensions so we remove it from all gtk dialog without letting dev to choose ... yeah right ... but one stupid case ... for a texteditor, oh i choose from my folder source.py or source.pyo ... you just see source and source :)

The case seems similar to me ... but maybe i didn't understand well ...

aspidites 2010-05-19 00:34

Re: FingerScrollable in Qt 4.6
 
reading the documentation it seems the feature is available through inheritance and is just disabled by default. busy now but will look into this later

attila77 2010-05-19 05:46

Re: FingerScrollable in Qt 4.6
 
Well, the docs say:

QTextEdit and QPlainTextEdit are fully Maemo 5 style guide compliant. This means that these widgets will not show scrollbars, will not allow the user to select text and will not have kinetic scrolling enabled by default.

QAbstractKineticScroller *scroller = scrollArea->property("kineticScroller") .value<QAbstractKineticScroller *>();
if (scroller)
scroller->setEnabled(false);

Khertan, does this solve the issue ?

aspidites 2010-05-19 08:38

Re: FingerScrollable in Qt 4.6
 
From documentation:
"Qt for Maemo 5 already comes with two implementations for QAbstractScrollArea and QWebView, and those kinetic scrollers are automatically instantiated and attached to these widgets on creation.In the QAbstractScrollArea case, the kinetic scroller is initially disabled. However, for QAbstractItemView and QScrollArea derived classes it is enabled by default. You can obtain these automatically created objects via a dynamic property:"

The last three lines of code quoted by attilla are then given. Thought I would give the full context.

Khertan 2010-05-19 09:41

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by attila77 (Post 665330)
Well, the docs say:

QTextEdit and QPlainTextEdit are fully Maemo 5 style guide compliant. This means that these widgets will not show scrollbars, will not allow the user to select text and will not have kinetic scrolling enabled by default.

QAbstractKineticScroller *scroller = scrollArea->property("kineticScroller") .value<QAbstractKineticScroller *>();
if (scroller)
scroller->setEnabled(false);

Khertan, does this solve the issue ?

Hi !

i didn't found where this QAbstractKineticScroller class is located in PyQt ... it s doesn't seems to exist.

Any advice ? Or maybe it s something not supported yet in PyQt ?

aspidites 2010-05-19 09:52

Re: FingerScrollable in Qt 4.6
 
@Khertan: Couldn't find it in PyQt4, but it's in PySide. (QtGui)

Khertan 2010-05-19 11:05

Re: FingerScrollable in Qt 4.6
 
Hum ... i ll try to switch to pyside so :)

attila77 2010-05-19 11:12

Re: FingerScrollable in Qt 4.6
 
Oops. If it's not there, I might have overwritten it when migrating to git... I'll report back with details later.

Khertan 2010-05-19 11:13

Re: FingerScrollable in Qt 4.6
 
Fujin:~/MyDocs/Projects/khteditor$ python khteditor.py
Segmentation fault

switch to PySide :)

Khertan 2010-05-19 11:14

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by attila77 (Post 665849)
Oops. If it's not there, I might have overwritten it when migrating to git... I'll report back with details later.

Ah ok ... thx ...

aspidites 2010-05-19 19:17

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by Khertan (Post 665854)
Fujin:~/MyDocs/Projects/khteditor$ python khteditor.py
Segmentation fault

switch to PySide :)

PySide doesn't like super() (from what I've experimented with), so you'll have to do SuperClass.__init__(). For example, QMainWindow.__init__(parent)

Khertan 2010-05-20 17:42

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by aspidites (Post 666529)
PySide doesn't like super() (from what I've experimented with), so you'll have to do SuperClass.__init__(). For example, QMainWindow.__init__(parent)

Ok due to bug #226 it s not possible yet with pyside ...

It s works with the last PyQt4 binding available in extras-devel.

Thx to achipa who help me a lot ... in fact who found what s the problem was and give the solution :

qte = QtGui.QTextEdit()
scroller = qte.property("kineticScroller").toPyObject()
scroller.setEnabled(True)

aspidites 2010-05-20 19:17

Re: FingerScrollable in Qt 4.6
 
Cool.

BTW, 226 is a duplicate of 207, which has been fixed upstream.

Khertan 2010-05-20 19:50

Re: FingerScrollable in Qt 4.6
 
yep... ...

mece 2010-06-04 22:51

Re: FingerScrollable in Qt 4.6
 
Quote:

Originally Posted by Khertan (Post 668087)
Ok due to bug #226 it s not possible yet with pyside ...

It s works with the last PyQt4 binding available in extras-devel.

Thx to achipa who help me a lot ... in fact who found what s the problem was and give the solution :

qte = QtGui.QTextEdit()
scroller = qte.property("kineticScroller").toPyObject()
scroller.setEnabled(True)

That worked. I ran into an interesting problem though.
Appears that this does not work as it should on QPlainTextEdit()
When using that exact same method the scrolling is so sensitive that you only have to move your finger a few pixels to scroll from top to bottom of a pretty long list. Is this a bug or a feature?

Changed to QTextEdit and everything was peachy, so it's not really a problem for me now.

attila77 2010-06-05 07:10

Re: FingerScrollable in Qt 4.6
 
Probably a Qt bug, but if you take a look at the QAbstractKineticScroller object, you have methods for adjusting various scroll parameters.


All times are GMT. The time now is 02:47.

vBulletin® Version 3.8.8