Changeset 561 for trunk/src/gui/dialogs/qprogressdialog.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/dialogs/qprogressdialog.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 58 58 #include <limits.h> 59 59 60 #if defined(QT_SOFTKEYS_ENABLED) 61 #include <qaction.h> 62 #endif 63 #ifdef Q_WS_S60 64 #include <QtGui/qdesktopwidget.h> 65 #endif 66 67 60 68 QT_BEGIN_NAMESPACE 61 69 … … 77 85 #ifndef QT_NO_SHORTCUT 78 86 escapeShortcut(0), 87 #endif 88 #ifdef QT_SOFTKEYS_ENABLED 89 cancelAction(0), 79 90 #endif 80 91 useDefaultCancelText(false) … … 103 114 #ifndef QT_NO_SHORTCUT 104 115 QShortcut *escapeShortcut; 116 #endif 117 #ifdef QT_SOFTKEYS_ENABLED 118 QAction *cancelAction; 105 119 #endif 106 120 bool useDefaultCancelText; … … 197 211 \class QProgressDialog 198 212 \brief The QProgressDialog class provides feedback on the progress of a slow operation. 199 \ingroup dialogs200 \mainclass 213 \ingroup standard-dialogs 214 201 215 202 216 A progress dialog is used to give the user an indication of how long … … 432 446 resize(w, h); 433 447 if (cancelButton) 448 #if !defined(QT_SOFTKEYS_ENABLED) 434 449 cancelButton->show(); 450 #else 451 { 452 d->cancelAction = new QAction(cancelButton->text(), cancelButton); 453 d->cancelAction->setSoftKeyRole(QAction::NegativeSoftKey); 454 connect(d->cancelAction, SIGNAL(triggered()), this, SIGNAL(canceled())); 455 addAction(d->cancelAction); 456 } 457 #endif 435 458 } 436 459 … … 449 472 450 473 if (!cancelButtonText.isNull()) { 451 if (d->cancel) 474 if (d->cancel) { 452 475 d->cancel->setText(cancelButtonText); 453 else 476 #ifdef QT_SOFTKEYS_ENABLED 477 d->cancelAction->setText(cancelButtonText); 478 #endif 479 } else { 454 480 setCancelButton(new QPushButton(cancelButtonText, this)); 481 } 455 482 } else { 456 483 setCancelButton(0); … … 627 654 \warning If the progress dialog is modal 628 655 (see QProgressDialog::QProgressDialog()), 629 this functioncalls QApplication::processEvents(), so take care that656 setValue() calls QApplication::processEvents(), so take care that 630 657 this does not cause undesirable re-entrancy in your code. For example, 631 658 don't use a QProgressDialog inside a paintEvent()! … … 644 671 if (d->shown_once) { 645 672 if (isModal()) 646 qApp->processEvents();673 QApplication::processEvents(); 647 674 } else { 648 675 if (progress == 0) { … … 702 729 if (d->cancel) 703 730 h += d->cancel->sizeHint().height() + spacing; 731 #ifdef Q_WS_S60 732 if (QApplication::desktop()->size().height() > QApplication::desktop()->size().width()) 733 return QSize(qMax(QApplication::desktop()->size().width(), sh.width() + 2 * margin), h); 734 else 735 return QSize(qMax(QApplication::desktop()->size().height(), sh.width() + 2 * margin), h); 736 #else 704 737 return QSize(qMax(200, sh.width() + 2 * margin), h); 738 #endif 705 739 } 706 740 … … 719 753 { 720 754 Q_D(QProgressDialog); 721 if (ev->type() == QEvent::StyleChange) 755 if (ev->type() == QEvent::StyleChange) { 722 756 d->layout(); 723 else if (ev->type() == QEvent::LanguageChange)757 } else if (ev->type() == QEvent::LanguageChange) { 724 758 d->retranslateStrings(); 759 } 725 760 QDialog::changeEvent(ev); 726 761 }
Note:
See TracChangeset
for help on using the changeset viewer.