Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc @ 7599

Last change on this file since 7599 was 7599, checked in by bensch, 18 years ago

qt_gui: more saveable

File size: 1.9 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
17
18#include "qt_gui_elements.h"
19
20namespace OrxGui
21{
22
23
24
25  QtGuiCheckBox::QtGuiCheckBox(const std::string& name, SaveableGroup* group, bool defaultValue)
26  : QCheckBox(QString().fromStdString(name)), Saveable(name, group)
27  {
28    //this->load(this->value());
29  }
30
31  void QtGuiCheckBox::load()
32  {
33    Saveable::load();
34    if (this->value().getBool())
35      this->setCheckState(Qt::Checked);
36    else
37      this->setCheckState(Qt::Unchecked);
38  }
39
40
41
42  void QtGuiCheckBox::save()
43  {
44    this->value() = this->checkState();
45    Saveable::save();
46  }
47
48
49
50
51
52  QtGuiSlider::QtGuiSlider(const std::string& name, SaveableGroup* group, Qt::Orientation orientation)
53  : QSlider(orientation), Saveable(name, group)
54  {
55
56  }
57
58  QtGuiSlider::~QtGuiSlider()
59  {}
60
61  void QtGuiSlider::load()
62  {
63    Saveable::load();
64    this->setValue(this->Saveable::value().getInt());
65  }
66
67  void QtGuiSlider::save()
68  {
69    this->Saveable::value() = this->QSlider::value();
70    Saveable::save();
71  }
72
73
74
75
76
77
78
79  QtGuiComboBox::QtGuiComboBox(const std::string& name, SaveableGroup* group)
80  : QComboBox(), Saveable(name, group)
81  {
82
83
84  }
85
86  void QtGuiComboBox::load()
87  {
88    //TODO
89  }
90
91  void QtGuiComboBox::save()
92  {
93  }
94
95
96  QtGuiInputLine::QtGuiInputLine(const std::string& name, SaveableGroup* group)
97  : QLineEdit(), Saveable(name, group)
98  {
99
100
101  }
102
103
104  void QtGuiInputLine::load()
105  {
106    this->setText(this->value().getString().c_str());
107  }
108
109
110
111  void QtGuiInputLine::save()
112  {
113  }
114
115
116
117
118}
Note: See TracBrowser for help on using the repository browser.