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 7995109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:18:51+00:00 2026-06-04T14:18:51+00:00

I’m building a program that performs some users tests and needs to record data

  • 0

I’m building a program that performs some users tests and needs to record data on what they are doing at very small intervals (every 10ms). Most of the data can be found from QT, but unfortunately I need to use a separate program to calculate mouse movement (I need to get movement even when the mouse has already hit the edge of the screen, but QT just ignores off-screen movement).

Therefore I’ve built a windows program that deals with the low level mouse input and outputs the changes in coordinates detected. The problem however, is that I can’t get the data from the windows program to line up with the output from the main program.

In my main program, I use the follow code.

mouseTracker = new QProcess();
mouseTracker->start("C:\\WindowsFun.exe",QIODevice::ReadWrite|QIODevice::Unbuffered);
mouseTracker->setProcessChannelMode(QProcess::MergedChannels);
connect(mouseTracker,SIGNAL(readyRead()), this, SLOT(readMouseData()),Qt::DirectConnection);

and the readMouseData function looks like this.

void HideWindow::readMouseData(){
    QByteArray data = mouseTracker->readAll();
    QString text = QString(data);
    saveFileStream << text.toStdString();
}

Some of this stuff might be unnecessary. I added in the “MergedChannels” mode and the “DirectConnection” bit in an attempt to solve the problem.

The result I’m getting is that the output from the windows program shows up in large blocks every 100ms or so, rather than being inserted into the filestream right when it occurs. It seems like there is a buffer somewhere that needs to fill, or a delay before the readyRead() signal is processed. Does anyone have any suggestions for how I can get the output from both the main program and the QProcess in real time? (Well, at least with a delay less than 10ms).

Also, if it is important, I am running Windows 7 and using MinGW for compilation of the main program and Visual Studio 2008 for the windows program that detects mouse movement. The output in windows look like this:

int xPosRelative = raw->data.mouse.lLastX;
int yPosRelative = raw->data.mouse.lLastY;
char output[100];
int n;
n = std::sprintf(output,"%d %d",xPosRelative,yPosRelative);
std::printf("%s\n",output,n);
std::fflush(0);

Let me know if anymore information is needed.

Thanks,
-Keilan

  • 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-06-04T14:18:53+00:00Added an answer on June 4, 2026 at 2:18 pm

    Unfortunately, the Windows implementation of QProcess is hard-coded to check once every 100 milliseconds for stdout/stderr from the external process. Looking through the Qt code, you may be able to get around this by calling waitForReadyRead frequently (with a small timeout value).

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace

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.