maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   QListWidget: Scrolling selects the item. (https://talk.maemo.org/showthread.php?t=78983)

ongte 2011-10-13 08:46

QListWidget: Scrolling selects the item.
 
I'm using QT Creator, I am writing an app for my N900 to learn QT. I have a QListWidget that needs to finger scroll, but it seems every time I scroll, the current selection changes to the item my finger landed on to start scrolling. After I scroll, the highlight jumps back to the original item I had selected, but the selectedItem value stays at the item my finger landed on. This forces me to re-select the item after every scroll.
I saw a post about setProperty("FingerScrollable", true), but this does not help, It still behaves the same way.

This is really driving me nuts. How do I fix this?

kif 2011-10-15 21:05

Re: QListWidget: Scrolling selects the item.
 
I have had the same problem in my ftp application,

In my case the program would open subfolders when you tried to scroll, highly infuriating.

I have 3 columns, so in my case I could limit the open folder function to the first column, not a great solution, and probably not one you can use.

Kim

jackburton 2011-10-16 02:43

Re: QListWidget: Scrolling selects the item.
 
Quote:

Originally Posted by ongte (Post 1108063)

This is really driving me nuts. How do I fix this?

I am also learning QT. Which signals are you connecting to in the list? Perhaps if you can post a code snippet that will help.

ongte 2011-10-21 07:03

Re: QListWidget: Scrolling selects the item.
 
Here's the code I have problems with:

Code:

selectList->connect(selectList, SIGNAL(currentRowChanged(int)), this, SLOT(ChangeEffect()));

void MainWindow::ChangeEffect()
{
    soundfile = playItems.at(selectList->currentRow());
    player->setMedia(QUrl::fromLocalFile(soundfile));
}

I went from the signal itemSelectionChanged to itemChanged to currentRowChanged they all behave the same way, the currentRow changes when I scroll.

MohammadAG 2011-10-21 16:26

Re: QListWidget: Scrolling selects the item.
 
Use itemActivated

ongte 2011-10-25 08:37

Re: QListWidget: Scrolling selects the item.
 
I tried the itemActivated signal, it's working great now. Thanks. :)

I'm also having trouble generating the source deb file from the Build -> Publish Project..
The process seems to complete fine, but I can't find the source deb anywhere. Is this function actually working?


All times are GMT. The time now is 07:21.

vBulletin® Version 3.8.8