Results 1 to 11 of 11

Thread: xhtml/css text formatting

  1. #1
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default xhtml/css text formatting

    hi!
    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.
    thx

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: xhtml/css text formatting

    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.

  3. #3
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xhtml/css text formatting

    where can i find the webkit for qt4? could you give me some example code? i have really no idea where to start.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: xhtml/css text formatting


  5. #5
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xhtml/css text formatting

    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.
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xhtml/css text formatting

    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...........................

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: xhtml/css text formatting

    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.

  8. #8
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xhtml/css text formatting

    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.....

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: xhtml/css text formatting

    When you compile it, it's probably much much smaller.

  10. #10
    Join Date
    Jan 2007
    Posts
    177
    Thanks
    8
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xhtml/css text formatting

    I get this error:
    Qt Code:
    1. ..\..\..\WebCore\loader\FTPDirectoryDocument.cpp: In function `WebCore::String W
    2. ebCore::processFileDateString(const WebCore::FTPTime&)':
    3. ..\..\..\WebCore\loader\FTPDirectoryDocument.cpp:236: error: `localtime_s' undec
    4. lared (first use this function)
    5. ..\..\..\WebCore\loader\FTPDirectoryDocument.cpp:236: error: (Each undeclared id
    6. entifier is reported only once for each function it appears in.)
    7. mingw32-make[2]: *** [tmp\FTPDirectoryDocument.o] Error 1
    To copy to clipboard, switch view to plain text mode 
    im using windows and qt 4.3.2

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: xhtml/css text formatting

    Qt WebKit is unstable/experimental. If you have trouble compiling it, please try a different revision or contact the maintainer of the project.

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  3. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  4. visible text of textedit
    By regix in forum Qt Programming
    Replies: 3
    Last Post: 26th June 2006, 09:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.