Results 1 to 20 of 47

Thread: kdialog and klocate problems

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    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.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    Have you noticed the errors you had made (especially the fact that the process didn't have a chance to start at all)?

  3. #3
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    You can write to standard input of a process just like you read from its standard output, if that was your question...

  5. #5
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    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?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    You want the values to be passed as arguments to the process or to be written to the process standard input?

  7. #7
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    To be passed to the process as arguments, like:

    proc->addArgument("value_written_by_the_user");

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    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.

  9. #9
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    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?

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    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.

  11. #11
    Join Date
    Apr 2007
    Location
    Valencia, Spain
    Posts
    30
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: kdialog and klocate problems

    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?

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: kdialog and klocate problems

    Does "Form1" inherit QDialog (please check, don't guess)?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.