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. Constructor error
Qt 6.11 is out! See what's new in the release blog

Constructor error

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 851 Views 1 Watching
  • 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.
  • michalt38M Offline
    michalt38M Offline
    michalt38
    wrote on last edited by
    #1

    Hello. I want to create a QTime object inside a function and I've got this error:
    constexpr QTime::QTime(int) is private
    within this context
    Do you know how to solve this problem?

    jsulmJ 1 Reply Last reply
    0
    • michalt38M michalt38

      Hello. I want to create a QTime object inside a function and I've got this error:
      constexpr QTime::QTime(int) is private
      within this context
      Do you know how to solve this problem?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @michalt38 QTime provides two public constructors:

      QTime::QTime()
      QTime::QTime(int h, int m, int s = 0, int ms = 0)
      

      There is no public constructor with one int parameter.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • michalt38M Offline
        michalt38M Offline
        michalt38
        wrote on last edited by
        #3

        Thanks for help :)

        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