Use the convential form for the selectedText notify signal name.
authorAndrew den Exter <andrew.den-exter@nokia.com>
Fri, 29 Jun 2012 07:20:16 +0000 (17:20 +1000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 2 Jul 2012 02:23:20 +0000 (04:23 +0200)
Rename selectionChanged to selectedTextChanged to address an apparent
difference to API between TextInput and TextEdit.

Task-number: QTBUG-19732
Change-Id: Ibc589c8b43567cb8d2f8c13f7366e2859c7f09d7
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquicktextedit.cpp
src/quick/items/qquicktextedit_p.h
tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp

index 5206785..7222c17 100644 (file)
@@ -1750,7 +1750,7 @@ void QQuickTextEditPrivate::init()
     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()));
index b19873c..2b02a4a 100644 (file)
@@ -83,7 +83,7 @@ class Q_AUTOTEST_EXPORT QQuickTextEdit : public QQuickImplicitSizeItem
     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)
@@ -240,7 +240,7 @@ Q_SIGNALS:
     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);
index f893385..50a660b 100644 (file)
@@ -1365,7 +1365,7 @@ void tst_qquicktextedit::keySelection()
     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);
@@ -3511,7 +3511,7 @@ void tst_qquicktextedit::insert()
     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()));
@@ -3535,8 +3535,8 @@ void tst_qquicktextedit::insert()
     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);
@@ -3756,7 +3756,7 @@ void tst_qquicktextedit::remove()
     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()));
@@ -3779,8 +3779,8 @@ void tst_qquicktextedit::remove()
     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);