[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/unity/WebKit/WebCore/platform/qt
From: Nikolas Zimmermann <wildfox () kde ! org>
Date: 2006-07-29 18:08:11
Message-ID: 1154196491.409527.17022.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 567663 by wildfox:
Some more stubs done, all important ones I think.
M +23 -12 HelperQt.h
M +13 -4 LineEditQt.cpp
--- branches/work/unity/WebKit/WebCore/platform/qt/HelperQt.h #567662:567663
@@ -24,6 +24,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <QFont>
+
+#include "Font.h"
#include "AtomicString.h"
#include "PlatformString.h"
@@ -31,21 +34,29 @@
namespace WebCore {
- inline QString toQString(const AtomicString& str)
- {
- return QString(reinterpret_cast<const QChar *>(str.characters()), str.length());
- }
+ // String tools
+ inline QString toQString(const AtomicString& str)
+ {
+ return QString(reinterpret_cast<const QChar *>(str.characters()), str.length());
+ }
- inline QString toQString(const WebCore::String& str)
- {
- return QString(reinterpret_cast<const QChar *>(str.characters()), str.length());
- }
+ inline QString toQString(const WebCore::String& str)
+ {
+ return QString(reinterpret_cast<const QChar *>(str.characters()), str.length());
+ }
- inline WebCore::String fromQString(const QString& str)
- {
- return WebCore::String(reinterpret_cast<const UChar *>(str.constData()), str.length());
- }
+ inline WebCore::String fromQString(const QString& str)
+ {
+ return WebCore::String(reinterpret_cast<const UChar *>(str.constData()), str.length());
+ }
+ // Font tools
+ inline QFont toQFont(const WebCore::Font& font)
+ {
+ Q_ASSERT(font.primaryFont() != 0);
+ return font.primaryFont()->platformData().font();
+ }
+
};
// vim: ts=4 sw=4 et
--- branches/work/unity/WebKit/WebCore/platform/qt/LineEditQt.cpp #567662:567663
@@ -102,9 +102,9 @@
return false;
}
-void PlatformLineEdit::setFont(const WebCore::Font&)
+void PlatformLineEdit::setFont(const WebCore::Font& font)
{
- notImplemented();
+ m_lineEdit->setFont(toQFont(font));
}
void PlatformLineEdit::setMaxLength(int length)
@@ -137,9 +137,18 @@
return fromQString(m_lineEdit->text());
}
-void PlatformLineEdit::setWritingDirection(WebCore::TextDirection)
+void PlatformLineEdit::setWritingDirection(WebCore::TextDirection dir)
{
- notImplemented();
+ Qt::LayoutDirection qDir;
+
+ switch(dir)
+ {
+ default:
+ case LTR: qDir = Qt::LeftToRight; break;
+ case RTL: qDir = Qt::RightToLeft; break;
+ }
+
+ m_lineEdit->setLayoutDirection(qDir);
}
void PlatformLineEdit::selectAll()
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic