Incompatible sender/receiver arguments using QTcpSocket::bytesWritten(qint64)



  • I got this error

    QObject::connect: Incompatible sender/receiver arguments
            QTcpSocket::bytesWritten(qint64) --> MainWindow::bytes(quint64)
    

    when using as slot to my bytes written socket
    code when i use this

        socket = new QTcpSocket(this);
        socket->connectToHost(ui->lineEdit->text().trimmed(),quint16(ui->lineEdit_2->text().toInt()));
        connect(socket,SIGNAL(readyRead()),this,SLOT(readyRead()));
        connect(socket,SIGNAL(bytesWritten(qint64)),this,SLOT(bytes(quint64)));
        byteswriten = 0;
    

    the header

    void bytes(quint64 n); // i try this too void bytes(quint64 n = 0); !!
    

    what should i do to solve this and get a progressbar for bytes written to socket
    Thanks in advance


  • Qt Champions 2016

    Just use qint64 throughout. i.e.

    void MainWindow::bytes(qint64)
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.