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);
247 if(p_ui->HelpersSize(p_group, p_param) == 1) {
250 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
252 p_ui->HelperIcon(p_group, p_param, 0)).
expanded();
253 action->setIcon(QIcon(QPixmap(file)));
256 action->setText(p_ui->HelperButtonName(p_group, p_param, 0));
258 action->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
259 QString helperText =
"<p><b>Function:</b> " +
260 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>";
261 action->setWhatsThis(helperText);
262 connect(action, SIGNAL(trigger(
const QString &)),
this,
263 SIGNAL(HelperTrigger(
const QString &)));
265 QToolButton *helper =
new QToolButton();
266 helper->setText(p_ui->HelperButtonName(p_group, p_param, 0));
267 helper->setDefaultAction(action);
269 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
272 p_ui->HelperIcon(p_group, p_param, 0)).
expanded();
273 helper->setIconSize(QSize(22, 22));
274 helper->setIcon(QIcon(QPixmap(file)));
277 helper->setFixedWidth(helper->fontMetrics().horizontalAdvance(
278 " " + helper->text() +
" "));
288 "Can not call GuiParameter::AddHelpers twice",
292 p_helperMenu =
new QMenu();
297 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
299 p_ui->HelperIcon(p_group, p_param, 0)).
expanded();
300 action->setIcon(QIcon(QPixmap(file)));
303 action->setText(p_ui->HelperButtonName(p_group, p_param, 0));
305 connect(action, SIGNAL(trigger(
const QString &)),
this,
306 SIGNAL(HelperTrigger(
const QString &)));
309 QToolButton *helper =
new QToolButton();
310 helper->setText(p_ui->HelperButtonName(p_group, p_param, 0));
312 helper->setMenu(p_helperMenu);
313 helper->setPopupMode(QToolButton::MenuButtonPopup);
314 helper->setDefaultAction(action);
315 helper->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
316 QString text =
"<p><b>Function:</b> " +
317 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>" +
318 "<p><b>Hint: </b> Click on the arrow to see more helper functions</p>";
319 helper->setWhatsThis(text);
321 if(p_ui->HelperIcon(p_group, p_param, 0) !=
"") {
324 p_ui->HelperIcon(p_group, p_param, 0)).
expanded();
325 helper->setIconSize(QSize(22, 22));
326 helper->setIcon(QIcon(QPixmap(file)));
329 helper->setFixedWidth(helper->fontMetrics().horizontalAdvance(
330 " " + helper->text() +
" "));
336 action2->setText(p_ui->HelperBrief(p_group, p_param, 0));
337 action2->setToolTip(p_ui->HelperBrief(p_group, p_param, 0));
338 QString helperText =
"<p><b>Function:</b> " +
339 QString(p_ui->HelperDescription(p_group, p_param, 0)) +
"</p>";
340 action2->setWhatsThis(helperText);
341 connect(action2, SIGNAL(trigger(
const QString &)),
this,
342 SIGNAL(HelperTrigger(
const QString &)));
343 p_helperMenu->addAction(action2);
347 for(
int i = 1; i < p_ui->HelpersSize(p_group, p_param); i++) {
350 helperAction->setText(p_ui->HelperBrief(p_group, p_param, i));
351 helperAction->setToolTip(p_ui->HelperBrief(p_group, p_param, i));
352 QString helperText =
"<p><b>Function:</b> " +
353 QString(p_ui->HelperDescription(p_group, p_param, i)) +
"</p>";
354 helperAction->setWhatsThis(helperText);
355 connect(helperAction, SIGNAL(trigger(
const QString &)),
this,
356 SIGNAL(HelperTrigger(
const QString &)));
357 p_helperMenu->addAction(helperAction);