Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for WebAssembly
  4. Qt WebAssembly Widget Buttons not responding
Forum Updated to NodeBB v4.3 + New Features

Qt WebAssembly Widget Buttons not responding

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
7 Posts 3 Posters 611 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.
  • F Offline
    F Offline
    Fikrat
    wrote on last edited by
    #1

    Hi,
    I have been dealing with a problem of qt Webassembly. Firstly i have tried to debug and run qt 6.2.4 ( webassemly 2.0.4). then qt 6.4( webassemly 3.1.14
    ) with corresponding versions of webassembly, however, my buttons does not respond to any kind operations. Such that i simly createed button on widget.ui, then connect it to slot on which i put qDebug() << "Test" ;. Then it is not responding niether on windows nor on linux. Could you please tell me how to solve this??

    SGaistS 1 Reply Last reply
    0
    • F Fikrat

      Hi,
      I have been dealing with a problem of qt Webassembly. Firstly i have tried to debug and run qt 6.2.4 ( webassemly 2.0.4). then qt 6.4( webassemly 3.1.14
      ) with corresponding versions of webassembly, however, my buttons does not respond to any kind operations. Such that i simly createed button on widget.ui, then connect it to slot on which i put qDebug() << "Test" ;. Then it is not responding niether on windows nor on linux. Could you please tell me how to solve this??

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      As silly as it may sound: did you check that it is working properly with your desktop kit ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        As silly as it may sound: did you check that it is working properly with your desktop kit ?

        F Offline
        F Offline
        Fikrat
        wrote on last edited by
        #3

        @SGaist Hi, well, i debuged code in desktop side as well as web side, finally i saw that printing statements are rendered on html page console, but not qt creator console. However, It is impossible to render local files and images to custom html page with webassembly?

        SGaistS F 2 Replies Last reply
        0
        • F Fikrat

          @SGaist Hi, well, i debuged code in desktop side as well as web side, finally i saw that printing statements are rendered on html page console, but not qt creator console. However, It is impossible to render local files and images to custom html page with webassembly?

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Fikrat how are you rendering these files ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • F Fikrat

            @SGaist Hi, well, i debuged code in desktop side as well as web side, finally i saw that printing statements are rendered on html page console, but not qt creator console. However, It is impossible to render local files and images to custom html page with webassembly?

            F Offline
            F Offline
            Fikrat
            wrote on last edited by
            #5

            @SGaist I am rendering files from local directory to web, for example, i have direectory that container *.png or *.jpg extension files, then how to render them to page? Thank you for your kind support

            SGaistS 1 Reply Last reply
            0
            • F Fikrat

              @SGaist I am rendering files from local directory to web, for example, i have direectory that container *.png or *.jpg extension files, then how to render them to page? Thank you for your kind support

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              To the best of my knowledge, WebAssembly does not provide support for serving server side files.

              Depending on what you need these files for, you can use Qt's resource system.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply
              1
              • SGaistS SGaist

                To the best of my knowledge, WebAssembly does not provide support for serving server side files.

                Depending on what you need these files for, you can use Qt's resource system.

                R Offline
                R Offline
                RandomGuy
                wrote on last edited by
                #7

                @SGaist said in Qt WebAssembly Widget Buttons not responding:

                Depending on what you need these files for, you can use Qt's resource system.

                I think this is the best approach.

                Other way is using QNetworkAccessManager to download the image, this has the benefit that you can download images from external websites as well, something like:

                QNetworkAccessManager *manager = new QNetworkAccessManager(this);
                
                QNetworkReply *reply = manager->get(QNetworkRequest(QUrl("https://domain/image_url.jpg")));
                
                connect(manager, &QNetworkAccessManager::finished, [&](QNetworkReply *reply){
                        qWarning() << "replyFinished";
                        QPixmap *image = new QPixmap(this);
                        image->loadFromData(reply->readAll());
                        ui->label->setPixmap(QPixmap(*image));
                    });
                
                connect(reply, &QIODevice::readyRead, [](){qWarning() << "reply";});
                
                connect(reply, &QNetworkReply::errorOccurred, [](){qWarning() << "errorOccurred";});
                
                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