27 int group,
int param) :
QObject() {
33 p_fileButton =
new QToolButton();
34 p_lineEdit =
new QLineEdit();
36 p_label =
new QLabel(p_name);
37 p_label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
38 p_label->setToolTip(p_ui->ParamBrief(group, param));
39 grid->addWidget(p_label, param, 0, Qt::AlignTop);
42 whatsThis = (QString)(
"<b>Parameter:</b> " + p_ui->ParamName(group, param));
43 whatsThis += (QString)(
"<p><b>Type:</b> " + p_ui->ParamType(group, param) +
"</p>");
44 whatsThis += (QString)(
"<p><b>Brief:</b> " + p_ui->ParamBrief(group, param) +
"</p>");
45 QString def = p_ui->ParamDefault(group, param);
46 if(def ==
"") def =
"None";
47 whatsThis +=
"<p><b>Default: </b>" + QString(def) +
"</p>";
48 QString intdef = p_ui->ParamInternalDefault(group, param);
50 whatsThis +=
"<p><b>Internal Default: </b> " + QString(intdef) +
"</p>";
52 QString pixtype = p_ui->PixelType(group, param);
54 whatsThis +=
"<p><b>Pixel Type: </b> " + QString(pixtype) +
"</p>";
56 QString pmin = p_ui->ParamMinimum(group, param);
58 if(p_ui->ParamMinimumInclusive(group, param) ==
"YES") {
59 whatsThis +=
"<p><b>Greater Than Or Equal To: </b>" +
60 QString(pmin) +
"</p>";
63 whatsThis +=
"<p><b>Greater Than: </b>" + QString(pmin) +
"</p>";
66 QString pmax = p_ui->ParamMaximum(group, param);
68 if(p_ui->ParamMaximumInclusive(group, param) ==
"YES") {
69 whatsThis +=
"<p><b>Less Than Or Equal To: </b>" +
70 QString(pmax) +
"</p>";
73 whatsThis +=
"<p><b>Less Than: </b>" + QString(pmax) +
"</p>";
76 if(p_ui->ParamLessThanSize(group, param) > 0) {
77 whatsThis +=
"<p><b>Less Than: </b>" +
78 QString(p_ui->ParamLessThan(group, param, 0));
79 for(
int l = 1; l < p_ui->ParamLessThanSize(group, param); l++) {
80 whatsThis +=
", " + QString(p_ui->ParamLessThan(group, param, l));
84 if(p_ui->ParamLessThanOrEqualSize(group, param) > 0) {
85 whatsThis +=
"<p><b>Less Than Or Equal: </b>" +
86 QString(p_ui->ParamLessThanOrEqual(group, param, 0));
87 for(
int l = 1; l < p_ui->ParamLessThanOrEqualSize(group, param); l++) {
89 QString(p_ui->ParamLessThanOrEqual(group, param, l));
93 if(p_ui->ParamNotEqualSize(group, param) > 0) {
94 whatsThis +=
"<p><b>Not Equal: </b>" +
95 QString(p_ui->ParamNotEqual(group, param, 0));
96 for(
int l = 1; l < p_ui->ParamNotEqualSize(group, param); l++) {
97 whatsThis +=
", " + QString(p_ui->ParamNotEqual(group, param, l));
101 if(p_ui->ParamGreaterThanSize(group, param) > 0) {
102 whatsThis +=
"<p><b>Greater Than: </b>" +
103 QString(p_ui->ParamGreaterThan(group, param, 0));
104 for(
int l = 1; l < p_ui->ParamGreaterThanSize(group, param); l++) {
106 QString(p_ui->ParamGreaterThan(group, param, l));
110 if(p_ui->ParamGreaterThanOrEqualSize(group, param) > 0) {
111 whatsThis +=
"<p><b>Greater Than Or Equal: </b>" +
112 QString(p_ui->ParamGreaterThanOrEqual(group, param, 0));
113 for(
int l = 1; l < p_ui->ParamGreaterThanOrEqualSize(group, param); l++) {
115 QString(p_ui->ParamGreaterThanOrEqual(group, param, l));
119 if(p_ui->ParamIncludeSize(group, param) > 0) {
120 whatsThis +=
"<p><b>Inclusions: </b>" +
121 QString(p_ui->ParamInclude(group, param, 0));
122 for(
int l = 1; l < p_ui->ParamIncludeSize(group, param); l++) {
124 QString(p_ui->ParamInclude(group, param, l));
128 if(p_ui->ParamExcludeSize(group, param) > 0) {
129 whatsThis +=
"<p><b>Exclusions: </b>" +
130 QString(p_ui->ParamExclude(group, param, 0));
131 for(
int l = 1; l < p_ui->ParamExcludeSize(group, param); l++) {
133 QString(p_ui->ParamExclude(group, param, l));
137 if(p_ui->ParamOdd(group, param) !=
"") {
138 whatsThis +=
"<p><b>Odd: </b>" +
139 QString(p_ui->ParamOdd(group, param)) +
"</p>";
141 p_label->setWhatsThis(whatsThis);
261 if(p_ui->HelpersSize(p_group, p_param) == 1) {
264 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
265 QString file = FileName(
266 p_ui->HelperIcon(p_group, p_param, 0)).expanded();
267 action->setIcon(QIcon(QPixmap(file)));
270 action->setText(p_ui->HelperButtonName(p_group, p_param, 0));
272 action->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
273 QString helperText =
"<p><b>Function:</b> " +
274 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>";
275 action->setWhatsThis(helperText);
276 connect(action, SIGNAL(trigger(
const QString &)),
this,
277 SIGNAL(HelperTrigger(
const QString &)));
279 QToolButton *helper =
new QToolButton();
280 helper->setText(p_ui->HelperButtonName(p_group, p_param, 0));
281 helper->setDefaultAction(action);
283 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
285 QString file = FileName(
286 p_ui->HelperIcon(p_group, p_param, 0)).expanded();
287 helper->setIconSize(QSize(22, 22));
288 helper->setIcon(QIcon(QPixmap(file)));
291 helper->setFixedWidth(helper->fontMetrics().horizontalAdvance(
292 " " + helper->text() +
" "));
301 throw IException(IException::Programmer,
302 "Can not call GuiParameter::AddHelpers twice",
306 p_helperMenu =
new QMenu();
311 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
312 QString file = FileName(
313 p_ui->HelperIcon(p_group, p_param, 0)).expanded();
314 action->setIcon(QIcon(QPixmap(file)));
317 action->setText(p_ui->HelperButtonName(p_group, p_param, 0));
319 connect(action, SIGNAL(trigger(
const QString &)),
this,
320 SIGNAL(HelperTrigger(
const QString &)));
323 QToolButton *helper =
new QToolButton();
324 helper->setText(p_ui->HelperButtonName(p_group, p_param, 0));
326 helper->setMenu(p_helperMenu);
327 helper->setPopupMode(QToolButton::MenuButtonPopup);
328 helper->setDefaultAction(action);
329 helper->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
330 QString text =
"<p><b>Function:</b> " +
331 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>" +
332 "<p><b>Hint: </b> Click on the arrow to see more helper functions</p>";
333 helper->setWhatsThis(text);
335 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
337 QString file = FileName(
338 p_ui->HelperIcon(p_group, p_param, 0)).expanded();
339 helper->setIconSize(QSize(22, 22));
340 helper->setIcon(QIcon(QPixmap(file)));
343 helper->setFixedWidth(helper->fontMetrics().horizontalAdvance(
344 " " + helper->text() +
" "));
350 action2->setText(p_ui->HelperBrief(p_group, p_param, 0));
351 action2->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
352 QString helperText =
"<p><b>Function:</b> " +
353 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>";
354 action2->setWhatsThis(helperText);
355 connect(action2, SIGNAL(trigger(
const QString &)),
this,
356 SIGNAL(HelperTrigger(
const QString &)));
357 p_helperMenu->addAction(action2);
361 for(
int i = 1; i < p_ui->HelpersSize(p_group, p_param); i++) {
364 helperAction->setText(p_ui->HelperBrief(p_group, p_param, i));
365 helperAction->setToolTip(p_ui->HelperBrief(p_group, p_param, i));
366 QString helperText =
"<p><b>Function:</b> " +
367 QString(p_ui->HelperDescription(p_group, p_param, i)) +
"</p>";
368 helperAction->setWhatsThis(helperText);
369 connect(helperAction, SIGNAL(trigger(
const QString &)),
this,
370 SIGNAL(HelperTrigger(
const QString &)));
371 p_helperMenu->addAction(helperAction);