src/gui/widgets/qlinecontrol_p.h
changeset 7 f7bc934e204c
parent 3 41300fa6a67c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   237 
   237 
   238 private:
   238 private:
   239     void init(const QString &txt);
   239     void init(const QString &txt);
   240     void removeSelectedText();
   240     void removeSelectedText();
   241     void internalSetText(const QString &txt, int pos = -1, bool edited = true);
   241     void internalSetText(const QString &txt, int pos = -1, bool edited = true);
   242     void updateDisplayText();
   242     void updateDisplayText(bool forceUpdate = false);
   243 
   243 
   244     void internalInsert(const QString &s);
   244     void internalInsert(const QString &s);
   245     void internalDelete(bool wasBackspace = false);
   245     void internalDelete(bool wasBackspace = false);
   246     void internalRemove(int pos);
   246     void internalRemove(int pos);
   247 
   247 
   547     return m_textLayout.lineAt(0).cursorToX(cursor);
   547     return m_textLayout.lineAt(0).cursorToX(cursor);
   548 }
   548 }
   549 
   549 
   550 inline qreal QLineControl::cursorToX() const
   550 inline qreal QLineControl::cursorToX() const
   551 {
   551 {
   552     return cursorToX(m_cursor);
   552     int cursor = m_cursor;
       
   553     if (m_preeditCursor != -1)
       
   554         cursor += m_preeditCursor;
       
   555     return cursorToX(cursor);
   553 }
   556 }
   554 
   557 
   555 inline bool QLineControl::isReadOnly() const
   558 inline bool QLineControl::isReadOnly() const
   556 {
   559 {
   557     return m_readOnly;
   560     return m_readOnly;