Results 1 to 18 of 18

Thread: error: invalid use of void expression

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: error: invalid use of void expression

    Quote Originally Posted by ChineseGeek View Post
    Believe me, i have thought about that line several days hehe...
    Oh my God....

    Let's see... you are loading an image and placing its url into an html document, then setting that html on a text edit with a method returning void and wanting the result of this method to be written to a socket (look in the dictionary what the word "void" means in English) and expecting the contents to be transfered to the other end of the socket... Please tell me I'm wrong...
    Last edited by wysota; 2nd October 2009 at 19:07.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: error: invalid use of void expression

    Quote Originally Posted by ChineseGeek View Post
    So, what do you recomend to do this?
    Definitely not a method returning void. And, frankly, surely a good book about C++ and programming in general. Then also a bit of RTFM and STFW.

    Or better, how can i put that image in the QTextEdit using the socket?
    A good first step would be to browse the reference manual.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: error: invalid use of void expression

    Oh come on man! Im a beginner and you are a Guru, you can help me out with this!

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: error: invalid use of void expression

    Quote Originally Posted by ChineseGeek View Post
    Im a beginner and you are a Guru, you can help me out with this!
    Then act as a beginner and learn the basics first before moving forward to more advanced subjects. If you don't even know what a return type of a method does how do you expect to make progress with using the API?

    I still don't know what you want to do so it is quite hard to help you. If you want to transfer this html through the socket then use QTcpSocket::write() as already told. Finding the proper transformation from the type returned by QTextEdit::html() to the type accepted by QTcpSocket::write() is your homework. It should take you no more than 20 seconds to find the appropriate method provided you start looking for it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. GraphicsItem is flickering
    By anafor2004 in forum Qt Programming
    Replies: 3
    Last Post: 30th September 2009, 11:44
  2. File rename detection
    By bunjee in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2009, 15:22
  3. Q3ScrollView resists to scroll down to the garbage bin
    By sivrisinek in forum Qt Programming
    Replies: 0
    Last Post: 5th February 2009, 17:50
  4. Must construct QApplication before QPaintDevice
    By sekatsim in forum Qt Programming
    Replies: 16
    Last Post: 8th June 2008, 00:00
  5. Delayed Rendering of QTabWidget Tabs
    By mclark in forum Qt Tools
    Replies: 13
    Last Post: 14th May 2007, 22:53

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.