GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
QGoLineageViewDockWidget.cxx
Go to the documentation of this file.
1 /*=========================================================================
2  Authors: The GoFigure Dev. Team.
3  at Megason Lab, Systems biology, Harvard Medical school, 2009-11
4 
5  Copyright (c) 2009-11, President and Fellows of Harvard College.
6  All rights reserved.
7 
8  Redistribution and use in source and binary forms, with or without
9  modification, are permitted provided that the following conditions are met:
10 
11  Redistributions of source code must retain the above copyright notice,
12  this list of conditions and the following disclaimer.
13  Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16  Neither the name of the President and Fellows of Harvard College
17  nor the names of its contributors may be used to endorse or promote
18  products derived from this software without specific prior written
19  permission.
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
25  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 
33 =========================================================================*/
35 
36 #include <iostream>
37 #include <QVBoxLayout>
38 #include <QAction>
39 
40 //-------------------------------------------------------------------------
42  QWidget *iParent) : QGoDockWidget(iParent)
43 {
44  this->SetUpUi();
45  QIcon Lineageicon;
46  Lineageicon.addPixmap(QPixmap( QString::fromUtf8(":/fig/LineageView.png") ),
47  QIcon::Normal, QIcon::Off);
48  this->m_ToggleAction->setIcon(Lineageicon);
49  this->m_ToggleAction->setToolTip("Lineage View");
50  this->setWindowTitle("Lineage View");
51 
52 
53  // color code
54  QObject::connect( this->m_depthLineage, SIGNAL( toggled(bool) ),
55  this, SLOT( ColorCodeLineagesByDepth(bool) ) );
56  QObject::connect( this->m_real, SIGNAL( toggled(bool) ),
57  this, SLOT( ColorCodeLineagesByOriginalColor(bool) ) );
58 }
59 
60 //-------------------------------------------------------------------------
61 
62 //-------------------------------------------------------------------------
65 {
66 }
67 
68 //-------------------------------------------------------------------------
69 
70 //-------------------------------------------------------------------------
71 void
73 {
74  if ( iChecked )
75  {
76  emit ChangeDivisionsColorCode("DepthInformation");
77  }
78 }
79 
80 //-------------------------------------------------------------------------
81 
82 //-------------------------------------------------------------------------
83 void
85 {
86  if ( iChecked )
87  {
88  emit ChangeDivisionsColorCode("Original");
89  }
90 }
91 
92 //-------------------------------------------------------------------------
93 
94 //-------------------------------------------------------------------------
96 {
97  QWidget* LineageViewWidget = new QWidget;
98 
99  this->m_depthLineage = new QRadioButton(tr("Depth Color Code") );
100  this->m_real = new QRadioButton(tr("Original Color") );
101  this->m_real->setChecked(true);
102 
103  QVBoxLayout* VLayout = new QVBoxLayout;
104  VLayout->addWidget(this->m_real);
105  VLayout->addWidget(this->m_depthLineage);
106 
107  LineageViewWidget->setLayout(VLayout);
108  this->setWidget(LineageViewWidget);
109  LineageViewWidget->setSizePolicy(
110  QSizePolicy::Expanding, QSizePolicy::Fixed);
111 
112 }
QGoLineageViewDockWidget(QWidget *iParent=0)
void setIcon(const QIcon &icon)
QString tr(const char *sourceText, const char *disambiguation, int n)
void setToolTip(const QString &tip)
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QString fromUtf8(const char *str, int size)
void setLayout(QLayout *layout)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
QAction * m_ToggleAction
Definition: QGoDockWidget.h:58
void setSizePolicy(QSizePolicy)
void setWidget(QWidget *widget)
void setChecked(bool)
void setWindowTitle(const QString &)
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
inherits from Qt QDockWidget.toggle action reimplemented in order the state is saved when changing ta...
Definition: QGoDockWidget.h:47
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void ChangeDivisionsColorCode(const QString &)