Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7672439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:17:09+00:00 2026-05-31T16:17:09+00:00

I am making something in a Qt Widget Project, coded in C++. Because of

  • 0

I am making something in a Qt Widget Project, coded in C++. Because of what I need to do, I need infinite looping, and after doing my research, I realized that infinite looping in an object’s event doesn’t work, and instead, I need to use a some threading..

  1. I decided to use QTimer, but am thinking about using QThread. Which one should I use?
  2. This is my QTimer code, which doesn’t seem to work:

    Clock_Application::Clock_Application(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::Clock_Application)
    {
        ui->setupUi(this);
        QTimer *timer_Stopwatch = new QTimer(this);
        connect(timer_Stopwatch, SIGNAL(timeout()), this, SLOT(timer_Start()));
        timer_Stopwatch->start(1000);
    }
    

Edit: a simple fix to this solution is using the QCoreApplication::processEvents() function, after every iteration of the loop, as that allows the widget application to process necessary events. This is a quick fix however, and using the QTimer library is a better way to fix it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:17:10+00:00Added an answer on May 31, 2026 at 4:17 pm

    As you suggest yourself, performing your processing in a separate thread would be an option and I would surely look into doing that. I don’t think that the QTimer as you show it will help.

    A quick fix however would be to manually call QCoreApplication::processEvents() at the end of each loop. This will make sure that all the pending events get processed by Qt, keeping your UI responsive.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just making something to start up minecraft with , and I need
I have a doctrine model that has a method getSomethingId() and I'm making something
I'm making an AutoSuggest widget for a website, which works in the way that
I'm making something that requires me to pass information from one domain to a
I am making something that needs to get the HWID of a cmoputer, cross-platform.
I'm making something that writes data to a file. Now the problem I'm facing
I'm making a program that imports a custom widget that is a class (it
So I'm making something for which users need to upload images from a canvas
When making something const in C++ what makes it that you cannot for example
I was thinking about making something like Linq for Lua, and I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.