diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-09 19:45:31 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-06-09 19:45:31 (GMT) |
commit | 25fd8c268acdcc9ab4918738040e7d70210bd686 (patch) | |
tree | 26c75fc83b163c7e867392eb5a2cd03eff06e9fc /src/declarative/qml | |
parent | 80cbb6adaa134447469fde80076a8ec57ef00960 (diff) | |
parent | 518a4668666f64a9ad996ac797bdaa676c54fd41 (diff) | |
download | Qt-25fd8c268acdcc9ab4918738040e7d70210bd686.zip Qt-25fd8c268acdcc9ab4918738040e7d70210bd686.tar.gz Qt-25fd8c268acdcc9ab4918738040e7d70210bd686.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (29 commits)
Small optimization when checking if MouseArea's onPressAndHold is
Fix autotest.
Fixed `nmake clean' breaking declarative imports on Windows.
Fix drawing flicker on Qml Viewer startup
Fix snake demo
Add qmlmethod Item::childAt() to delarative item
Cursor positioning in QTextDocument after undo()
Fix slow network access in qmlviewer (Windows)
Don't layout multiple times when an ancestor becomes (in)visible.
Add an example of animated item add/remove in ListView
Add test for PropertyChanges with attached properties.
Make declarative autotests compile on Symbian abld build system
Accept enter key in the webbrower demo url input.
Keep reported point/pixel size in sync.
Remove unnecessary CloseSoftwareInputPanel events after TextEdit or TextInput has lost focus
Ensure state operations assigned to the default state are triggered
Add image example.
Fix regression in input panel autotests
Improve docs about Qml component case sensitivity.
Add some performance tips to QML docs.
...
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qdeclarativevaluetype.cpp | 12 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativevaluetype_p.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index dbc25bb..c17ec95 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -47,6 +47,8 @@ QT_BEGIN_NAMESPACE +Q_DECL_IMPORT extern int qt_defaultDpi(); + template<typename T> int qmlRegisterValueTypeEnums(const char *qmlName) { @@ -909,6 +911,11 @@ void QDeclarativeFontValueType::setStrikeout(bool b) qreal QDeclarativeFontValueType::pointSize() const { + if (font.pointSizeF() == -1) { + if (dpi.isNull) + dpi = qt_defaultDpi(); + return font.pixelSize() * qreal(72.) / qreal(dpi); + } return font.pointSizeF(); } @@ -929,6 +936,11 @@ void QDeclarativeFontValueType::setPointSize(qreal size) int QDeclarativeFontValueType::pixelSize() const { + if (font.pixelSize() == -1) { + if (dpi.isNull) + dpi = qt_defaultDpi(); + return (font.pointSizeF() * dpi) / qreal(72.); + } return font.pixelSize(); } diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h index 3eaecc1..4b1bbd6 100644 --- a/src/declarative/qml/qdeclarativevaluetype_p.h +++ b/src/declarative/qml/qdeclarativevaluetype_p.h @@ -55,6 +55,7 @@ #include "qdeclarativeproperty.h" #include "private/qdeclarativeproperty_p.h" +#include "private/qdeclarativenullablevalue_p_p.h" #include <QtCore/qobject.h> #include <QtCore/qrect.h> @@ -547,6 +548,7 @@ private: QFont font; bool pixelSizeSet; bool pointSizeSet; + mutable QDeclarativeNullableValue<int> dpi; }; QT_END_NAMESPACE |