Changeset 561 for trunk/src/gui/dialogs/qinputdialog.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/qinputdialog.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 ** … … 96 96 QInputDialogSpinBox(QWidget *parent) 97 97 : QSpinBox(parent) { 98 connect(lineEdit(), SIGNAL(textChanged( const QString&)), this, SLOT(notifyTextChanged()));98 connect(lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(notifyTextChanged())); 99 99 connect(this, SIGNAL(editingFinished()), this, SLOT(notifyTextChanged())); 100 100 } … … 131 131 QInputDialogDoubleSpinBox(QWidget *parent = 0) 132 132 : QDoubleSpinBox(parent) { 133 connect(lineEdit(), SIGNAL(textChanged( const QString&)), this, SLOT(notifyTextChanged()));133 connect(lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(notifyTextChanged())); 134 134 connect(this, SIGNAL(editingFinished()), this, SLOT(notifyTextChanged())); 135 135 } … … 246 246 lineEdit = new QLineEdit(q); 247 247 lineEdit->hide(); 248 QObject::connect(lineEdit, SIGNAL(textChanged( const QString&)),249 q, SLOT(_q_textChanged( const QString&)));248 QObject::connect(lineEdit, SIGNAL(textChanged(QString)), 249 q, SLOT(_q_textChanged(QString))); 250 250 } 251 251 } … … 257 257 comboBox = new QComboBox(q); 258 258 comboBox->hide(); 259 QObject::connect(comboBox, SIGNAL(editTextChanged( const QString&)),260 q, SLOT(_q_textChanged( const QString&)));261 QObject::connect(comboBox, SIGNAL(currentIndexChanged( const QString&)),262 q, SLOT(_q_textChanged( const QString&)));259 QObject::connect(comboBox, SIGNAL(editTextChanged(QString)), 260 q, SLOT(_q_textChanged(QString))); 261 QObject::connect(comboBox, SIGNAL(currentIndexChanged(QString)), 262 q, SLOT(_q_textChanged(QString))); 263 263 } 264 264 } … … 277 277 listView->setCurrentIndex(QModelIndex()); // ### 278 278 QObject::connect(listView->selectionModel(), 279 SIGNAL(currentRowChanged( const QModelIndex&, const QModelIndex&)),280 q, SLOT(_q_currentRowChanged( const QModelIndex&, const QModelIndex&)));279 SIGNAL(currentRowChanged(QModelIndex,QModelIndex)), 280 q, SLOT(_q_currentRowChanged(QModelIndex,QModelIndex))); 281 281 } 282 282 } … … 308 308 if (spinBox) { 309 309 QAbstractButton *okButton = buttonBox->button(QDialogButtonBox::Ok); 310 QObject::disconnect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool))); 311 QObject::connect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool))); 310 QObject::connect(spinBox, SIGNAL(textChanged(bool)), okButton, SLOT(setEnabled(bool)), Qt::UniqueConnection); 312 311 } 313 312 } … … 427 426 \brief The QInputDialog class provides a simple convenience dialog to get a 428 427 single value from the user. 429 \ingroup dialogs430 \mainclass 428 \ingroup standard-dialogs 429 431 430 432 431 The input value can be a string, a number or an item from a list. A label … … 1021 1020 \overload 1022 1021 1023 Opens the dialog and connects its accepted() signal to the slot specified 1024 by \a receiver and \a member. 1022 This function connects one of its signals to the slot specified by \a receiver 1023 and \a member. The specific signal depends on the arguments that are specified 1024 in \a member. These are: 1025 1026 \list 1027 \o textValueSelected() if \a member has a QString for its first argument. 1028 \o intValueSelected() if \a member has an int for its first argument. 1029 \o doubleValueSelected() if \a member has a double for its first argument. 1030 \o accepted() if \a member has NO arguments. 1031 \endlist 1025 1032 1026 1033 The signal will be disconnected from the slot when the dialog is closed. … … 1122 1129 \a flags. 1123 1130 1124 This function returns the text which has been entered in the line1125 edit. It will not return an empty string.1131 If the dialog is accepted, this function returns the text in the dialog's 1132 line edit. If the dialog is rejected, a null QString is returned. 1126 1133 1127 1134 Use this static function like this: … … 1152 1159 return dialog.textValue(); 1153 1160 } else { 1154 return text;1161 return QString(); 1155 1162 } 1156 1163 } … … 1243 1250 dialog.setWindowTitle(title); 1244 1251 dialog.setLabelText(label); 1252 dialog.setDoubleDecimals(decimals); 1245 1253 dialog.setDoubleRange(min, max); 1246 1254 dialog.setDoubleValue(value); 1247 dialog.setDoubleDecimals(decimals);1248 1255 1249 1256 int ret = dialog.exec();
Note:
See TracChangeset
for help on using the changeset viewer.