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

  • Home
  • SEARCH
  • 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 6158551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:58:32+00:00 2026-05-23T20:58:32+00:00

I created a multithreaded application in Qt (4.7.2). Only the main thread has an

  • 0

I created a multithreaded application in Qt (4.7.2). Only the main thread has an event loop.

The issue is that sometimes I get the following warning in the console:

QObject::startTimer: timers cannot be started from another thread

After this happens, the app consumes 100% of CPU (I have a single core CPU). It seems, that the main thread consumes all of the CPU’s resources. The program does not freeze, and everything still works.

When I stop the program in the debugger, I do not see my code in the call stack.

The problem is that I’m not using (explicitly, anyway) timers at all.

What could it be connected with? I know, that question is very common, but I can’t even understand, what piece of code to show.

  • 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-23T20:58:33+00:00Added an answer on May 23, 2026 at 8:58 pm

    Thanks, to @vrince I’ve fixed the problem. I used signals/slots mechanism + Qt::QueuedConnection to communicate with GUI

    For example, if I need to set text of QLabel from worker thread, I can make in my worker thread signal

    void textChanged(QString);
    

    then I connect this signal to the slot of QLabel using Qt::QueuedConnection

    connect(worker, SIGNAL(textChanged(QString)), label, SLOT(setText(QString), Qt::QueuedConnection);
    

    If I want to execute setText synchronously, I can use Qt::BlockingQueuedConnection

    now in my worker thread I just emit signal:

    emit textChanged(newText);
    

    Also, it is possible to use QMetaObject functions to avoid signals and slots:

    metaObject->invokeMethod(label, "setText", Qt::QueuedConnection, Q_ARG(QString, text));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a Rails application normally. Then created the scaffold for an event class.
I have the following problem: Multithreaded WPF application, Model View Presenter Implementation. Presenters and
I have created a multi-threaded application that runs fine on every system except for
How to handle database connection with multithreaded application. I have developed one application that
I have an email account on a remote server. I created an application that
I have this code will work in multithreaded application. I know that immutable object
I've written a simple multi-threaded game server in python that creates a new thread
i'm working with a multi-threaded program (using pthreads) that currently create a background thread
I created a simple .NET windows application in Visual Studio 2005 and on just
I want to write my first real MultiThreaded C# Application. While I used 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.