Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Elided settings limit error
Qt 6.11 is out! See what's new in the release blog

Elided settings limit error

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
elide modesockethelp
13 Posts 4 Posters 490 Views
  • 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.
  • Joe von HabsburgJ Offline
    Joe von HabsburgJ Offline
    Joe von Habsburg
    wrote last edited by Joe von Habsburg
    #3

    @jsulm

    I Use TCP

    That main socket class

    #include "MySocket.h"
    
    MySocket::MySocket(QString remoteIp, int remotePort, QObject *parent)
        : QObject{parent}
        , _remoteIp(remoteIp)
        , _remotePort(remotePort)
    {
    }
    
    MySocket::~MySocket()
    {
        close();
    }
    
    void MySocket::open()
    {
        _socket = new QTcpSocket(this);
        connect(_socket, &QTcpSocket::readyRead, this, &MySocket::readyRead);
    
        _socket->abort();
    
        _socket->connectToHost(_remoteIp, _remotePort);
    }
    
    void MySocket::close()
    {
        if(!_socket)
            return;
    
        _socket->close();
        _socket->abort();
        _socket->disconnectFromHost();
    }
    
    void MySocket::readyRead()
    {
        QByteArray data = _socket->readAll();
        parseData(data);
    }
    
    

    Any Socket class

    #include "AnySocket.h"
    
    AnySocket::AnySocket(QString remoteIp, int remotePort, QObject *parent)
        : MySocket{remoteIp, remotePort, parent}
    {}
    
    void AnySocket::parseData(QByteArray data)
    {
        QDataStream stream(data);
        stream.setByteOrder(QDataStream::LittleEndian);
        stream.setFloatingPointPrecision(QDataStream::SinglePrecision);
    
        //...
    
        emit sendData(mystruct);
    }
    
    

    I have 5-6 AnySocket (just parse data different because data different) connection for different ports;

    // send to mainwindow.cpp and I use data, for example write values to qlabel or qtablewidget and some calculating things
    emit sendData(mystruct);
    
    jsulmJ 1 Reply Last reply
    0
    • Joe von HabsburgJ Joe von Habsburg

      @jsulm

      I Use TCP

      That main socket class

      #include "MySocket.h"
      
      MySocket::MySocket(QString remoteIp, int remotePort, QObject *parent)
          : QObject{parent}
          , _remoteIp(remoteIp)
          , _remotePort(remotePort)
      {
      }
      
      MySocket::~MySocket()
      {
          close();
      }
      
      void MySocket::open()
      {
          _socket = new QTcpSocket(this);
          connect(_socket, &QTcpSocket::readyRead, this, &MySocket::readyRead);
      
          _socket->abort();
      
          _socket->connectToHost(_remoteIp, _remotePort);
      }
      
      void MySocket::close()
      {
          if(!_socket)
              return;
      
          _socket->close();
          _socket->abort();
          _socket->disconnectFromHost();
      }
      
      void MySocket::readyRead()
      {
          QByteArray data = _socket->readAll();
          parseData(data);
      }
      
      

      Any Socket class

      #include "AnySocket.h"
      
      AnySocket::AnySocket(QString remoteIp, int remotePort, QObject *parent)
          : MySocket{remoteIp, remotePort, parent}
      {}
      
      void AnySocket::parseData(QByteArray data)
      {
          QDataStream stream(data);
          stream.setByteOrder(QDataStream::LittleEndian);
          stream.setFloatingPointPrecision(QDataStream::SinglePrecision);
      
          //...
      
          emit sendData(mystruct);
      }
      
      

      I have 5-6 AnySocket (just parse data different because data different) connection for different ports;

      // send to mainwindow.cpp and I use data, for example write values to qlabel or qtablewidget and some calculating things
      emit sendData(mystruct);
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote last edited by
      #4

      @Joe-von-Habsburg And where in your code does this "Elided..." output come from? I mean what is executed in your code (which is not complete, parsing for example is not shown, also what you do with the data after parsing) when this is printed? You should really do some debugging first...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      Joe von HabsburgJ 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Joe-von-Habsburg And where in your code does this "Elided..." output come from? I mean what is executed in your code (which is not complete, parsing for example is not shown, also what you do with the data after parsing) when this is printed? You should really do some debugging first...

        Joe von HabsburgJ Offline
        Joe von HabsburgJ Offline
        Joe von Habsburg
        wrote last edited by Joe von Habsburg
        #5

        @jsulm said in Elided settings limit error:

        And where in your code does this "Elided..." output come from?

        Whenever I connect to any port, I get this output on the device. As I mentioned, I connect to 5 or 6 different ports, but even if I connect to just one of them for testing, I still get this output.

        @jsulm said in Elided settings limit error:

        for example is not shown

        I read with stream and set values, there are lots of variable.

        quint32 val1;
        float val2;
        
        stream >> val1 >> val2;
        
        MyStruct myStruct;
        myStruct.val1 = val1;
        myStruct.val2= val2;
        

        @jsulm said in Elided settings limit error:

        also what you do with the data after parsing

        void MainWindow::sendStatusData(MyStruct data)
        {
           
            ui->lbl_eg_status_packet_shema_version->setText(QString("%1.%2.%3.%4").arg(data.packet_shema_version[0]).arg(data.packet_shema_version[1]).arg(data.packet_shema_version[2]).arg(data.packet_shema_version[3]));
            ui->lbl_eg_status_serial_number->setText(data.serial_number);
            //...
        }
        
        // or
        
        void MainWindow::sendCallculateData(MyCalculateStruct data)
        {
            checkCalculate();
        
            for(CalculateData &calculateData : data.calcualtes){
                bool exist = false;
                int index = -1;
                for(int i = 0; i < _calculates.size(); i++){
                    if(calculateData .calculate_id== _calculates[i].id){
                        exist = true;
                        index = i;
                        break;
                    }
                }
        
                if(exist){
                    _calculates[index].val1= calculateData .val1;
                    _calculates[index].val2= calculateData .val2;
                }
                else{
                    CalculateData calculate;
                    calculate.id = calculateData .calculate_id;
                    calculate.val1= calculateData .val1;
                    calculate.val2= calculateData .val2;
                    _calculates.append(calculate);
                }
            }
        }
        
        1 Reply Last reply
        0
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote last edited by
          #6

          How big are the packets sent?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • Joe von HabsburgJ Offline
            Joe von HabsburgJ Offline
            Joe von Habsburg
            wrote last edited by
            #7

            each server send different size of packets, min 352 B, max 292000 B

            JonBJ 1 Reply Last reply
            0
            • Joe von HabsburgJ Joe von Habsburg

              each server send different size of packets, min 352 B, max 292000 B

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote last edited by
              #8

              @Joe-von-Habsburg
              My (admittedly limited) understanding is that TCP packets are ~1,500 bytes (with an absolute limit of 64k which is still less than your maximum). I don't know whether it's reporting those >1.5k? And the "elided" and "settings limit" comes from unknown source?

              1 Reply Last reply
              0
              • Joe von HabsburgJ Offline
                Joe von HabsburgJ Offline
                Joe von Habsburg
                wrote last edited by
                #9

                I think it might be like this: I’m constantly receiving data, but I can’t process it at the same rate, so it builds up.

                void Socket::readyRead()
                {
                    QByteArray data = _socket->readAll();
                    parseData(data);
                }
                

                could it be, lots of packet (more than 1) in _socket->readAll();

                jsulmJ 1 Reply Last reply
                0
                • Joe von HabsburgJ Joe von Habsburg

                  I think it might be like this: I’m constantly receiving data, but I can’t process it at the same rate, so it builds up.

                  void Socket::readyRead()
                  {
                      QByteArray data = _socket->readAll();
                      parseData(data);
                  }
                  

                  could it be, lots of packet (more than 1) in _socket->readAll();

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote last edited by
                  #10

                  @Joe-von-Habsburg If you comment out parseData(data) - do you still see that elided messages?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  1
                  • Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote last edited by
                    #11

                    Moved the 'QtCreator and other tools' as this is a question on QtCreator debug output even though OP did not mentioned it.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    1 Reply Last reply
                    2
                    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop
                    • Joe von HabsburgJ Offline
                      Joe von HabsburgJ Offline
                      Joe von Habsburg
                      wrote last edited by
                      #12

                      Hi, I receive that situation different project and I think its about new QtCreator. Because In the pass I never see that and I printed eveything

                      [[[... Elided 4543 characters due to settings limit ...]]]

                      any solution here ?

                      Christian EhrlicherC 1 Reply Last reply
                      0
                      • Joe von HabsburgJ Joe von Habsburg

                        Hi, I receive that situation different project and I think its about new QtCreator. Because In the pass I never see that and I printed eveything

                        [[[... Elided 4543 characters due to settings limit ...]]]

                        any solution here ?

                        Christian EhrlicherC Offline
                        Christian EhrlicherC Offline
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote last edited by Christian Ehrlicher
                        #13

                        @Joe-von-Habsburg said in Elided settings limit error:

                        any solution here?

                        due to settings limit

                        So did you check the settings for such a limit?

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        0

                        • Login

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