dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
baseview.cpp
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #include "baseview.h"
29 
30 #include <QWidget>
31 
32 using namespace Core;
33 
34 BaseView::BaseView(QObject *parent)
35  : IView(parent)
36  , m_viewName("")
37  , m_widget(nullptr)
38  , m_context(QList<int>())
39  , m_defaultPosition(IView::First)
40 {
41 }
42 
44 {
45  delete m_widget;
46 }
47 
49 {
50  return m_context;
51 }
52 
53 QWidget *BaseView::widget()
54 {
55  return m_widget;
56 }
57 
58 const char *BaseView::uniqueViewName() const
59 {
60  return m_viewName;
61 }
62 
64 {
65  return m_defaultPosition;
66 }
67 
68 void BaseView::setUniqueViewName(const char *name)
69 {
70  m_viewName = name;
71 }
72 
73 QWidget *BaseView::setWidget(QWidget *widget)
74 {
75  QWidget *oldWidget = m_widget;
76  m_widget = widget;
77  return oldWidget;
78 }
79 
80 void BaseView::setContext(const QList<int> &context)
81 {
82  m_context = context;
83 }
84 
86 {
87  m_defaultPosition = position;
88 }
QWidget * widget()
Definition: baseview.cpp:53
IView::ViewPosition defaultPosition() const
Definition: baseview.cpp:63
QWidget * setWidget(QWidget *widget)
Definition: baseview.cpp:73
void setDefaultPosition(IView::ViewPosition position)
Definition: baseview.cpp:85
BaseView(QObject *parent=nullptr)
Definition: baseview.cpp:34
void setUniqueViewName(const char *name)
Definition: baseview.cpp:68
const char * uniqueViewName() const
Definition: baseview.cpp:58
ViewPosition
Definition: iview.h:41
QList< int > context() const
Definition: baseview.cpp:48
void setContext(const QList< int > &context)
Definition: baseview.cpp:80
Definition: icore.h:39