Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. Problem Timing oder Modality
Qt 6.11 is out! See what's new in the release blog

Problem Timing oder Modality

Scheduled Pinned Locked Moved German
3 Posts 2 Posters 1.9k 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.
  • T Offline
    T Offline
    Tischendorf
    wrote on last edited by
    #1

    Warum kann ich in beiden Fällen den Text: "Vor ... " nicht lesen?

    void Widget::MyMethodeSleepTest()
    {
    label->setText("vor SLEEP()"); Sleep(1000); label->setText("nach SLEEP");
    }
    void Widget::MyMethodeTimeTest()
    {
    QTime time; label->setText("vor Time()");
    time.start(); while (time.elapsed() < 1000);
    label->setText("nach Time");
    }
    Es scheint, als ob die Schleifen Sleep (windows.h) oder while betreten werden, bevor die setText-Methode
    abgearbeitet ist.
    Weiss einer Rat?#
    T.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      brcontainer
      wrote on last edited by
      #2

      Sie verwenden einen "Thread"?

      Versuchen Sie es mit "QThread::msleep"

      @QThread::sleep(secs);//seconds
      QThread::msleep(msecs);//milleseconds
      QThread::usleep(usecs);//microseconds@

      QT project: https://github.com/brcontainer/qt-helper

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tischendorf
        wrote on last edited by
        #3

        Danke, ich habe bisher (bewusst) noch keine Threads benutzt, werde es also probieren.

        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