×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    QListWidget: selectedItems array never populates

    Hi Folks,
    I have a very strange issue: I have a List Widget, where I have linked the itemClicked slot to a signal. If I click an item, the _item parameter is perfect.

    However, if I have an item selected, and the user opens the menu and enables the function below, the selection array is empty even if the list item is drawn as selected:
    Code:
    	if(ui.LstEntries->selectedItems().count()==0)
    	{
    		QMessageBox x(this);
    		x.setText("No item is selected!");
    		x.setIcon(QMessageBox::Warning);			
    		x.exec();
    		return;
    	}
    ...
    Ideas, anyone?
    Last edited by divanov; 2010-07-14 at 21:40. Reason: fixing CODE tag
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QListWidget: selectedItems array never populates

    Great snippet. Could you provide small test application reproducing the problem?

  3. #3
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: QListWidget: selectedItems array never populates

    Hi divanov,
    I have to apologize for the delayed response. Let me explain again.

    I have a QListWidget on my form, which is set up in icon mode. Whenever I select an item, the selectedItems() array remains empty. On the phone, a rectandle is drawn around it - but the array remains empty.

    The only time when the selectedItems() array is populated, is when the item is being actively tapped.

    All the best
    Tam Hanna
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

Similar Threads

  1. QListWidget with CheckBox
    By damodharan in forum Qt
    Replies: 3
    Last Post: 2010-04-25, 09:47
  2. Compilation array in Double Pointer Array.
    By SymbianTH in forum Open C/C++
    Replies: 3
    Last Post: 2009-09-29, 10:23
  3. Difference between array of pointes and pointer to an array
    By Pradeep Chandra in forum Open C/C++
    Replies: 2
    Last Post: 2008-09-15, 13:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×