Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. updating qt4 to qt5 LogText is replaced with?

updating qt4 to qt5 LogText is replaced with?

Scheduled Pinned Locked Moved Solved General and Desktop
linuxqt creator 4.11c++
3 Posts 2 Posters 449 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.
  • M Offline
    M Offline
    micha_eleric
    wrote on 20 Mar 2022, 23:05 last edited by
    #1

    qt4 code:

    label_3->setTextFormat(Qt::LogText);
    

    found a post that said replace "LogText", with "TextFormat", however,

    label_3->setTextFormat(Qt::TextFormat);
    

    results in

    /home/michaeleric/GUI/CUi_MainWindow.h:1616: error: expected primary-expression before ‘)’ token
     1616 |         label_3->setTextFormat(Qt::TextFormat);
          |                                              ^
    

    does someone know what is going on?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mpergand
      wrote on 20 Mar 2022, 23:53 last edited by mpergand
      #2

      enum Qt::TextFormat

      Constant         Value   Description
      Qt::PlainText      0      The text string is interpreted as a plain text string.
      Qt::RichText       1      The text string is interpreted as a rich text string. See Supported HTML Subset for the definition of rich text.
      Qt::AutoText       2      The text string is interpreted as for Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
      
      M 1 Reply Last reply 21 Mar 2022, 00:06
      2
      • M mpergand
        20 Mar 2022, 23:53

        enum Qt::TextFormat

        Constant         Value   Description
        Qt::PlainText      0      The text string is interpreted as a plain text string.
        Qt::RichText       1      The text string is interpreted as a rich text string. See Supported HTML Subset for the definition of rich text.
        Qt::AutoText       2      The text string is interpreted as for Qt::RichText if Qt::mightBeRichText() returns true, otherwise as Qt::PlainText.
        
        M Offline
        M Offline
        micha_eleric
        wrote on 21 Mar 2022, 00:06 last edited by
        #3

        @mpergand thank you. "PlainText" fix it

        1 Reply Last reply
        0

        1/3

        20 Mar 2022, 23:05

        • Login

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