COPASI API  4.16.103
CQEFMListWidget.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 #include "CQEFMListWidget.h"
12 
14 
15 CQEFMListWidget::CQEFMListWidget(QWidget* parent, const char* name) :
16  QWidget(parent),
17  mpTask(NULL),
18  mpProxyModel(NULL),
19  mpFluxModeDM(NULL)
20 {
21  setObjectName(QString::fromUtf8(name));
22  setupUi(this);
23 
24  mpEFMTable->verticalHeader()->hide();
25  mpEFMTable->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
26  mpEFMTable->sortByColumn(COL_ROW_NUMBER, Qt::AscendingOrder);
27 
28  //Create Source Data Model.
29  mpFluxModeDM = new CQFluxModeDM(this);
30 
31  //Create the Proxy Model for sorting/filtering and set its properties.
33  mpProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
34  mpProxyModel->setFilterKeyColumn(-1);
35 
36  mpProxyModel->setSourceModel(mpFluxModeDM);
37 
38  //Set Model for the TableView
39  mpEFMTable->setModel(NULL);
40  mpEFMTable->setModel(mpProxyModel);
41  mpEFMTable->resizeColumnsToContents();
42 
43  connect(mpEditFilter, SIGNAL(textChanged(const QString &)), this, SLOT(slotFilterChanged()));
44 }
45 
47 {
48  // TODO Auto-generated destructor stub
50 }
51 
53 {
54  mpTask = pTask;
55 
57 
58  mpProxyModel->setSourceModel(mpFluxModeDM);
59 
60  //Set Model for the TableView
61  mpEFMTable->setModel(NULL);
62  mpEFMTable->setModel(mpProxyModel);
63  mpEFMTable->resizeColumnsToContents();
64 
65  return true;
66 }
67 
69 {
70  QRegExp regExp(mpEditFilter->text() , Qt::CaseInsensitive, QRegExp::RegExp);
71  mpProxyModel->setFilterRegExp(regExp);
72 }
#define pdelete(p)
Definition: copasi.h:215
void setTask(const CEFMTask *pTask)
virtual ~CQEFMListWidget()
CQFluxModeDM * mpFluxModeDM
CTSSATask * pTask
bool loadResult(const CEFMTask *pTask)
CQEFMListWidget(QWidget *parent=0, const char *name=0)
const CEFMTask * mpTask
virtual void slotFilterChanged()
CQSortFilterProxyModel * mpProxyModel
#define COL_ROW_NUMBER