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 673 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 21 Jun 2023, 11:40 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??

    S 1 Reply Last reply 21 Jun 2023, 18:33
    0
    • F Fikrat
      21 Jun 2023, 11:40

      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??

      S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Jun 2023, 18:33 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 22 Jun 2023, 09:02
      0
      • S SGaist
        21 Jun 2023, 18:33

        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 22 Jun 2023, 09:02 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?

        S F 2 Replies Last reply 23 Jun 2023, 20:39
        0
        • F Fikrat
          22 Jun 2023, 09:02

          @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?

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 23 Jun 2023, 20:39 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
            22 Jun 2023, 09:02

            @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 26 Jun 2023, 08:38 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

            S 1 Reply Last reply 26 Jun 2023, 19:50
            0
            • F Fikrat
              26 Jun 2023, 08:38

              @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

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 26 Jun 2023, 19:50 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 27 Jun 2023, 08:39
              1
              • S SGaist
                26 Jun 2023, 19:50

                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 27 Jun 2023, 08:39 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

                4/7

                23 Jun 2023, 20:39

                • Login

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