114 { |
114 { |
115 ignoreAutomaticScrollbarAdjustment = false; |
115 ignoreAutomaticScrollbarAdjustment = false; |
116 preferRichText = false; |
116 preferRichText = false; |
117 showCursorOnInitialShow = true; |
117 showCursorOnInitialShow = true; |
118 inDrag = false; |
118 inDrag = false; |
119 #ifdef Q_WS_WIN |
|
120 setSingleFingerPanEnabled(true); |
|
121 #endif |
|
122 } |
119 } |
123 |
120 |
124 void QTextEditPrivate::createAutoBulletList() |
121 void QTextEditPrivate::createAutoBulletList() |
125 { |
122 { |
126 QTextCursor cursor = control->textCursor(); |
123 QTextCursor cursor = control->textCursor(); |
158 QObject::connect(control, SIGNAL(undoAvailable(bool)), q, SIGNAL(undoAvailable(bool))); |
155 QObject::connect(control, SIGNAL(undoAvailable(bool)), q, SIGNAL(undoAvailable(bool))); |
159 QObject::connect(control, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool))); |
156 QObject::connect(control, SIGNAL(redoAvailable(bool)), q, SIGNAL(redoAvailable(bool))); |
160 QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool))); |
157 QObject::connect(control, SIGNAL(copyAvailable(bool)), q, SIGNAL(copyAvailable(bool))); |
161 QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged())); |
158 QObject::connect(control, SIGNAL(selectionChanged()), q, SIGNAL(selectionChanged())); |
162 QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged())); |
159 QObject::connect(control, SIGNAL(cursorPositionChanged()), q, SIGNAL(cursorPositionChanged())); |
|
160 |
|
161 QObject::connect(control, SIGNAL(textChanged()), q, SLOT(updateMicroFocus())); |
163 |
162 |
164 QTextDocument *doc = control->document(); |
163 QTextDocument *doc = control->document(); |
165 // set a null page size initially to avoid any relayouting until the textedit |
164 // set a null page size initially to avoid any relayouting until the textedit |
166 // is shown. relayoutDocument() will take care of setting the page size to the |
165 // is shown. relayoutDocument() will take care of setting the page size to the |
167 // viewport dimensions later. |
166 // viewport dimensions later. |
528 This property gets and sets the text editor's contents as plain |
530 This property gets and sets the text editor's contents as plain |
529 text. Previous contents are removed and undo/redo history is reset |
531 text. Previous contents are removed and undo/redo history is reset |
530 when the property is set. |
532 when the property is set. |
531 |
533 |
532 If the text edit has another content type, it will not be replaced |
534 If the text edit has another content type, it will not be replaced |
533 by plain text if you call toPlainText(). |
535 by plain text if you call toPlainText(). The only exception to this |
|
536 is the non-break space, \e{nbsp;}, that will be converted into |
|
537 standard space. |
534 |
538 |
535 By default, for an editor with no contents, this property contains |
539 By default, for an editor with no contents, this property contains |
536 an empty string. |
540 an empty string. |
537 |
541 |
538 \sa html |
542 \sa html |
1572 d->sendControlEvent(e); |
1578 d->sendControlEvent(e); |
1573 if (d->autoScrollTimer.isActive()) { |
1579 if (d->autoScrollTimer.isActive()) { |
1574 d->autoScrollTimer.stop(); |
1580 d->autoScrollTimer.stop(); |
1575 ensureCursorVisible(); |
1581 ensureCursorVisible(); |
1576 } |
1582 } |
1577 d->handleSoftwareInputPanel(e->button(), d->clickCausedFocus); |
1583 if (!isReadOnly() && rect().contains(e->pos())) |
|
1584 d->handleSoftwareInputPanel(e->button(), d->clickCausedFocus); |
1578 d->clickCausedFocus = 0; |
1585 d->clickCausedFocus = 0; |
1579 } |
1586 } |
1580 |
1587 |
1581 /*! \reimp |
1588 /*! \reimp |
1582 */ |
1589 */ |
1670 #ifdef QT_KEYPAD_NAVIGATION |
1677 #ifdef QT_KEYPAD_NAVIGATION |
1671 if (d->control->textInteractionFlags() & Qt::TextEditable |
1678 if (d->control->textInteractionFlags() & Qt::TextEditable |
1672 && QApplication::keypadNavigationEnabled() |
1679 && QApplication::keypadNavigationEnabled() |
1673 && !hasEditFocus()) { |
1680 && !hasEditFocus()) { |
1674 setEditFocus(true); |
1681 setEditFocus(true); |
|
1682 #ifndef Q_OS_SYMBIAN |
1675 selectAll(); // so text is replaced rather than appended to |
1683 selectAll(); // so text is replaced rather than appended to |
|
1684 #endif |
1676 } |
1685 } |
1677 #endif |
1686 #endif |
1678 d->sendControlEvent(e); |
1687 d->sendControlEvent(e); |
1679 ensureCursorVisible(); |
1688 ensureCursorVisible(); |
1680 } |
1689 } |
1897 /*! |
1906 /*! |
1898 \property QTextEdit::tabStopWidth |
1907 \property QTextEdit::tabStopWidth |
1899 \brief the tab stop width in pixels |
1908 \brief the tab stop width in pixels |
1900 \since 4.1 |
1909 \since 4.1 |
1901 |
1910 |
1902 By default, this property contains a value of 80. |
1911 By default, this property contains a value of 80 pixels. |
1903 */ |
1912 */ |
1904 |
1913 |
1905 int QTextEdit::tabStopWidth() const |
1914 int QTextEdit::tabStopWidth() const |
1906 { |
1915 { |
1907 Q_D(const QTextEdit); |
1916 Q_D(const QTextEdit); |