Important: Please read the Qt Code of Conduct -

Am3359 QT5.1 Signal slot and timer problem in gui

  • Hello Everyone,

    I have compiled qt 5.1.0 for AM3359 . I have a tcpserver qt console application and a gui based client application runing in the same board.

    In the server application signals and slots are working properly.

    In the client application (GUI based), any slot connected to a signal other than the gui controls are not getting called.

    For example I have this application :

    @#include "widget.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    Widget w;;

    return a.exec&#40;&#41;;


    @#ifndef WIDGET_H
    #define WIDGET_H

    #include <QWidget>
    #include <QTcpSocket>

    namespace Ui {
    class Widget;

    class Widget : public QWidget

    explicit Widget(QWidget *parent = 0);

    private slots:
    void server_data_received();

    Ui::Widget ui;

    #endif // WIDGET_H

    @#include "widget.h"
    #include "ui_widget.h"
    #include <QDebug>

    Widget::Widget(QWidget *parent) :
    ui(new Ui::Widget)
    Server = new QTcpSocket(this);

    qDebug()<<"Connected. now connecting slot";
    connect(Server, SIGNAL(readyRead()),this,SLOT(server_data_received()));
    qDebug()<<"Unable to connect";

    QByteArray stest;stest.append((char)0xA0);
    qDebug()<<"Starting : "<< Server->write(stest);
    if(! Server->waitForBytesWritten(3000) )
    qDebug()<<"start not written - false";


    void Widget::server_data_received()
    qDebug()<<"server data received";

    delete ui;

    When the application starts, it send a message to server and the server sends the client some data back.

    But the slot server_data_received() is never being called. If insert a button and waitforreadyread in the clicked slot for the button, then i am able to read the data.

    This same program works with qt 4.8.3 in the same board.

    Also QTimer timeout events or singleshot are not getting triggered.

    Can anyone help me troubleshoot this problem ?

    Thanks a lot in advance.


Log in to reply