Results 1 to 3 of 3

Thread: Method/Function With QString Arg

  1. #1
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Method/Function With QString Arg

    I am trying to write a QT function that takes a QString as an arguement. For example

    void program::sendString(QString text){
    }

    I am not so good with pointers and such, and was not sure how to implement this in the .h file or if I need to change this function too.

  2. #2
    Join Date
    Jun 2007
    Posts
    17
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Method/Function With QString Arg

    this function will be a private slot by the way

  3. #3
    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: Method/Function With QString Arg

    Qt Code:
    1. class program : public QObject
    2. {
    3. Q_OBJECT // macro required for classes declaring its own signals and/or slots
    4.  
    5. public:
    6. ...
    7.  
    8. private slots:
    9. void sendString(QString text); // do you mean this?
    10. };
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. QString static callback function from CURL
    By tpf80 in forum Qt Programming
    Replies: 12
    Last Post: 16th May 2007, 20:47
  2. Problem in converting QString to QChar array?
    By KaKa in forum Qt Programming
    Replies: 2
    Last Post: 19th March 2007, 00:38
  3. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  4. Converting QString to unsigned char
    By salston in forum Qt Programming
    Replies: 3
    Last Post: 24th April 2006, 22:10
  5. [SOLVED] Widget plugin ... how to ?
    By yellowmat in forum Newbie
    Replies: 10
    Last Post: 29th January 2006, 20:41

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.