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. newline in QDateTimeAxis::setFormat
QtWS25 Last Chance

newline in QDateTimeAxis::setFormat

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 2.0k 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.
  • V Offline
    V Offline
    vorlket
    wrote on last edited by
    #1

    How do you express newline in QDateTimeAxis::setFormat function?

    1 Reply Last reply
    1
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Do you mean like
      QDateTimeAxis *axisX = new QDateTimeAxis;
      axisX->setFormat("dd-MM-yyyy h:mm");
      chartView->chart()->setAxisX(axisX, series);

      It uses the format from
      http://doc.qt.io/qt-5/qdatetime.html

      And there is no concept of new line so
      not sure its possible if its given
      directly to a QDateTime class.

      What did u try ?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vorlket
        wrote on last edited by vorlket
        #3

        Yes.

        Didn't find newline in the document.

        Tried \n and \\n

        Any thought on alternatives enabling newline in the format?

        mrjjM 1 Reply Last reply
        0
        • V vorlket

          Yes.

          Didn't find newline in the document.

          Tried \n and \\n

          Any thought on alternatives enabling newline in the format?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @vorlket

          Im not sure it can contain newline or any other char that is not
          part of the format.

          alt text

          Can I ask why you try to insert newline?

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vorlket
            wrote on last edited by
            #5

            To present information in confined space.

            Is it possible to have the datetime axis in a hierarchical format such as the one below?
            0_1484455427712_a hierarchical datetime axis.png

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Henrik Rasmussen
              wrote on last edited by
              #6

              try <br> it worked for me

              G 1 Reply Last reply
              2
              • H Henrik Rasmussen

                try <br> it worked for me

                G Offline
                G Offline
                GrishinD
                wrote on last edited by
                #7

                @Henrik-Rasmussen Thanks, that helped!

                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