All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
WellKnownMarkDialog.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 applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/widgets/se/WellKnownMarkDialog.cpp
22 
23  \brief A dialog used to build a well known mark element.
24 */
25 
26 // TerraLib
27 #include "ui_WellKnownMarkDialogForm.h"
28 #include "WellKnownMarkDialog.h"
29 #include "WellKnownMarkWidget.h"
30 
32  : QDialog(parent, f),
33  m_ui(new Ui::WellKnownMarkDialogForm)
34 {
35  m_ui->setupUi(this);
36 
37  // Mark Widget
39 
40  // Adjusting...
41  QGridLayout* layout = new QGridLayout(m_ui->m_markWidgetFrame);
42  layout->addWidget(m_markWidget);
43 }
44 
46 {
47 }
48 
49 te::se::Mark* te::qt::widgets::WellKnownMarkDialog::getMark(const te::se::Mark* initial, QWidget* parent, const QString& title)
50 {
51  WellKnownMarkDialog dlg(parent);
52 
53  if(!title.isEmpty())
54  dlg.setWindowTitle(title);
55 
56  if(initial)
57  dlg.m_markWidget->setMark(initial);
58 
59  if(dlg.exec() == QDialog::Accepted)
60  return dlg.getMark();
61 
62  return 0;
63 }
64 
66 {
67  return m_markWidget->getMark();
68 }
A widget used to build a well known mark element.
te::qt::widgets::WellKnownMarkWidget * m_markWidget
Well Known Mark Widget used to configure the mak element.
A Mark specifies a geometric shape and applies coloring to it.
Definition: Mark.h:84
std::auto_ptr< Ui::WellKnownMarkDialogForm > m_ui
Dialog form.
static te::se::Mark * getMark(const te::se::Mark *initial, QWidget *parent=0, const QString &title="")
Pops up a modal mark dialog with the given window title, lets the user configure the mark...
void setMark(const te::se::Mark *mark)
Sets a mark element to this widget.
A dialog used to build a well known mark element.
te::se::Mark * getMark() const
Gets the configured mark element.
A widget used to build a well known mark element.
WellKnownMarkDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a well known mark dialog which is a child of parent, with widget flags set to f...
A dialog used to build a well known mark element. If you want to use this dialog, you can use command...