Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qlinecontrol.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    137137    \sa insert()
    138138*/
    139 void QLineControl::paste()
    140 {
    141     QString clip = QApplication::clipboard()->text(QClipboard::Clipboard);
     139void QLineControl::paste(QClipboard::Mode clipboardMode)
     140{
     141    QString clip = QApplication::clipboard()->text(clipboardMode);
    142142    if (!clip.isEmpty() || hasSelectedText()) {
    143143        separate(); //make it a separate undo/redo command
     
    420420
    421421    int c = m_cursor; // cursor position after insertion of commit string
    422     if (event->replacementStart() == 0)
     422    if (event->replacementStart() <= 0)
    423423        c += event->commitString().length() + qMin(-event->replacementStart(), event->replacementLength());
    424424
     
    528528        if (m_preeditCursor != -1)
    529529            cursor += m_preeditCursor;
    530         if(!m_blinkPeriod || m_blinkStatus)
     530        if (!m_hideCursor && (!m_blinkPeriod || m_blinkStatus))
    531531            m_textLayout.drawCursor(painter, offset, cursor, m_cursorWidth);
    532532    }
     
    537537
    538538    Sets the selection to cover the word at the given cursor position.
    539     The word boundries is defined by the behavior of QTextLayout::SkipWords
     539    The word boundaries are defined by the behavior of QTextLayout::SkipWords
    540540    cursor mode.
    541541*/
     
    12121212    \internal
    12131213
    1214     If the current cursor position differs from the last emited cursor
     1214    If the current cursor position differs from the last emitted cursor
    12151215    position, emits cursorPositionChanged().
    12161216*/
     
    13071307    }
    13081308    m_blinkPeriod = msec;
     1309}
     1310
     1311void 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;
    13091318}
    13101319
     
    13511360    switch(ev->type()){
    13521361#ifndef QT_NO_GRAPHICSVIEW
     1362        case QEvent::GraphicsSceneMouseDoubleClick:
    13531363        case QEvent::GraphicsSceneMouseMove:
    13541364        case QEvent::GraphicsSceneMouseRelease:
     
    14401450            break;
    14411451        }
     1452        case QEvent::GraphicsSceneMouseDoubleClick:
    14421453        case QEvent::MouseButtonDblClick:
    14431454            if (ev->button() == Qt::LeftButton) {
     
    15771588    }
    15781589    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        }
    15811598    }
    15821599    else if (event == QKeySequence::Cut) {
     
    17621779                break;
    17631780#endif
    1764 
    17651781            default:
    17661782                if (!handled)
Note: See TracChangeset for help on using the changeset viewer.