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)

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)


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

vBulletin® Version 3.8.8