TimeViewerEditAccumulateDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled
4  applications.
5 
6  TerraLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published by
8  the Free Software Foundation, either version 3 of the License,
9  or (at your option) any later version.
10 
11  TerraLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with TerraLib. See COPYING. If not, write to
18  TerraLib Team at <terralib-team@terralib.org>.
19  */
20 
21 /*!
22  \file terralib/timeviewer/TimeViewEditLegendDialog.cpp
23 
24  \brief A dialog used to edit legend.
25 */
26 
27 // TimeViewer
29 #include "ui_TimeViewerEditAccumulateDialog.h"
30 
31 // Qt
32 #include <QColorDialog>
33 #include <QDialogButtonBox>
34 #include <QFileDialog>
35 #include <QPainter>
36 
38  TimeViewerEditAccumulateDialog(QWidget* parent, Qt::WindowFlags f)
39  : QDialog(parent, f), m_ui(new Ui::TimeViewerEditAccumulateDialog)
40 {
41  m_ui->setupUi(this);
42 
43  connect(m_ui->m_selectColorPushButton, SIGNAL(clicked()), this, SLOT(onSelectColorPushButtonClicked()));
44  connect(m_ui->m_cancelPushButton, SIGNAL(clicked()), this, SLOT(onCancelPushButtonClicked()));
45  connect(m_ui->m_okPushButton, SIGNAL(clicked()), this, SLOT(onOkPushButtonClicked()));
46 }
47 
49 
51  QString accumColor)
52 {
53  m_accumColor = accumColor;
54 
55  m_ui->m_colorLabel->setStyleSheet("QLabel {background-color:" + m_accumColor + " ; }");
56 }
57 
59 {
60  return m_accumColor;
61 }
62 
64 {
65  QColor color = QColorDialog::getColor(Qt::yellow, this);
66  QString colcode;
67  QVariant variant;
68 
69  if(color.isValid())
70  {
71  variant = color;
72  colcode = variant.toString();
73  }
74 
75  return colcode;
76 }
77 
80 {
81  QString setColor = colorPick();
82 
83  if(!setColor.isEmpty())
84  {
85  m_accumColor = setColor;
86  m_ui->m_colorLabel->setStyleSheet("QLabel { background-color :" + m_accumColor + " ;}");
87  }
88 }
89 
92 {
93  reject();
94 }
95 
98 {
99  accept();
100 
101  emit okAccPushButtonClicked();
102 }
A dialog used to edit Accumulate Legend.
std::unique_ptr< Ui::TimeViewerEditAccumulateDialog > m_ui
Dialog form.
TimeViewerEditAccumulateDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic fill dialog which is a child of parent, with widget flags set to f...