|
a/src/qtgui/confgui/confgui.cpp |
|
b/src/qtgui/confgui/confgui.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: confgui.cpp,v 1.6 2007-10-07 20:22:55 dockes Exp $ (C) 2005 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: confgui.cpp,v 1.7 2007-10-09 11:08:17 dockes Exp $ (C) 2005 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
|
4 |
|
5 |
#include <stdio.h>
|
5 |
#include <stdio.h>
|
6 |
|
6 |
|
7 |
#include <qglobal.h>
|
7 |
#include <qglobal.h>
|
|
... |
|
... |
62 |
#include <list>
|
62 |
#include <list>
|
63 |
using std::list;
|
63 |
using std::list;
|
64 |
|
64 |
|
65 |
namespace confgui {
|
65 |
namespace confgui {
|
66 |
|
66 |
|
67 |
const static int spacing = 3;
|
67 |
const static int spacing = 4;
|
68 |
const static int margin = 6;
|
68 |
const static int margin = 6;
|
69 |
|
69 |
|
70 |
void ConfParamW::setValue(const QString& value)
|
70 |
void ConfParamW::setValue(const QString& value)
|
71 |
{
|
71 |
{
|
72 |
m_cflink->set(string((const char *)value.utf8()));
|
72 |
m_cflink->set(string((const char *)value.utf8()));
|
|
... |
|
... |
96 |
0, // Horizontal stretch
|
96 |
0, // Horizontal stretch
|
97 |
0, // Vertical stretch
|
97 |
0, // Vertical stretch
|
98 |
tl->sizePolicy().hasHeightForWidth() ) );
|
98 |
tl->sizePolicy().hasHeightForWidth() ) );
|
99 |
tl->setText(lbltxt);
|
99 |
tl->setText(lbltxt);
|
100 |
QToolTip::add(tl, tltptxt);
|
100 |
QToolTip::add(tl, tltptxt);
|
101 |
/* qt4 tl->setProperty("toolTip", tltptxt);*/
|
|
|
102 |
|
101 |
|
103 |
m_hl->addWidget(tl);
|
102 |
m_hl->addWidget(tl);
|
104 |
|
103 |
|
105 |
return true;
|
104 |
return true;
|
106 |
}
|
105 |
}
|
|
... |
|
... |
132 |
0, // Vertical stretch
|
131 |
0, // Vertical stretch
|
133 |
fr->sizePolicy().hasHeightForWidth() ) );
|
132 |
fr->sizePolicy().hasHeightForWidth() ) );
|
134 |
m_hl->addWidget(fr);
|
133 |
m_hl->addWidget(fr);
|
135 |
|
134 |
|
136 |
loadValue();
|
135 |
loadValue();
|
137 |
|
|
|
138 |
QObject::connect(m_sb, SIGNAL(valueChanged(int)),
|
136 |
QObject::connect(m_sb, SIGNAL(valueChanged(int)),
|
139 |
this, SLOT(setValue(int)));
|
137 |
this, SLOT(setValue(int)));
|
140 |
}
|
138 |
}
|
141 |
|
139 |
|
142 |
void ConfParamIntW::loadValue()
|
140 |
void ConfParamIntW::loadValue()
|
|
... |
|
... |
152 |
: ConfParamW(parent, cflink)
|
150 |
: ConfParamW(parent, cflink)
|
153 |
{
|
151 |
{
|
154 |
if (!createCommon(lbltxt, tltptxt))
|
152 |
if (!createCommon(lbltxt, tltptxt))
|
155 |
return;
|
153 |
return;
|
156 |
m_le = new QLineEdit(this);
|
154 |
m_le = new QLineEdit(this);
|
157 |
|
|
|
158 |
loadValue();
|
|
|
159 |
|
|
|
160 |
m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
155 |
m_le->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,
|
161 |
QSizePolicy::Fixed,
|
156 |
QSizePolicy::Fixed,
|
162 |
1, // Horizontal stretch
|
157 |
1, // Horizontal stretch
|
163 |
0, // Vertical stretch
|
158 |
0, // Vertical stretch
|
164 |
m_le->sizePolicy().hasHeightForWidth()));
|
159 |
m_le->sizePolicy().hasHeightForWidth()));
|
165 |
|
|
|
166 |
m_hl->addWidget(m_le);
|
160 |
m_hl->addWidget(m_le);
|
167 |
|
161 |
|
|
|
162 |
loadValue();
|
168 |
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
|
163 |
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
|
169 |
this, SLOT(setValue(const QString&)));
|
164 |
this, SLOT(setValue(const QString&)));
|
170 |
}
|
165 |
}
|
171 |
|
166 |
|
172 |
void ConfParamStrW::loadValue()
|
167 |
void ConfParamStrW::loadValue()
|
|
... |
|
... |
237 |
1, // Horizontal stretch
|
232 |
1, // Horizontal stretch
|
238 |
0, // Vertical stretch
|
233 |
0, // Vertical stretch
|
239 |
fr->sizePolicy().hasHeightForWidth()));
|
234 |
fr->sizePolicy().hasHeightForWidth()));
|
240 |
m_hl->addWidget(fr);
|
235 |
m_hl->addWidget(fr);
|
241 |
|
236 |
|
|
|
237 |
loadValue();
|
242 |
QObject::connect(m_cb, SIGNAL(toggled(bool)),
|
238 |
QObject::connect(m_cb, SIGNAL(toggled(bool)),
|
243 |
this, SLOT(setValue(bool)));
|
239 |
this, SLOT(setValue(bool)));
|
244 |
}
|
240 |
}
|
245 |
|
241 |
|
246 |
void ConfParamBoolW::loadValue()
|
242 |
void ConfParamBoolW::loadValue()
|
|
... |
|
... |
276 |
0, // Horizontal stretch
|
272 |
0, // Horizontal stretch
|
277 |
0, // Vertical stretch
|
273 |
0, // Vertical stretch
|
278 |
pb->sizePolicy().hasHeightForWidth()));
|
274 |
pb->sizePolicy().hasHeightForWidth()));
|
279 |
m_hl->addWidget(pb);
|
275 |
m_hl->addWidget(pb);
|
280 |
|
276 |
|
281 |
|
277 |
loadValue();
|
282 |
QObject::connect(pb, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
278 |
QObject::connect(pb, SIGNAL(clicked()), this, SLOT(showBrowserDialog()));
|
283 |
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
|
279 |
QObject::connect(m_le, SIGNAL(textChanged(const QString&)),
|
284 |
this, SLOT(setValue(const QString&)));
|
280 |
this, SLOT(setValue(const QString&)));
|
285 |
}
|
281 |
}
|
286 |
|
282 |
|