Changeset 561 for trunk/src/gui/widgets/qdatetimeedit.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/widgets/qdatetimeedit.cpp
r2 r561 1 /**************************************************************************** )1 /**************************************************************************** 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 ** … … 76 76 77 77 \ingroup basicwidgets 78 \mainclass 78 79 79 80 80 QDateTimeEdit allows the user to edit dates by using the keyboard or … … 221 221 \brief the QDateTime that is set in the QDateTimeEdit 222 222 223 When setting this property the timespec of the QDateTimeEdit remains the same 224 and the timespec of the new QDateTime is ignored. 225 223 226 By default, this property contains a date that refers to January 1, 224 227 2000 and a time of 00:00:00 and 0 milliseconds. … … 240 243 if (!(d->sections & DateSections_Mask)) 241 244 setDateRange(datetime.date(), datetime.date()); 242 d->setValue(Q Variant(datetime), EmitIfChanged);245 d->setValue(QDateTime(datetime.date(), datetime.time(), d->spec), EmitIfChanged); 243 246 } 244 247 } … … 933 936 \brief the current timespec used by the date time edit. 934 937 \since 4.4 935 936 All dates/passed to the date time edit will be converted to this937 timespec.938 938 */ 939 939 … … 1087 1087 //hide cursor 1088 1088 d->edit->d_func()->setCursorVisible(false); 1089 if (d->edit->d_func()->cursorTimer > 0) 1090 killTimer(d->edit->d_func()->cursorTimer); 1091 d->edit->d_func()->cursorTimer = 0; 1092 1089 d->edit->d_func()->control->setCursorBlinkPeriod(0); 1093 1090 d->setSelected(0); 1094 1091 } … … 1111 1108 //hide cursor 1112 1109 d->edit->d_func()->setCursorVisible(false); 1113 if (d->edit->d_func()->cursorTimer > 0) 1114 killTimer(d->edit->d_func()->cursorTimer); 1115 d->edit->d_func()->cursorTimer = 0; 1116 1110 d->edit->d_func()->control->setCursorBlinkPeriod(0); 1117 1111 d->setSelected(0); 1118 1112 oldCurrent = 0; … … 1127 1121 case Qt::Key_Right: 1128 1122 if (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) { 1123 if ( 1129 1124 #ifdef QT_KEYPAD_NAVIGATION 1130 if (!QApplication::keypadNavigationEnabled() || !hasEditFocus()) { 1131 select = false; 1132 break; 1133 } 1134 #else 1135 if (!(event->modifiers() & Qt::ControlModifier)) { 1125 QApplication::keypadNavigationEnabled() && !hasEditFocus() 1126 || !QApplication::keypadNavigationEnabled() && 1127 #endif 1128 !(event->modifiers() & Qt::ControlModifier)) { 1136 1129 select = false; 1137 1130 break; 1138 1131 } 1139 1132 #ifdef Q_WS_MAC 1140 else { 1133 else 1134 #ifdef QT_KEYPAD_NAVIGATION 1135 if (!QApplication::keypadNavigationEnabled()) 1136 #endif 1137 { 1141 1138 select = (event->modifiers() & Qt::ShiftModifier); 1142 1139 break; 1143 1140 } 1144 1141 #endif 1145 #endif // QT_KEYPAD_NAVIGATION1146 1142 } 1147 1143 // else fall through … … 1511 1507 1512 1508 \ingroup basicwidgets 1513 \mainclass 1509 1514 1510 1515 1511 Many of the properties and functions provided by QTimeEdit are implemented in … … 1573 1569 1574 1570 \ingroup basicwidgets 1575 \mainclass 1571 1576 1572 1577 1573 Many of the properties and functions provided by QDateEdit are implemented in … … 1648 1644 currentSectionIndex = FirstSectionIndex; 1649 1645 1650 layoutDirection = QApplication::layoutDirection();1651 1646 first.type = FirstSection; 1652 1647 last.type = LastSection; … … 1935 1930 /*! 1936 1931 \internal 1937 \reimp1938 1932 */ 1939 1933 … … 1946 1940 /*! 1947 1941 \internal 1948 \reimp1949 1942 1950 1943 This function's name is slightly confusing; it is not to be confused … … 2104 2097 /*! 2105 2098 \internal 2106 \reimp2107 2099 */ 2108 2100 … … 2134 2126 /*! 2135 2127 \internal 2136 \reimp2137 2128 */ 2138 2129 … … 2279 2270 optCombo.init(this); 2280 2271 optCombo.editable = true; 2272 optCombo.frame = opt.frame; 2281 2273 optCombo.subControls = opt.subControls; 2282 2274 optCombo.activeSubControls = opt.activeSubControls; … … 2391 2383 #endif 2392 2384 updateTimeSpec(); 2385 q->setInputMethodHints(Qt::ImhPreferNumbers); 2393 2386 setLayoutItemMargins(QStyle::SE_DateTimeEditLayoutItem); 2394 2387 }
Note:
See TracChangeset
for help on using the changeset viewer.