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. QTextFormat: custom properties
QtWS25 Last Chance

QTextFormat: custom properties

Scheduled Pinned Locked Moved Unsolved General and Desktop
feature-requestqtextformat
4 Posts 3 Posters 299 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.
  • N Offline
    N Offline
    Nightrider
    wrote on last edited by
    #1

    I want to attach additional management data to QTextFormat objects. This is easy enough with QTextFormat::setProperty(...). Great.

    However, from the documentation (https://doc.qt.io/qt-6/qtextformat.html#Property-enum) it is not obvious which property Ids are reserved by Qt, and which ones are free to use for customizing. Is QTextFormat::UserProperty meant for that?

    I suggest that you add add a block of Ids for use by the application, not to be used in future Qt versions.

    Christian EhrlicherC 1 Reply Last reply
    0
    • N Nightrider

      I want to attach additional management data to QTextFormat objects. This is easy enough with QTextFormat::setProperty(...). Great.

      However, from the documentation (https://doc.qt.io/qt-6/qtextformat.html#Property-enum) it is not obvious which property Ids are reserved by Qt, and which ones are free to use for customizing. Is QTextFormat::UserProperty meant for that?

      I suggest that you add add a block of Ids for use by the application, not to be used in future Qt versions.

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

      As for Qt::UserRole your properties must be greater or equal to QTextFormat::UserProperty.

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

      N 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        As for Qt::UserRole your properties must be greater or equal to QTextFormat::UserProperty.

        N Offline
        N Offline
        Nightrider
        wrote on last edited by
        #3

        @Christian-Ehrlicher Thanks! That's what I expected. A clarifying sentence in the docs would be helpful.

        JonBJ 1 Reply Last reply
        0
        • N Nightrider

          @Christian-Ehrlicher Thanks! That's what I expected. A clarifying sentence in the docs would be helpful.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Nightrider said in QTextFormat: custom properties:

          A clarifying sentence in the docs would be helpful.

          As per your other threads there is no point making/nobody reading "suggestions" here, this is a user forum, for users of Qt just like yourself. If you want to make suggestions for changes in Qt (including documentation) you need to direct those to TQtC via https://bugreports.qt.io/.

          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