[Interest] Skip over disabled items in listview and gridview when navigating with up/down/left/right arrows

Rogers Nate nate.rogers at raymondcorp.com
Mon Mar 17 16:08:00 CET 2014


I tried to override the flags function in the model but the function never gets called, it never printed out my debug statement or hit my break point.  Not sure what to do here...

Qt::ItemFlags MessageList::flags(const QModelIndex &index) const
{
    qDebug() << "Flags [" << index << "]: " << index.flags();

    return index.flags();
}

Nate


On 03/17/2014 08:26 AM, Scott Aron Bloom wrote:
Overload and customize the flags method in the model.

You can set enabled/ editable/selectable/dragable etc

Scott

From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org<mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org> [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On Behalf Of Rogers Nate
Sent: Thursday, March 13, 2014 7:14 AM
To: interest at qt-project.org<mailto:interest at qt-project.org>
Subject: [Interest] Skip over disabled items in listview and gridview when navigating with up/down/left/right arrows


I am using listview and gridview in my qml application that has navigation using the up/down/left/right arrows. When I disable a tile/button in my listview or gridview I want the user to not be able to select the tile and that works, however if the user is navigating with the arrows the cell can still receive focus (the button doesn't receive focus but the item does on some level, not sure how). What I want to happen is if a tile is disabled and the user uses a arrow to navigate to that tile it just skips over the disabled tile and goes to the next tile that is enabled. What is the best way to do this? Thanks!

Nate

Confidentiality Notice: The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is not authorized and may be unlawful.



Confidentiality Notice:

The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is 
not authorized and may be unlawful.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140317/3c14b1b3/attachment.html>


More information about the Interest mailing list