Changeset 8fe9bd2 for src


Ignore:
Timestamp:
01/20/10 23:04:12 (13 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
be9c036
Parents:
4693fa6
Message:

group items (time/track/...) are expanded on single-click

Location:
src/mvc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/treeview.cpp

    r4693fa6 r8fe9bd2  
    1515    : QTreeView(aParent)
    1616{
     17    connect(this, SIGNAL(clicked(QModelIndex)), SLOT(handleItemClicked(QModelIndex)));
    1718}
    1819
     
    124125}
    125126
     127void TreeView::handleItemClicked(const QModelIndex &index)
     128{
     129    if(!index.parent().isValid()) // time-group
     130    {
     131        if(isExpanded(index))
     132            setExpanded(index, false);
     133        else
     134            setExpanded(index, true);
     135    }
     136}
     137
  • src/mvc/treeview.h

    r4693fa6 r8fe9bd2  
    1313    void mouseReleaseEvent(QMouseEvent *aEvent);
    1414    bool testForControlClicked(const QModelIndex &aIndex, const QPoint &aPoint);
     15private slots:
     16    void handleItemClicked(const QModelIndex &index);
    1517signals:
    1618    void requestForMap(const QModelIndex &aIndex);
Note: See TracChangeset for help on using the changeset viewer.