Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. integers numbers to time format conversion

integers numbers to time format conversion

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 2 Posters 510 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
    Chobin
    wrote on last edited by
    #1

    Hello,

    In a QML file I read two integer numbers (quint16), from a C++ class. These numbers are hours and minute.

    I need to build a format time string and showen it.

    Example: hour = 4, minutes = 5, the QML file has showen 04:05

    My current result is: 4:5.

    Could someone help me, please?

    Many thanks in advance for your support.

    Best Regards,

    Chobin

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Construct the strings in C++ and pass them to QML as strings. That is the simplest solution. In fact, QDateTime can help you greatly here, see its toString() method.

      (Z(:^

      1 Reply Last reply
      3

      • Login

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