Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Incompatible sender/receiver arguments using QTcpSocket::bytesWritten(qint64)
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 659 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • AmrCoderA Offline
    AmrCoderA Offline
    AmrCoder
    wrote on last edited by SGaist
    #1

    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

    kshegunovK 1 Reply Last reply
    0
    • AmrCoderA AmrCoder

      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

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      Just use qint64 throughout. i.e.

      void MainWindow::bytes(qint64)
      

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved