Results 1 to 8 of 8

Thread: Problem calling a function of a class from another class.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Join Date
    Aug 2010
    Posts
    58
    Qt products
    Qt4
    Platforms
    Windows
    Thanked 2 Times in 2 Posts

    Default Re: Problem calling a function of a class from another class.

    sure, i also knew that someone will say that theyre made const, i had them this way.
    anyway here:
    Qt Code:
    1. void MainWindow::Connect()
    2. {
    3. Startup s;
    4. QString p = s.getPort();
    5. int port = p.toInt();
    6. QString host = s.getServer();
    7. socket->connectToHost(host, port);
    8. QString t = s.getNick();
    9. std::string tmp = "USER " + t.toStdString() + " * * :" + t.toStdString() + "\r\n";
    10. socket->write(tmp.c_str());
    11. tmp = "NICK " + t.toStdString() + "\r\n";
    12. socket->write(tmp.c_str());
    13. QString f = s.getChannel();
    14. tmp = "JOIN " + f.toStdString() + "\r\n";
    15. socket->write(tmp.c_str());
    16. }
    To copy to clipboard, switch view to plain text mode 
    i also tried putting "Startup* s" then new it in the constructor didnt work, since i called both classes in both headers.
    Last edited by Fallen_; 2nd September 2010 at 19:07.

Similar Threads

  1. class calling other class functions?
    By Hardstyle in forum Newbie
    Replies: 4
    Last Post: 2nd June 2010, 02:38
  2. QtConncurrent - calling function within the class
    By jacek_ in forum Qt Programming
    Replies: 5
    Last Post: 28th October 2009, 17:37
  3. Replies: 1
    Last Post: 30th March 2009, 16:07
  4. Replies: 3
    Last Post: 16th May 2007, 11:07
  5. Problems calling C function in C++/Qt class
    By Rayven in forum General Programming
    Replies: 2
    Last Post: 2nd June 2006, 21:32

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.