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
Forum Updated to NodeBB v4.3 + New Features

QTextFormat: custom properties

Scheduled Pinned Locked Moved Unsolved General and Desktop
feature-requestqtextformat
4 Posts 3 Posters 317 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.
  • N Offline
    N Offline
    Nightrider
    wrote on 26 Feb 2024, 08:29 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.

    C 1 Reply Last reply 26 Feb 2024, 08:33
    0
    • N Nightrider
      26 Feb 2024, 08:29

      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.

      C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 26 Feb 2024, 08:33 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 26 Feb 2024, 08:56
      0
      • C Christian Ehrlicher
        26 Feb 2024, 08:33

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

        N Offline
        N Offline
        Nightrider
        wrote on 26 Feb 2024, 08:56 last edited by
        #3

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

        J 1 Reply Last reply 26 Feb 2024, 09:16
        0
        • N Nightrider
          26 Feb 2024, 08:56

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

          J Offline
          J Offline
          JonB
          wrote on 26 Feb 2024, 09:16 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

          1/4

          26 Feb 2024, 08:29

          • Login

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