All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BasicStrokeDialog.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2011-2012 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/BasicStrokeDialog.cpp
22 
23  \brief A dialog used to build a basic stroke element.
24 */
25 
26 // TerraLib
27 #include "BasicStrokeDialog.h"
28 #include "BasicStrokeWidget.h"
29 #include "ui_BasicStrokeDialogForm.h"
30 
31 te::qt::widgets::BasicStrokeDialog::BasicStrokeDialog(QWidget* parent, Qt::WindowFlags f)
32  : QDialog(parent, f),
33  m_ui(new Ui::BasicStrokeDialogForm)
34 {
35  m_ui->setupUi(this);
36 
37  // Stroke Widget
39 
40  // Adjusting...
41  QGridLayout* layout = new QGridLayout(m_ui->m_strokeWidgetFrame);
42  layout->addWidget(m_strokeWidget);
43 }
44 
46 {
47 }
48 
49 te::se::Stroke* te::qt::widgets::BasicStrokeDialog::getStroke(const te::se::Stroke* initial, QWidget* parent, const QString& title)
50 {
51  BasicStrokeDialog dlg(parent);
52 
53  if(!title.isEmpty())
54  dlg.setWindowTitle(title);
55 
56  if(initial)
57  dlg.m_strokeWidget->setStroke(initial);
58 
59  if(dlg.exec() == QDialog::Accepted)
60  return dlg.getStroke();
61 
62  return 0;
63 }
64 
66 {
67  return m_strokeWidget->getStroke();
68 }
A dialog used to build a basic stroke element. If you want to use this dialog, you can use commands l...
A widget used to build a basic stroke element.
std::auto_ptr< Ui::BasicStrokeDialogForm > m_ui
Dialog form.
A dialog used to build a basic stroke element.
A Stroke specifies the appearance of a linear geometry.
Definition: Stroke.h:67
void setStroke(const te::se::Stroke *stroke)
Sets a stroke element to this widget.
te::se::Stroke * getStroke() const
Gets the configured stroke element.
A widget used to build a basic stroke element.
te::qt::widgets::BasicStrokeWidget * m_strokeWidget
Basic Stroke Widget used to configure the stroke element.
static te::se::Stroke * getStroke(const te::se::Stroke *initial, QWidget *parent=0, const QString &title="")
Pops up a modal basic stroke dialog with the given window title, lets the user configure the stroke...
BasicStrokeDialog(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs a basic stroke dialog which is a child of parent, with widget flags set to f...