Thanks wysota for your help. now everything works perfectly. It compiles and works...thank you very much.
And also thanks for high_flyer for your help at the beginning, you helped me a lot with my firsts steps.
Thanks wysota for your help. now everything works perfectly. It compiles and works...thank you very much.
And also thanks for high_flyer for your help at the beginning, you helped me a lot with my firsts steps.
Have you noticed the errors you had made (especially the fact that the process didn't have a chance to start at all)?
yes, now I know how I have to add the arguments to the process and how I have to connect it to the signal and the slot and start it. And also is more clear why I have to wait to read from the process.
But now i have one question, what about if what I want to do is to ask something to the user of the program and then read the answer from the gui?
As I can guess, I have to start the process in the same way as before, and then create another function in the same way as onProcessReadyRead() and inside this function is where I have to read the value, isn't It?
thanks again.
You can write to standard input of a process just like you read from its standard output, if that was your question...
Ok, I can write to the standard input of the process, and also I know how to pass the arguments to the process.
The problem is that I have to ask for three values to the user of the program. The three questions have to appear on the textEdit area of the GUI, one after another, and after each question I have to wait for the answer and get the value that the user types into the textEdit area. I know how to do that the questions appears into the textEdit area, but I don't know how to take the values after each question and put these values into the process as an input value, to add it using addArgument() to the process.
Can anybody help me?
You want the values to be passed as arguments to the process or to be written to the process standard input?
To be passed to the process as arguments, like:
proc->addArgument("value_written_by_the_user");
Ask the user through a dialog or other layout of lineedits about the values and then fire the slot where you start the process and add those values as arguments for the process.
I'm sorry but now I'm completely lost. I created the dialog as you said, to ask the user about the values that I need, and now I have the file fedfangdialog.ui , when I compile the main project as always, It appear automatically two files: redfangdialog.h and redfangdialog.cpp.
And now my question.
What I want that the project does is:
I have one main GUI, with the menu and the textEdit areas. Now, as I can guess, what I have to achieve is that one of the buttons, the redFang button, launch the redfangdialog dialog.
I put in the redfangdialog one button to start all the process, to do that the values that the user enters in the lineedit areas, they have to "come back" to the slot of the button of the main GUI, where I have to add them as arguments to the redfang process.
Another option is that the redfangdialog runs the redfang process with the arguments that the user has entered into the lineEdit areas. The problem is that I still don't know how to run the redfangdialog from the main GUI, when i press the button of the menu.
I don't know how to deal with It![]()
Can anybody help me please?
First you ask the user for values, then you start the process and then you display results. So when you click the button that starts the process, the values should already be in line edits, so you can read them and start the process. You don't need any slots to read values from line edits.
Ok, I decided to do It in this way. I created the dialog to ask the user for the values, with lineEdits and one button that I decides that will run the process. So, what I was looking for was to launch the other dialog in the redFang button of the main menu. I did It like this:
I added in main.cpp and in btscanning.cpp, the include: #include "redfangdialog.h", and in the slot of the button of the main menu I did:
static Form1 *dialog = new Form1(this);
dialog->show();
dialog->setActiveWindow();
dialog->raise();
and the dialog appears, but it appears in the same window of the other gui, and it hides everything.I want that the dialog appears in another window, how can I do it?
Does "Form1" inherit QDialog (please check, don't guess)?
Bookmarks