Results 1 to 9 of 9

Thread: QUpdSocket The program has unexpectedly finished.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: QUpdSocket The program has unexpectedly finished.

    What I was trying to hit at is that you need to create an instance of QTimer if you want to use it
    Right now you are using an uninitialized pointer.

    Cheers,
    _

  2. #2
    Join Date
    Sep 2014
    Location
    Spain
    Posts
    14
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QUpdSocket The program has unexpectedly finished.

    Thanks!!!! I can send and receive!!!


    Now I have the next problem, but why I can't do this?
    Qt Code:
    1. ui->label_2->setText(datagram.at(i).toString());
    To copy to clipboard, switch view to plain text mode 

    Build:
    Request for member 'toString' in 'datagram.QByteArray::at(i), which is of non-class type char
    ui->label_2->setText(datagram.at(i).toString());

    Thanks another time!!
    Last edited by ariad; 18th September 2014 at 15:36.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: QUpdSocket The program has unexpectedly finished.

    QByteArray::at() returns a char, a single character. It is not a class and does not have any methods.

    If you want to display the string inside the byte array, use one of the QString::fromXYZ methods, e.g. QString::fromAscii()

    Cheers,
    _

  4. #4
    Join Date
    Sep 2014
    Location
    Spain
    Posts
    14
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QUpdSocket The program has unexpectedly finished.

    Ok, thanks!!!

Similar Threads

  1. The program has unexpectedly finished.
    By smemamian in forum Newbie
    Replies: 4
    Last Post: 1st April 2013, 00:44
  2. Replies: 4
    Last Post: 17th September 2012, 15:23
  3. the program has unexpectedly finished
    By narlapavan in forum Qt Programming
    Replies: 9
    Last Post: 9th July 2012, 09:04
  4. Replies: 6
    Last Post: 24th June 2012, 18:32
  5. Program has unexpectedly finished
    By Maluko_Da_Tola in forum Newbie
    Replies: 5
    Last Post: 1st December 2010, 09:54

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.