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. QDateTimeAxis - how to set format of date the same as system has, but without time?

QDateTimeAxis - how to set format of date the same as system has, but without time?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 150 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.
  • C Offline
    C Offline
    CuriousPan
    wrote on last edited by
    #1

    I have QDateTimeAxis, but in order to be consistent I'd like it to have date format the same as any system my application is run on has. Also, I'd like to remove time from it. Is there a way to do it?

    f60c2419-5532-4dc0-9a3b-2ef869b37234-image.png

    1 Reply Last reply
    0
    • artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #2

      @CuriousPan said in QDateTimeAxis - how to set format of date the same as system has, but without time?:

      QDateTimeAxis

      Should you feel brave and actually spend 30 seconds looking into the documentation, like I did, you would notice that there is a setFormat() method: https://doc.qt.io/qt-5/qdatetimeaxis.html#format-prop

      And that it takes well known format strings from QDateTime: https://doc.qt.io/qt-5/qdatetime.html#toString

      For more information please re-read.

      Kind Regards,
      Artur

      1 Reply Last reply
      1

      • Login

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