I have a strange problem with every singe QTreeView in my program. When the program starts, I can select items in the tree views without a problem. However, that changes once I click on an item in the treeview and drag the mouse while holding the mouse button pressed (so that the selection changes to the item that the mouse cursor is currently over every time you drag the mouse cursor over an entry). After doing this, then it is no longer possible to select items by clicking on them. It is only possible to select items by pressing the mouse button and dragging the cursor to the item you want selected.
Here is the constructor code from one of the QTreeViews :
ArticleList::ArticleList()
{
setRootIsDecorated( false );
setModel( model );
///Setup right click menu
downloadArticle
= new QAction( tr
( "Download article" ),
this );
connect( downloadArticle, SIGNAL( triggered() ), this, SLOT( downloadArticleSlot() ) );
menu->addAction( downloadArticle );
}
ArticleList::ArticleList()
{
setRootIsDecorated( false );
setEditTriggers(QAbstractItemView::NoEditTriggers);
model = new ArticleModel( QStringList(), this );
setModel( model );
setSelectionMode( QAbstractItemView::SingleSelection );
///Setup right click menu
downloadArticle = new QAction( tr( "Download article" ), this );
connect( downloadArticle, SIGNAL( triggered() ), this, SLOT( downloadArticleSlot() ) );
menu = new QMenu();
menu->addAction( downloadArticle );
}
To copy to clipboard, switch view to plain text mode
What could be causing this?
Bookmarks