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

toString method class

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 3.x
    • 5.4.1
    • Core: Object Model
    • None

    Description

      In java, python and ruby, as I know, there is a "ToString" method class which allow debugging easily..
      For example , you can print an instance :

      class Car
      def _toString_():
      return "car"
      Car myCar
      print(myCar).

      It would be greate to have the same feature for QObject and use it with qDebug(). Actually, overload the QDebug class operator << is not cute.

      class Car : public QObject
      {
      QString toString()

      { return "car"; }

      }

      qDebug()<<car;

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            dridk sacha schutz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes