Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126873

Provide std::format-like formatting into QString

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      After discussing with SG16, we figured out that formatting into char16_t isn't likely to happen even in C++26 (although the situation still may change, as we're only mid 2024 now).

      So, if we want to provide an std::format-like API for formatting into QString, we need to implement it on our own.
      In the SG16 mailing list Thiago suggested that we provide our own qFormat(), which would act like a wrapper on top of std::format_to, and also a custom OutputIterator, which would allow us to pre-allocate the needed space in the buffer, and also format directly into the buffer.

      That, of course, means that we also need to provide support for the custom output iterator for build-in types at least.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cnn Qt Core & Network
            ivan.solovev Ivan Solovev
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes