Results 1 to 13 of 13

Thread: Calling external programs?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Calling external programs?

    Quote Originally Posted by Hossie View Post
    That part was just a paste. I looked at the constructor again, and it seems all arguments are optional. If I change it to

    Qt Code:
    1. proc=new QProcess();
    To copy to clipboard, switch view to plain text mode 

    At least that error disappeared.
    Every QObject (QProcess is a QObject) takes a parent parameter for a reason. Make sure to pass a proper parent or delete the object yourself. Otherwise you'll get a memory leak.

    Now I got an even worse one.

    Qt Code:
    1. mainwindow.cpp: In member function ‘void mainwindow::doit()’:
    2. mainwindow.cpp:33: error: could not convert ‘((mainwindow*)this)->mainwindow::proc-> QProcess::start(((const QString&)((const QString*)(& program))), ((const QStringList&)((const QStringList*)(& arguments))), QFlags<QIODevice::OpenModeFlag>(ReadWrite))’ to ‘bool’
    To copy to clipboard, switch view to plain text mode 
    Take a closer look at QProcess::start() docs. It's a void function. No bool is returned.
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    Hossie (17th May 2008)

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. link error for visual studio.net 2003
    By berlin in forum Newbie
    Replies: 9
    Last Post: 29th September 2006, 16:06
  3. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04
  4. Can't compile programs in Visual Studio.net 2005
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 7th July 2006, 14:10

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.