View Full Version : xhtml/css text formatting

29th October 2007, 10:30
i think you all know kopete. they do the formatting of the chat messages through xhtml/css.
i looked at the code, but it didn't help me really much...
i want to do the same. formatting messages with xhtml/css, but i don't know how i can do it with qt4. i don't watn to use platform dependent code like kliabrirys or sth like that.
does anybody know how to do it in qt4? please add code examples, because i need to undestand this and need to know how to implement it in my project.

29th October 2007, 10:45
I think the default rich text engine can handle a subset of css out of the box (I don't think it provides external stylesheets though). And using WebKit is always an option.

29th October 2007, 10:58
where can i find the webkit for qt4? could you give me some example code? i have really no idea where to start.

29th October 2007, 12:00

29th October 2007, 14:17
ok, after reading some css and html tutorials i checked how css and the styling works......
now i made a minimal test for formatting messages through html/css.
for interests i attached it.

29th October 2007, 14:55
i noticed that qtextedit doesnt support background-image. but i need this...
now is there any qt-text-control-object which fully supports css?
btw i didn't find out what i should do with the qtwebkit...........................

29th October 2007, 19:46
WebKit is an html rendering engine. Safari is based on it and it originated from KDE and was called KHTML (the rendering engine of Konqueror). You may use it as a widget, for example.

30th October 2007, 07:22
when i loadet it from svn, i saw thats over 100mb big..... i havent much downstream and my application is just a little chat, i dont wanna have so big depencies.....

30th October 2007, 09:15
When you compile it, it's probably much much smaller.

30th October 2007, 12:15
I get this error:

..\..\..\WebCore\loader\FTPDirectoryDocument.cpp: In function `WebCore::String W
ebCore::processFileDateString(const WebCore::FTPTime&)':
..\..\..\WebCore\loader\FTPDirectoryDocument.cpp:2 36: error: `localtime_s' undec
lared (first use this function)
..\..\..\WebCore\loader\FTPDirectoryDocument.cpp:2 36: error: (Each undeclared id
entifier is reported only once for each function it appears in.)
mingw32-make[2]: *** [tmp\FTPDirectoryDocument.o] Error 1
im using windows and qt 4.3.2

30th October 2007, 15:21
Qt WebKit is unstable/experimental. If you have trouble compiling it, please try a different revision or contact the maintainer of the project.