Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Rich text formatting font changing problem, working code example
Forum Updated to NodeBB v4.3 + New Features

Rich text formatting font changing problem, working code example

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    redturtlepower
    wrote on last edited by
    #1

    Hello, I have a problem with changing font in a qtextbrowser.
    Or let it be qtextedit, does not matter.
    I can change everything, like making text underlined, change its color, and so on, and if I overwrite it with, let's say italic, it keeps the old underline and the other formats.
    But not, if I change the font! I am really without a clue here. Perhaps I don't see the point through all this stuff, because you can interact with the text's format in so many ways.. QTextCursor, QTextCharFormat, QTextEdit also...
    Please try out the code below!
    To change fontsize, hold ctrl and scroll with mousewheel. Set bold with Ctrl+B. Change fontsize with click on button. Why does the fontchange remove underline, bold, (italic, ...) and size? Why does it not remove the font color?

    Here is my code, it is fully working:

    http://stackoverflow.com/questions/18515086/rich-text-formatting-setting-font-overwrites-other-settings-like-underline-poi

    I could not post it here, because it is too long.

    Thank you.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved