summaryrefslogtreecommitdiffstats
path: root/tools/qml/texteditautoresizer_maemo5.h
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@nokia.com>2010-06-23 10:15:36 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2010-06-25 06:41:15 (GMT)
commit7294f46ec0c5ea07e438c45a069a618ceb6e17a9 (patch)
tree8349df66066d46d783ce9d16a21ee6a29628fea6 /tools/qml/texteditautoresizer_maemo5.h
parent156cabe79a64ffca8d6e1a2df99f35b413a48a39 (diff)
downloadQt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.zip
Qt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.tar.gz
Qt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.tar.bz2
forgot to cleanup the code a bit after adding Maemo5 support
Diffstat (limited to 'tools/qml/texteditautoresizer_maemo5.h')
-rw-r--r--tools/qml/texteditautoresizer_maemo5.h17
1 files changed, 4 insertions, 13 deletions
diff --git a/tools/qml/texteditautoresizer_maemo5.h b/tools/qml/texteditautoresizer_maemo5.h
index 2b9a5f9..bb5567a 100644
--- a/tools/qml/texteditautoresizer_maemo5.h
+++ b/tools/qml/texteditautoresizer_maemo5.h
@@ -61,7 +61,7 @@ public:
connect(parent, SIGNAL(textChanged()), this, SLOT(textEditChanged()));
connect(parent, SIGNAL(cursorPositionChanged()), this, SLOT(textEditChanged()));
-
+
textEditChanged();
}
@@ -87,36 +87,27 @@ void TextEditAutoResizer::textEditChanged()
const QRect cr = edit->contentsRect();
edit->setMinimumHeight(qMax(70, s.height() + (fr.height() - cr.height() - 1)));
-
-// QString s1;
-// QDebug ts(&s1);
-// ts << "DOC: " << s << " CURSOR: " << cursor << " MINH: " << edit->minimumHeight();
-// fprintf(stderr, "%s\n", qPrintable(s1));
// make sure the cursor is visible in case we have a QAbstractScrollArea parent
QPoint pos = edit->pos();
QWidget *pw = edit->parentWidget();
- while (pw) {
+ while (pw) {
if (qobject_cast<QScrollArea *>(pw))
break;
pw = pw->parentWidget();
}
-
+
if (pw) {
QScrollArea *area = static_cast<QScrollArea *>(pw);
QPoint scrollto = area->widget()->mapFrom(edit, cursor.center());
QPoint margin(10 + cursor.width(), 2 * cursor.height());
-
+
if (QAbstractKineticScroller *scroller = area->property("kineticScroller").value<QAbstractKineticScroller *>()) {
scroller->ensureVisible(scrollto, margin.x(), margin.y());
} else {
area->ensureVisible(scrollto.x(), scrollto.y(), margin.x(), margin.y());
}
}
-// QDebug ts(&s2);
-// ts << "ENSURE VIS: " << pos << " + " << cursor.center() << "(pos + cursor.center())" << scroller->isEnabled() << area;
-// ts << "PW: " << pw << " PPW: " << (pw ? pw->parentWidget() : 0); //ENSURE VIS: " << pos << " + " << cursor.center() << "(pos + cursor.center())" << scroller->isEnabled() << area;
-// fprintf(stderr, "%s\n", qPrintable(s2));
}
#endif