You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Wednesday, August 8th 2012, 5:53pm

Qt Creator stdin for command line with Deploy to Remote Linux Host

I am using the Remote Deploy feature of Qt Creator to launch my
simple command line application on an embedded Linux target board. My
test application is extremely simple and asks the user to print his/her
name. It crosscompiles, transfers to the board, and launches and the
'Application Output' window near the bottom of Qt Creator shows the
'Type your name:' prompt, but I cannot type anywhere and provide stdin
to the application running remotely through Qt Creator.


How can I accomplish this within Qt Creator? Can I somehow manipulate
the deploy 'arguments' to connect a device to provide stdin to my
command line app? I also cannot launch the application remotely by
checking the 'run in terminal' checkbox under Projects > Run
Configuration since it is not available for remote deployments.


Code:


Source code

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

using namespace std;

int main() {
    cout << "Enter a number: ";
    int nb;
    cin>>nb;
    cout << "Here is your number:" << nb << endl;
    return 0;
}



Application Output in Qt Creator:


Source code

1
2
3
4
Killing remote process(es)...
Starting remote process ...
Remote process started.
Enter a number: d