Changeset 846 for trunk/src/gui/widgets/qlinecontrol.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/widgets/qlinecontrol.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 137 137 \sa insert() 138 138 */ 139 void QLineControl::paste( )140 { 141 QString clip = QApplication::clipboard()->text( QClipboard::Clipboard);139 void QLineControl::paste(QClipboard::Mode clipboardMode) 140 { 141 QString clip = QApplication::clipboard()->text(clipboardMode); 142 142 if (!clip.isEmpty() || hasSelectedText()) { 143 143 separate(); //make it a separate undo/redo command … … 420 420 421 421 int c = m_cursor; // cursor position after insertion of commit string 422 if (event->replacementStart() == 0)422 if (event->replacementStart() <= 0) 423 423 c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength()); 424 424 … … 528 528 if (m_preeditCursor != -1) 529 529 cursor += m_preeditCursor; 530 if (!m_blinkPeriod || m_blinkStatus)530 if (!m_hideCursor && (!m_blinkPeriod || m_blinkStatus)) 531 531 m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth); 532 532 } … … 537 537 538 538 Sets the selection to cover the word at the given cursor position. 539 The word bound ries isdefined by the behavior of QTextLayout::SkipWords539 The word boundaries are defined by the behavior of QTextLayout::SkipWords 540 540 cursor mode. 541 541 */ … … 1212 1212 \internal 1213 1213 1214 If the current cursor position differs from the last emit ed cursor1214 If the current cursor position differs from the last emitted cursor 1215 1215 position, emits cursorPositionChanged(). 1216 1216 */ … … 1307 1307 } 1308 1308 m_blinkPeriod = msec; 1309 } 1310 1311 void QLineControl::resetCursorBlinkTimer() 1312 { 1313 if (m_blinkPeriod == 0 || m_blinkTimer == 0) 1314 return; 1315 killTimer(m_blinkTimer); 1316 m_blinkTimer = startTimer(m_blinkPeriod / 2); 1317 m_blinkStatus = 1; 1309 1318 } 1310 1319 … … 1351 1360 switch(ev->type()){ 1352 1361 #ifndef QT_NO_GRAPHICSVIEW 1362 case QEvent::GraphicsSceneMouseDoubleClick: 1353 1363 case QEvent::GraphicsSceneMouseMove: 1354 1364 case QEvent::GraphicsSceneMouseRelease: … … 1440 1450 break; 1441 1451 } 1452 case QEvent::GraphicsSceneMouseDoubleClick: 1442 1453 case QEvent::MouseButtonDblClick: 1443 1454 if (ev->button() == Qt::LeftButton) { … … 1577 1588 } 1578 1589 else if (event == QKeySequence::Paste) { 1579 if (!isReadOnly()) 1580 paste(); 1590 if (!isReadOnly()) { 1591 QClipboard::Mode mode = QClipboard::Clipboard; 1592 #ifdef Q_WS_X11 1593 if (event->modifiers() == (Qt::CTRL | Qt::SHIFT) && event->key() == Qt::Key_Insert) 1594 mode = QClipboard::Selection; 1595 #endif 1596 paste(mode); 1597 } 1581 1598 } 1582 1599 else if (event == QKeySequence::Cut) { … … 1762 1779 break; 1763 1780 #endif 1764 1765 1781 default: 1766 1782 if (!handled)
Note:
See TracChangeset
for help on using the changeset viewer.