Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt6: QFont::setWeight error when using QTextEdit::setCurrentFont()

Qt6: QFont::setWeight error when using QTextEdit::setCurrentFont()

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 346 Views
  • 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
    rjmx
    wrote on last edited by
    #1

    I'm in the process of getting an app that I built with Qt5 running with Qt6. One thing that's turned up is that when I try to change the font on a QTextEdit with

    textEdit->setCurrentFont(Entry::normalFont);
    

    I get an error on the console:

    QFont::setWeight: Weight must be between 1 and 1000, attempted to set  0
    

    This wasn't happening under Qt5.

    Also looks like someone on Github is having a similar problem:

    https://github.com/texstudio-org/texstudio/issues/3366

    Christian EhrlicherC 1 Reply Last reply
    0
    • R rjmx

      I'm in the process of getting an app that I built with Qt5 running with Qt6. One thing that's turned up is that when I try to change the font on a QTextEdit with

      textEdit->setCurrentFont(Entry::normalFont);
      

      I get an error on the console:

      QFont::setWeight: Weight must be between 1 and 1000, attempted to set  0
      

      This wasn't happening under Qt5.

      Also looks like someone on Github is having a similar problem:

      https://github.com/texstudio-org/texstudio/issues/3366

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @rjmx said in Qt6: QFont::setWeight error when using QTextEdit::setCurrentFont():

      Entry::normalFont

      What is this? a QFont object? Where does it come from?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      • Login

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