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. How do I change the clock type in a QElaspedTimer?
Qt 6.11 is out! See what's new in the release blog

How do I change the clock type in a QElaspedTimer?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 672 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.
  • H Offline
    H Offline
    Hyperspider Software
    wrote on last edited by
    #1

    I was every trouble trying to change my Clock type in a QElasped but it keeps on getting an error saying that the expression must be a ivalue.

    Any ways to do this?

    //Err \/
    frameTimer.clockType() = QElapsedTimer::PerformanceCounter;
    
    JonBJ 1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by
      #2

      wrong assignment. The return value of clockType() is not a reference.
      frameTimer.clockType() = QElapsedTimer::PerformanceCounter;

      1 Reply Last reply
      0
      • H Hyperspider Software

        I was every trouble trying to change my Clock type in a QElasped but it keeps on getting an error saying that the expression must be a ivalue.

        Any ways to do this?

        //Err \/
        frameTimer.clockType() = QElapsedTimer::PerformanceCounter;
        
        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #3

        @Hyperspider-Software
        You cannot change it, it is just telling you what it is using on the platform.
        https://doc.qt.io/qt-6/qelapsedtimer.html#ClockType-enum

        H 1 Reply Last reply
        0
        • JonBJ JonB

          @Hyperspider-Software
          You cannot change it, it is just telling you what it is using on the platform.
          https://doc.qt.io/qt-6/qelapsedtimer.html#ClockType-enum

          H Offline
          H Offline
          Hyperspider Software
          wrote on last edited by
          #4

          @JonB Oh yea, I see,
          Thanks!

          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