summaryrefslogtreecommitdiffstats
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
parent156cabe79a64ffca8d6e1a2df99f35b413a48a39 (diff)
downloadQt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.zip
Qt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.tar.gz
Qt-7294f46ec0c5ea07e438c45a069a618ceb6e17a9.tar.bz2
forgot to cleanup the code a bit after adding Maemo5 support
-rw-r--r--tools/qml/loggerwidget.cpp4
-rw-r--r--tools/qml/qmlruntime.cpp8
-rw-r--r--tools/qml/texteditautoresizer_maemo5.h17
3 files changed, 10 insertions, 19 deletions
diff --git a/tools/qml/loggerwidget.cpp b/tools/qml/loggerwidget.cpp
index 71d20e8..8aa029f 100644
--- a/tools/qml/loggerwidget.cpp
+++ b/tools/qml/loggerwidget.cpp
@@ -63,7 +63,7 @@ LoggerWidget::LoggerWidget(QWidget *parent) :
setWindowTitle(tr("Warnings"));
m_plainTextEdit = new QPlainTextEdit();
-
+
#ifdef Q_WS_MAEMO_5
new TextEditAutoResizer(m_plainTextEdit);
setAttribute(Qt::WA_Maemo5StackedWindow);
@@ -71,7 +71,7 @@ LoggerWidget::LoggerWidget(QWidget *parent) :
area->setWidget(m_plainTextEdit);
area->setWidgetResizable(true);
setCentralWidget(area);
-#else
+#else
setCentralWidget(m_plainTextEdit);
#endif
readSettings();
diff --git a/tools/qml/qmlruntime.cpp b/tools/qml/qmlruntime.cpp
index 090ca2a..3a8af60 100644
--- a/tools/qml/qmlruntime.cpp
+++ b/tools/qml/qmlruntime.cpp
@@ -254,9 +254,9 @@ public:
sizeWidth->setValue(s.width());
sizeHeight->setValue(s.height());
}
-#endif
+#endif
}
-
+
void showffmpegOptions(bool b)
{
#ifdef Q_WS_MAEMO_5
@@ -268,7 +268,7 @@ public:
ffmpegOptions->setVisible(b);
#endif
}
-
+
void showRateOptions(bool b)
{
#ifdef Q_WS_MAEMO_5
@@ -297,7 +297,7 @@ public:
idx = 6;
else
idx = 7;
- rateCombo->setCurrentIndex(idx);
+ rateCombo->setCurrentIndex(idx);
#else
if (rate == 24)
hz24->setChecked(true);
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