source: tspsg/src/settingsdialog.cpp @ ca9cb6dfa5

0.1.4.170-beta2-bb10
Last change on this file since ca9cb6dfa5 was 0cf220dc33, checked in by Oleksii Serdiuk, 12 years ago

Added scroll area to Output Tab in Settings Dialog on BlackBerry?.

This allows this tab to fit low height screen, like BlackBerry? Q10 has.

  • Property mode set to 100644
File size: 19.8 KB
Line 
1/*
2 *  TSPSG: TSP Solver and Generator
3 *  Copyright (C) 2007-2011 Lёppa <contacts[at]oleksii[dot]name>
4 *
5 *  $Id$
6 *  $URL$
7 *
8 *  This file is part of TSPSG.
9 *
10 *  TSPSG is free software: you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License as published by
12 *  the Free Software Foundation, either version 3 of the License, or
13 *  (at your option) any later version.
14 *
15 *  TSPSG is distributed in the hope that it will be useful,
16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 *  GNU General Public License for more details.
19 *
20 *  You should have received a copy of the GNU General Public License
21 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#include "settingsdialog.h"
25
26/*!
27 * \brief Class constructor.
28 * \param parent Settings Dialog parent widget.
29 *
30 * Initializes Settings Dialog and creates its layout based on target OS.
31 */
32SettingsDialog::SettingsDialog(QWidget *parent)
33    : QDialog(parent), _newFont(false), _newColor(false), _translucency(0)
34{
35    setupUi(this);
36
37    setWindowIcon(GET_ICON("preferences-system"));
38
39    buttonBox->button(QDialogButtonBox::Ok)->setIcon(GET_ICON("dialog-ok"));
40#ifndef QT_NO_STATUSTIP
41    buttonBox->button(QDialogButtonBox::Ok)->setStatusTip(tr("Save new preferences"));
42#endif
43    buttonBox->button(QDialogButtonBox::Ok)->setCursor(QCursor(Qt::PointingHandCursor));
44    buttonBox->button(QDialogButtonBox::Cancel)->setIcon(GET_ICON("dialog-cancel"));
45#ifndef QT_NO_STATUSTIP
46    buttonBox->button(QDialogButtonBox::Cancel)->setStatusTip(tr("Close without saving preferences"));
47#endif
48    buttonBox->button(QDialogButtonBox::Cancel)->setCursor(QCursor(Qt::PointingHandCursor));
49
50    buttonColor->setIcon(GET_ICON("format-text-color"));
51    buttonFont->setIcon(GET_ICON("preferences-desktop-font"));
52    buttonHelp->setIcon(GET_ICON("help-hint"));
53
54QPalette p = bgWhite->palette();
55    p.setColor(QPalette::Window, p.color(QPalette::Base));
56    bgWhite->setPalette(p);
57
58    p = lineHorizontal->palette();
59    p.setColor(QPalette::Window, p.color(QPalette::Text));
60    lineHorizontal->setPalette(p);
61
62// Layout helpers
63QBoxLayout *box;
64QHBoxLayout *hbox;
65#ifndef QT_NO_PRINTER
66    cbHQGraph = new QCheckBox(bgWhite);
67    cbHQGraph->setObjectName("cbHQGraph");
68#ifndef QT_NO_STATUSTIP
69    cbHQGraph->setStatusTip(tr("Higher quality graph looks much better when printing but uglier on the screen"));
70#endif // QT_NO_STATUSTIP
71    cbHQGraph->setText(tr("Draw solution graph in higher quality"));
72    cbHQGraph->setCursor(QCursor(Qt::PointingHandCursor));
73
74    box = qobject_cast<QBoxLayout *>(tabOutput->layout());
75    hbox = new QHBoxLayout();
76    hbox->addSpacing(10);
77    hbox->addWidget(cbHQGraph);
78    box->insertLayout(box->indexOf(cbGenerateGraph) + 2, hbox);
79    connect(cbGenerateGraph, SIGNAL(toggled(bool)), cbHQGraph, SLOT(setEnabled(bool)));
80#endif
81
82    if (hasUpdater()) {
83        cbCheck4Updates = new QCheckBox(bgWhite);
84        cbCheck4Updates->setObjectName("cbCheck4Updates");
85#ifndef QT_NO_STATUSTIP
86        cbCheck4Updates->setStatusTip(tr("Automatically check for updates at the given interval"));
87#endif // QT_NO_STATUSTIP
88        cbCheck4Updates->setText(tr("Check for updates every"));
89        cbCheck4Updates->setCursor(QCursor(Qt::PointingHandCursor));
90
91        spinUpdateCheckInterval = new QSpinBox(bgWhite);
92        spinUpdateCheckInterval->setObjectName("spinUpdateCheckInterval");
93#ifndef QT_NO_STATUSTIP
94        spinUpdateCheckInterval->setStatusTip(tr("Minimal interval at which to check for updates"));
95#endif // QT_NO_STATUSTIP
96        spinUpdateCheckInterval->setSuffix(tr(" days", "Don't forget a space at the beginning!"));
97        spinUpdateCheckInterval->setRange(1, 365);
98        spinUpdateCheckInterval->setCursor(QCursor(Qt::PointingHandCursor));
99
100        connect(cbCheck4Updates, SIGNAL(toggled(bool)), spinUpdateCheckInterval, SLOT(setEnabled(bool)));
101
102        box = static_cast<QBoxLayout *>(tabGeneral->layout());
103        hbox = new QHBoxLayout();
104        hbox->setSpacing(0);
105        hbox->addWidget(cbCheck4Updates);
106        hbox->addWidget(spinUpdateCheckInterval);
107        hbox->addStretch();
108        box->insertLayout(box->indexOf(cbUseNativeDialogs) + 1, hbox);
109    } else
110        cbCheck4Updates = NULL;
111
112#ifdef HANDHELD
113QVBoxLayout *vbox1; // Layout helper
114
115#ifdef Q_WS_WINCE_WM
116    // On screens with small height when SIP is shown and the window is resized
117    // there is not enought space for all elements.
118    // So we show the scrollbars to be able to access them.
119QScrollArea *scrollArea = new QScrollArea(this);
120    scrollArea->setFrameShape(QFrame::NoFrame);
121    scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
122    scrollArea->setWidgetResizable(true);
123    scrollArea->setWidget(bgWhite);
124#elif defined(Q_OS_BLACKBERRY)
125    QWidget *sac = new QWidget(this);
126    sac->setLayout(tabOutput->layout());
127    QScrollArea *sa = new QScrollArea(this);
128    sa->setWidgetResizable(true);
129    sa->setWidget(sac);
130    QVBoxLayout *vbox2 = new QVBoxLayout();
131    vbox2->addWidget(sa);
132    tabOutput->setLayout(vbox2);
133#else
134    buttons->insertStretch(buttons->indexOf(buttonHelp) + 1);
135#endif // Q_WS_WINCE_WM
136
137    bgWhite->layout()->setMargin(0);
138
139    // Central layout
140    vbox1 = new QVBoxLayout(this);
141    vbox1->setMargin(0);
142    vbox1->setSpacing(0);
143#ifdef Q_WS_WINCE_WM
144    vbox1->addWidget(scrollArea);
145#else
146    vbox1->addWidget(bgWhite);
147#endif // Q_WS_WINCE_WM
148    vbox1->addWidget(bgGrey);
149    setLayout(vbox1);
150#else // HANDHELD
151QVBoxLayout *vbox; // Layout helper
152
153#ifndef HANDHELD
154    if (QtWin::isCompositionEnabled()) {
155        cbUseTranslucency = new QCheckBox(bgWhite);
156        cbUseTranslucency->setObjectName("cbUseTranslucency");
157#ifndef QT_NO_STATUSTIP
158        cbUseTranslucency->setStatusTip(tr("Make Main Window background translucent"));
159#endif // QT_NO_STATUSTIP
160        cbUseTranslucency->setText(tr("Use translucency effects"));
161        cbUseTranslucency->setCursor(QCursor(Qt::PointingHandCursor));
162    }
163#endif // HANDHELD
164
165    cbSaveState = new QCheckBox(bgWhite);
166    cbSaveState->setObjectName("cbSaveState");
167#ifndef QT_NO_STATUSTIP
168    cbSaveState->setStatusTip(tr("Restore main window state and position on application restart"));
169#endif // QT_NO_STATUSTIP
170    cbSaveState->setText(tr("Save main window state and position"));
171    cbSaveState->setCursor(QCursor(Qt::PointingHandCursor));
172
173    imgIcon = new QLabel(this);
174    imgIcon->setObjectName("imgIcon");
175    imgIcon->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding);
176    imgIcon->setFrameShape(QFrame::NoFrame);
177    imgIcon->setPixmap(GET_ICON("preferences-system").pixmap(128, 128));
178    imgIcon->setStyleSheet("background-color: #0080C0; padding-top: 11px;");
179    imgIcon->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
180    imgIcon->setMinimumWidth(150);
181
182    labelHint = new QLabel(bgGrey);
183    labelHint->setObjectName("labelHint");
184    labelHint->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred);
185    labelHint->setMinimumSize(QSize(250, 28));
186    labelHint->setMaximumSize(QSize(QWIDGETSIZE_MAX, 28));
187    labelHint->setTextFormat(Qt::PlainText);
188//      labelHint->setAlignment(Qt::AlignLeft | Qt::AlignTop);
189    labelHint->setWordWrap(true);
190#ifndef QT_NO_STATUSTIP
191    labelHint->setStatusTip(tr("Hover mouse pointer over dialog elements to get additional help"));
192#endif // QT_NO_STATUSTIP
193
194    lineVertical = new QFrame(this);
195    lineVertical->setObjectName("lineVertical");
196    lineVertical->setFrameShadow(QFrame::Plain);
197    lineVertical->setFrameShape(QFrame::VLine);
198    lineVertical->setLineWidth(2);
199
200    // Top line
201    hbox = new QHBoxLayout();
202    hbox->addWidget(imgIcon);
203    hbox->addWidget(lineVertical);
204    hbox->addWidget(bgWhite);
205
206    box = static_cast<QBoxLayout *>(tabGeneral->layout());
207    box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbSaveState);
208#ifndef HANDHELD
209    if (QtWin::isCompositionEnabled())
210        box->insertWidget(box->indexOf(cbUseNativeDialogs) + 1, cbUseTranslucency);
211#endif // HANDHELD
212
213    // Inserting label for hints to the bottom part (with grey bg)
214    buttons->insertWidget(buttons->indexOf(buttonHelp) + 1, labelHint, 1);
215
216    // Central layout
217    vbox = new QVBoxLayout(this);
218    vbox->setMargin(0);
219    vbox->setSpacing(0);
220    vbox->addLayout(hbox);
221    vbox->addWidget(bgGrey);
222    setLayout(vbox);
223#endif // HANDHELD
224
225#ifdef Q_WS_WINCE_WM
226    // We need to react to SIP show/hide and resize the window appropriately
227    connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(desktopResized(int)));
228#endif // Q_WS_WINCE_WM
229    connect(spinRandMin, SIGNAL(valueChanged(int)), SLOT(spinRandMinValueChanged(int)));
230    connect(buttonFont, SIGNAL(clicked()), SLOT(buttonFontClicked()));
231    connect(buttonColor, SIGNAL(clicked()), SLOT(buttonColorClicked()));
232    setWindowFlags(windowFlags() ^ Qt::WindowContextHelpButtonHint);
233#if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD)
234    // Setting initial text of dialog hint label to own status tip text.
235    labelHint->setText(labelHint->statusTip());
236#endif // HANDHELD
237
238    settings = new QSettings(QSettings::IniFormat, QSettings::UserScope, "TSPSG", "tspsg", this);
239    settings->remove("SettingsReset");
240
241    cbAutosize->setChecked(settings->value("Autosize", DEF_AUTOSIZE).toBool());
242    cbSaveLastUsed->setChecked(settings->value("SaveLastUsed", DEF_SAVE_LAST_USED).toBool());
243    cbUseNativeDialogs->setChecked(settings->value("UseNativeDialogs", DEF_USE_NATIVE_DIALOGS).toBool());
244#ifndef HANDHELD
245    if (QtWin::isCompositionEnabled())
246        cbUseTranslucency->setChecked(settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool());
247#endif // HANDHELD
248#ifndef HANDHELD
249    cbSaveState->setChecked(settings->value("SavePos", DEF_SAVEPOS).toBool());
250#endif // HANDHELD
251    if (cbCheck4Updates != NULL) {
252        settings->beginGroup("Check4Updates");
253        cbCheck4Updates->setChecked(settings->value("Enabled", DEF_CHECK_FOR_UPDATES).toBool());
254        spinUpdateCheckInterval->setValue(settings->value("Interval", DEF_UPDATE_CHECK_INTERVAL).toInt());
255        settings->endGroup();
256        spinUpdateCheckInterval->setEnabled(cbCheck4Updates->isChecked());
257    }
258
259    settings->beginGroup("Task");
260    cbSymmetricMode->setChecked(settings->value("SymmetricMode", DEF_SYMMETRIC_MODE).toBool());
261    spinFractionalAccuracy->setValue(settings->value("FractionalAccuracy", DEF_FRACTIONAL_ACCURACY).toInt());
262    spinRandMin->setMaximum(MAX_RAND_VALUE);
263    spinRandMin->setValue(settings->value("RandMin",DEF_RAND_MIN).toInt());
264    spinRandMax->setMaximum(MAX_RAND_VALUE);
265    spinRandMax->setValue(settings->value("RandMax",DEF_RAND_MAX).toInt());
266    cbFractionalRandom->setChecked(settings->value("FractionalRandom", DEF_FRACTIONAL_RANDOM).toBool());
267    settings->endGroup();
268
269    settings->beginGroup("Output");
270    cbGenerateGraph->setChecked(settings->value("GenerateGraph", DEF_GENERATE_GRAPH).toBool());
271
272#ifndef QT_NO_PRINTER
273    cbHQGraph->setEnabled(cbGenerateGraph->isChecked());
274    cbHQGraph->setChecked(settings->value("HQGraph", DEF_HQ_GRAPH).toBool());
275#endif
276
277#if !defined(NOSVG) && (QT_VERSION >= 0x040500)
278    comboGraphImageFormat->addItem("svg");
279#endif // NOSVG && QT_VERSION >= 0x040500
280    // We create whitelist of formats, supported by the most popular web browsers according to
281    //  http://en.wikipedia.org/wiki/Comparison_of_web_browsers#Image_format_support
282    //  + TIFF format (there are plugins to support it).
283QStringList whitelist;
284    whitelist << "bmp" << "jpeg" << "png" << "tiff" << "xbm";
285    foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
286        if (whitelist.contains(format))
287            comboGraphImageFormat->addItem(format);
288    }
289    comboGraphImageFormat->model()->sort(0);
290    comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(settings->value("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT).toString(), Qt::MatchFixedString));
291    if (comboGraphImageFormat->currentIndex() < 0)
292        comboGraphImageFormat->setCurrentIndex(comboGraphImageFormat->findText(DEF_GRAPH_IMAGE_FORMAT, Qt::MatchFixedString));
293    labelGraphImageFormat->setEnabled(cbGenerateGraph->isChecked());
294    comboGraphImageFormat->setEnabled(cbGenerateGraph->isChecked());
295    cbEmbedGraphIntoHTML->setChecked(settings->value("EmbedGraphIntoHTML", DEF_EMBED_GRAPH_INTO_HTML).toBool());
296    cbEmbedGraphIntoHTML->setEnabled(cbGenerateGraph->isChecked());
297
298    cbShowMatrix->setChecked(settings->value("ShowMatrix", DEF_SHOW_MATRIX).toBool());
299    cbCitiesLimit->setEnabled(cbShowMatrix->isChecked());
300    cbCitiesLimit->setChecked(settings->value("UseShowMatrixLimit", DEF_USE_SHOW_MATRIX_LIMIT && cbShowMatrix->isChecked()).toBool());
301    spinCitiesLimit->setEnabled(cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
302    spinCitiesLimit->setValue(settings->value("ShowMatrixLimit", DEF_SHOW_MATRIX_LIMIT).toInt());
303    spinCitiesLimit->setMaximum(MAX_NUM_CITIES);
304    cbScrollToEnd->setChecked(settings->value("ScrollToEnd", DEF_SCROLL_TO_END).toBool());
305
306    font = qvariant_cast<QFont>(settings->value("Font", QFont(DEF_FONT_FACE, DEF_FONT_SIZE)));
307    color = qvariant_cast<QColor>(settings->value("Colors/Text", DEF_TEXT_COLOR));
308    settings->endGroup();
309
310#ifdef HANDHELD
311    setWindowState(Qt::WindowMaximized);
312#else
313    adjustSize();
314#endif // Q_WS_WINCE_WM
315}
316
317/*!
318 * \brief Indicates whether or not the font color has been changed.
319 * \return \c true if font color changed, otherwise \c false.
320 */
321bool SettingsDialog::colorChanged() const
322{
323    return _newColor;
324}
325
326/*!
327 * \brief Indicates whether or not the font properties have been changed.
328 * \return \c true if font properties changed, otherwise \c false.
329 */
330bool SettingsDialog::fontChanged() const
331{
332    return _newFont;
333}
334
335/*!
336 * \brief Indicates whether and how the translucency setting was changed
337 * \retval -1 the translucency was \em disabled.
338 * \retval  0 the translucency <em>didn't change</em>.
339 * \retval  1 the translucency was \em enabled.
340 */
341qint8 SettingsDialog::translucencyChanged() const
342{
343    return _translucency;
344}
345
346/* Privates **********************************************************/
347
348void SettingsDialog::accept()
349{
350    if (QApplication::keyboardModifiers() & Qt::ShiftModifier) {
351        if (QMessageBox::question(this, tr("Settings Reset"), tr("Do you really want to <b>reset all application settings to their defaults</b>?"), QMessageBox::RestoreDefaults | QMessageBox::Cancel) == QMessageBox::RestoreDefaults) {
352            _newFont = (font != QFont(DEF_FONT_FACE, DEF_FONT_SIZE));
353            _newColor = (color != DEF_TEXT_COLOR);
354            settings->remove("");
355            settings->setValue("SettingsReset", true);
356            QDialog::accept();
357            QMessageBox::information(this->parentWidget(), tr("Settings Reset"), tr("All settings where successfully reset to their defaults.\nIt is recommended to restart the application now."));
358            return;
359        } else
360            return;
361    }
362    settings->setValue("Autosize", cbAutosize->isChecked());
363    settings->setValue("SaveLastUsed", cbSaveLastUsed->isChecked());
364    settings->setValue("UseNativeDialogs", cbUseNativeDialogs->isChecked());
365#ifndef HANDHELD
366    if (QtWin::isCompositionEnabled()) {
367bool old = settings->value("UseTranslucency", DEF_USE_TRANSLUCENCY).toBool();
368        if ((!old && cbUseTranslucency->isChecked()) || (old && !cbUseTranslucency->isChecked())) {
369            _translucency = old ? -1 : 1;
370        } else
371            _translucency = 0;
372        settings->setValue("UseTranslucency", cbUseTranslucency->isChecked());
373    }
374    settings->setValue("SavePos", cbSaveState->isChecked());
375#endif // HANDHELD
376    if (cbCheck4Updates != NULL) {
377        settings->beginGroup("Check4Updates");
378        settings->setValue("Enabled", cbCheck4Updates->isChecked());
379        if (cbCheck4Updates->isChecked())
380            settings->setValue("Interval", spinUpdateCheckInterval->value());
381        settings->endGroup();
382    }
383
384    settings->beginGroup("Task");
385    settings->setValue("SymmetricMode", cbSymmetricMode->isChecked());
386    settings->setValue("FractionalAccuracy", spinFractionalAccuracy->value());
387    settings->setValue("RandMin", spinRandMin->value());
388    settings->setValue("RandMax", spinRandMax->value());
389    settings->setValue("FractionalRandom", cbFractionalRandom->isChecked());
390    settings->endGroup();
391
392    settings->beginGroup("Output");
393    settings->setValue("GenerateGraph", cbGenerateGraph->isChecked());
394    if (cbGenerateGraph->isChecked()) {
395#ifndef QT_NO_PRINTER
396        settings->setValue("HQGraph", cbHQGraph->isChecked());
397#endif
398        if (cbGenerateGraph->isChecked()) {
399            if (comboGraphImageFormat->currentIndex() >= 0)
400                settings->setValue("GraphImageFormat", comboGraphImageFormat->currentText());
401            else
402                settings->setValue("GraphImageFormat", DEF_GRAPH_IMAGE_FORMAT);
403        }
404        settings->setValue("EmbedGraphIntoHTML", cbEmbedGraphIntoHTML->isChecked());
405    }
406    settings->setValue("ShowMatrix", cbShowMatrix->isChecked());
407    settings->setValue("UseShowMatrixLimit", cbShowMatrix->isChecked() && cbCitiesLimit->isChecked());
408    if (cbCitiesLimit->isChecked())
409        settings->setValue("ShowMatrixLimit", spinCitiesLimit->value());
410    settings->setValue("ScrollToEnd", cbScrollToEnd->isChecked());
411    if (_newFont)
412        settings->setValue("Font", font);
413    if (_newColor)
414        settings->setValue("Colors/Text", color);
415    settings->endGroup();
416    QDialog::accept();
417}
418
419void SettingsDialog::buttonColorClicked()
420{
421QColor color = QColorDialog::getColor(this->color,this);
422    if (color.isValid() && (this->color != color)) {
423        this->color = color;
424        _newColor = true;
425    }
426}
427
428void SettingsDialog::buttonFontClicked()
429{
430    QFontDialog fd(font, this);
431#ifdef Q_OS_BLACKBERRY
432    fd.setWindowState(Qt::WindowMaximized);
433#endif
434    if ((fd.exec() != QDialog::Accepted) || (fd.selectedFont() == font))
435        return;
436    font = fd.selectedFont();
437    _newFont = true;
438}
439
440#ifdef Q_WS_WINCE_WM
441void SettingsDialog::desktopResized(int screen)
442{
443    if (screen != 0)
444        return;
445
446QRect availableGeometry = QApplication::desktop()->availableGeometry(0);
447    if (currentGeometry != availableGeometry) {
448        QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
449        /*!
450         * \hack HACK: This hack checks whether \link QDesktopWidget::availableGeometry() availableGeometry()\endlink's \c top + \c hegiht = \link QDesktopWidget::screenGeometry() screenGeometry()\endlink's \c height.
451         *  If \c true, the window gets maximized. If we used \c setGeometry() in this case, the bottom of the
452         *  window would end up being behind the soft buttons. Is this a bug in Qt or Windows Mobile?
453         */
454        if ((availableGeometry.top() + availableGeometry.height()) == QApplication::desktop()->screenGeometry().height()) {
455            setWindowState(windowState() | Qt::WindowMaximized);
456        } else {
457            if (windowState() & Qt::WindowMaximized)
458                setWindowState(windowState() ^ Qt::WindowMaximized);
459            setGeometry(availableGeometry);
460        }
461        currentGeometry = availableGeometry;
462        QApplication::restoreOverrideCursor();
463    }
464}
465
466void SettingsDialog::showEvent(QShowEvent *ev)
467{
468    desktopResized(0);
469
470    QWidget::showEvent(ev);
471}
472#endif // Q_WS_WINCE_WM
473
474void SettingsDialog::spinRandMinValueChanged(int val) {
475    spinRandMax->setMinimum(val);
476}
477
478#if !defined(QT_NO_STATUSTIP) && !defined(HANDHELD)
479bool SettingsDialog::event(QEvent *ev)
480{
481    // Checking for StatusTip event and if tip text is not empty string
482    // setting it as text of the dialog hint label. Otherwise, setting
483    // dialog hint label text to own status tip text.
484    if (ev->type() == QEvent::StatusTip) {
485QString tip = static_cast<QStatusTipEvent *>(ev)->tip();
486        if (tip.length() != 0)
487            labelHint->setText(tip);
488        else
489            labelHint->setText(labelHint->statusTip());
490        return true;
491    } else
492        return QDialog::event(ev);
493}
494#endif // HANDHELD
Note: See TracBrowser for help on using the repository browser.