Results 1 to 3 of 3

Thread: Close function confusion

  1. #1
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face Close function confusion

    I have a QWidget which inside it creates a process using fork. I use the new process to run a secondary executable and to communicate between the two processes I create some pipes. I am making the pipes so the communication can only go one-way, that way I can pass into the secondary applications input from my main application since I cannot write to stdin to answer its inputs.

    Anyways, the problem I am having is I am trying to close of some of the ends of the pipes, but when I call the close function with its argument
    Qt Code:
    1. close( int )
    To copy to clipboard, switch view to plain text mode 
    the compiler doesn't let me compile because it says QWidget::close doesn't take any arguments. The close I am trying to use is located in unistd.h. I have tried

    Qt Code:
    1. std::close( int );
    2. unistd::close( int );
    To copy to clipboard, switch view to plain text mode 
    but std does not contain close and unistd does not appear to have a namespace or whatever its called. So how can I get around the confusion of which close I want to use. Thanks for your help and input!

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Close function confusion

    use
    Qt Code:
    1. ::close(int)
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Ohio
    Posts
    332
    Thanks
    37
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Close function confusion

    Thanks I will give that a try. Didn't know I could just put :: at the front.

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. close() function confusion
    By iamjayanth in forum Qt Programming
    Replies: 3
    Last Post: 13th November 2008, 10:45
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  4. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  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
  •  
Qt is a trademark of The Qt Company.