Results 1 to 20 of 24

Thread: Passing strings to SLOT function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #22
    Join Date
    May 2012
    Posts
    21
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Passing strings to SLOT function

    Seems good now, I tested it with qdebug, and it was able to print out the emitted string. Sorry for the confusion.

    I was wondering is it possible to use qdebug or something equivalent and use the message.toStdString with getline to use the emitted string as an input(cin)?
    Correct me if I'm wrong about this, am I correct to say that qdebug can only be used for cout and not cin? On the other hand, if I'm using string string_in = message.toStdString(); as suggested, the app doesn't seem to be able to take the emitted string and do what it needs to do. The app just sits there waiting for an input, which it never gets when the pushbutton is clicked.

    Also, I've tried using
    QTextStream qtin(stdin);
    qtin >> message;
    doesn't seem to work.
    Last edited by ashboi; 11th September 2013 at 14:13.

Similar Threads

  1. Passing argument to slot.
    By TCB13 in forum Newbie
    Replies: 2
    Last Post: 22nd February 2012, 19:52
  2. Passing data via signal/slot
    By gib in forum Qt Programming
    Replies: 4
    Last Post: 1st November 2010, 05:49
  3. Passing an integer to a slot
    By bizmopeen in forum Newbie
    Replies: 6
    Last Post: 30th October 2009, 09:51
  4. Passing QsqlRecords in a function
    By ambarish_singh in forum Qt Programming
    Replies: 7
    Last Post: 13th August 2009, 11:10
  5. passing arguments in SLOT
    By eleanor in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2008, 21:55

Tags for this Thread

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.