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

Deprecate `\oldcode` and `\newcode`

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.3
    • Build tools: qdoc
    • None
    • Da Vinci sprint 44

      QDoc provides a pair of commands, oldcode and newcode, that are used "to show how to port a snippet of code to a new version of an API".

      A usage of the commands-pair resolves to the equivalent of two code-blocks with some text before the first code-block and in-between the two-codeblocks.

      For example:

      \oldcode
          if (printer->setup(parent))
              ...
      \newcode
          QPrintDialog dialog(printer, parent);
              if (dialog.exec())
                  ...
      \endcode
      

      Would be equivalent to:

      For example, if you have code like
      
      \code
          if (printer->setup(parent))
              ...
      \endcode
      
      you can rewrite it as
      
      \code
          QPrintDialog dialog(printer, parent);
              if (dialog.exec())
                  ...
      \endcode
      

      This feature isn't particularly used.
      Indeed, only 15 cases were identified in the current documentation across Qt.

      As the feature has a low usage statistic while being of an arguable utility considering the triviality of producing a similar effect manually, it was marked for removal.

      Hence, deprecate the feature in QDoc and produce a warning for its usage notifying the user that it will be removed in the near future.

      Furthermore, the known usage should be converted to the equivalent non \oldcode-\newcode version.

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

            diseraluca Luca Di Sera
            diseraluca Luca Di Sera
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes