COPASI API  4.16.103
CQBrowserPane.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQBrowserPane.cpp,v $
3 // $Revision: 1.1 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/09/13 19:22:00 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 #include "CQBrowserPane.h"
15 
16 #include "listviews.h"
17 
18 CQBrowserPane::CQBrowserPane(QWidget* parent) :
19  QTreeView(parent)
20 {
21  QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
22  sizePolicy.setHorizontalStretch(0);
23  sizePolicy.setVerticalStretch(0);
24  sizePolicy.setHeightForWidth(this->sizePolicy().hasHeightForWidth());
25  setSizePolicy(sizePolicy);
26  setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
27  setAutoScroll(true);
28  setEditTriggers(QAbstractItemView::NoEditTriggers);
29  setTextElideMode(Qt::ElideNone);
30  setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
31  setUniformRowHeights(true);
32  setSortingEnabled(true);
33  setHeaderHidden(true);
34 
35  connect(this, SIGNAL(expanded(const QModelIndex &)), this, SLOT(slotUpdateScrollBar(const QModelIndex &)));
36  connect(this, SIGNAL(collapsed(const QModelIndex &)), this, SLOT(slotUpdateScrollBar(const QModelIndex &)));
37 }
38 
39 // virtual
41 {}
42 
43 // virtual
44 void CQBrowserPane::currentChanged(const QModelIndex & current, const QModelIndex & /* previous */)
45 {
46  static_cast< ListViews * >(parent())->slotFolderChanged(current);
47 }
48 
49 void CQBrowserPane::slotUpdateScrollBar(const QModelIndex & index)
50 {
51  resizeColumnToContents(index.column());
52 }
virtual ~CQBrowserPane()
void slotUpdateScrollBar(const QModelIndex &index)
virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous)
CQBrowserPane(QWidget *parent=0)