Results 1 to 4 of 4

Thread: QProcess problem: compile well but output error

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Posts
    2

    Default QProcess problem: compile well but output error

    Hi everyone,

    I have a problem as written in title. Here are the codes:
    Qt Code:
    1. Window::Window()
    2. {
    3.  
    4. QGroupBox *echoGroup = new QGroupBox(tr("Anscare"));
    5.  
    6. QLabel *echoLabel = new QLabel(tr("File:"));
    7. QPushButton *browse = new QPushButton(tr("browse.."));
    8. QPushButton *convert = new QPushButton(tr("convert"));
    9. echoLineEdit = new QLineEdit;
    10. echoLineEdit->setFocus();
    11.  
    12. connect(convert, SIGNAL(clicked()),this, SLOT(runAnscare()));
    13. connect(browse, SIGNAL(clicked()),this, SLOT(getPath()));
    14.  
    15. QGridLayout *layout = new QGridLayout;
    16. layout->addWidget(echoGroup, 0, 0);
    17.  
    18. setLayout(layout);
    19.  
    20. setWindowTitle(tr("WinCares"));
    21. }
    22.  
    23. void Window::runAnscare()
    24. {
    25. convert->setEnabled( false );
    26.  
    27. if( process )
    28. delete process;
    29. process = new QProcess( this );
    30.  
    31. connect( process, SIGNAL(readyReadStandardOutput()), this, SLOT(handleReadStandardOutput()));
    32.  
    33. process->start( "anscares.exe ");
    34. }
    35.  
    36. void Window::handleReadStandardOutput()
    37. {
    38. QString string=echoLineEdit->text();
    39. QFileInfo fi(string);
    40. QString name=fi.fileName();
    41. int i=name.size();
    42. name.remove(i-4,4);
    43. process->write(name.toAscii()+"\n");
    44.  
    45. }
    To copy to clipboard, switch view to plain text mode 

    Compile well and when "browse" button is pressed, echoLineEdit can show the path of file. But push the "convert" button, an error occurs: "something wrong with it"

    Can anyone give me some hints?

    Thanks.
    Last edited by wysota; 29th February 2008 at 19:06. Reason: missing [code] tags

Similar Threads

  1. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  2. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  3. Qtopia core 4.2.2 cross compile make error
    By smiyai18 in forum Installation and Deployment
    Replies: 2
    Last Post: 28th August 2007, 17:04
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.