qmlobject_connect(control, QQuickTextControl, SIGNAL(updateRequest(QRectF)), q, QQuickTextEdit, SLOT(updateDocument()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(updateCursorRequest()), q, QQuickTextEdit, SLOT(updateCursor()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(textChanged()), q, QQuickTextEdit, SLOT(q_textChanged()));
- qmlobject_connect(control, QQuickTextControl, SIGNAL(selectionChanged()), q, QQuickTextEdit, SIGNAL(selectionChanged()));
+ qmlobject_connect(control, QQuickTextControl, SIGNAL(selectionChanged()), q, QQuickTextEdit, SIGNAL(selectedTextChanged()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(selectionChanged()), q, QQuickTextEdit, SLOT(updateSelectionMarkers()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(cursorPositionChanged()), q, QQuickTextEdit, SLOT(updateSelectionMarkers()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(cursorPositionChanged()), q, QQuickTextEdit, SIGNAL(cursorPositionChanged()));
Q_PROPERTY(QQmlComponent* cursorDelegate READ cursorDelegate WRITE setCursorDelegate NOTIFY cursorDelegateChanged)
Q_PROPERTY(int selectionStart READ selectionStart NOTIFY selectionStartChanged)
Q_PROPERTY(int selectionEnd READ selectionEnd NOTIFY selectionEndChanged)
- Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectionChanged)
+ Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
Q_PROPERTY(bool activeFocusOnPress READ focusOnPress WRITE setFocusOnPress NOTIFY activeFocusOnPressChanged)
Q_PROPERTY(bool persistentSelection READ persistentSelection WRITE setPersistentSelection NOTIFY persistentSelectionChanged)
Q_PROPERTY(qreal textMargin READ textMargin WRITE setTextMargin NOTIFY textMarginChanged)
void cursorRectangleChanged();
void selectionStartChanged();
void selectionEndChanged();
- void selectionChanged();
+ void selectedTextChanged();
void colorChanged(const QColor &color);
void selectionColorChanged(const QColor &color);
void selectedTextColorChanged(const QColor &color);
QVERIFY(input != 0);
QTRY_VERIFY(input->hasActiveFocus() == true);
- QSignalSpy spy(input, SIGNAL(selectionChanged()));
+ QSignalSpy spy(input, SIGNAL(selectedTextChanged()));
simulateKey(&canvas, Qt::Key_Right, Qt::ShiftModifier);
QVERIFY(input->hasActiveFocus() == true);
textEdit->setTextFormat(textFormat);
textEdit->select(selectionStart, selectionEnd);
- QSignalSpy selectionSpy(textEdit, SIGNAL(selectionChanged()));
+ QSignalSpy selectionSpy(textEdit, SIGNAL(selectedTextChanged()));
QSignalSpy selectionStartSpy(textEdit, SIGNAL(selectionStartChanged()));
QSignalSpy selectionEndSpy(textEdit, SIGNAL(selectionEndChanged()));
QSignalSpy textSpy(textEdit, SIGNAL(textChanged()));
if (selectionStart > selectionEnd)
qSwap(selectionStart, selectionEnd);
- QEXPECT_FAIL("into selection", "selectionChanged signal isn't emitted on edits within selection", Continue);
- QEXPECT_FAIL("into reversed selection", "selectionChanged signal isn't emitted on edits within selection", Continue);
+ QEXPECT_FAIL("into selection", "selectedTextChanged signal isn't emitted on edits within selection", Continue);
+ QEXPECT_FAIL("into reversed selection", "selectedTextChanged signal isn't emitted on edits within selection", Continue);
QCOMPARE(selectionSpy.count() > 0, selectionChanged);
QCOMPARE(selectionStartSpy.count() > 0, selectionStart != expectedSelectionStart);
QEXPECT_FAIL("into reversed selection", "selectionEndChanged signal not emitted", Continue);
textEdit->setTextFormat(textFormat);
textEdit->select(selectionStart, selectionEnd);
- QSignalSpy selectionSpy(textEdit, SIGNAL(selectionChanged()));
+ QSignalSpy selectionSpy(textEdit, SIGNAL(seletedTextChanged()));
QSignalSpy selectionStartSpy(textEdit, SIGNAL(selectionStartChanged()));
QSignalSpy selectionEndSpy(textEdit, SIGNAL(selectionEndChanged()));
QSignalSpy textSpy(textEdit, SIGNAL(textChanged()));
QCOMPARE(textEdit->selectionEnd(), expectedSelectionEnd);
QCOMPARE(textEdit->cursorPosition(), expectedCursorPosition);
- QEXPECT_FAIL("from selection", "selectionChanged signal isn't emitted on edits within selection", Continue);
- QEXPECT_FAIL("from reversed selection", "selectionChanged signal isn't emitted on edits within selection", Continue);
+ QEXPECT_FAIL("from selection", "selectedTextChanged signal isn't emitted on edits within selection", Continue);
+ QEXPECT_FAIL("from reversed selection", "selectedTextChanged signal isn't emitted on edits within selection", Continue);
QCOMPARE(selectionSpy.count() > 0, selectionChanged);
QCOMPARE(selectionStartSpy.count() > 0, selectionStart != expectedSelectionStart);
QEXPECT_FAIL("from reversed selection", "selectionEndChanged signal not emitted", Continue);