Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-113683

wasm故障

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.5.0
    • Other
    • None
    • WebAssembly

    Description

      我使用Qt 6.5.0版本编写了两个QGraphicsView 界面,并在网页上发页,当在iframe中打开一个webassembly页面时,程序运行正常,再新建一个iframe页面,打开另一个webassembly页面时,第一个打开的webassembly出错。错误信息为:Uncaught TypeError: Failed to execute 'decode' on 'TextDecoder': The provided ArrayBufferView value must not be shared.
          at UTF8ArrayToString (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:5693)
          at UTF8ToString (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:6321)
          at maybeCStringToJsString (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:166259)
          at findEventTarget (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:166432)
          at _emscripten_get_element_css_size (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:166879)
          at MLogControls.wasm:0x532383
          at MLogControls.wasm:0x189ea9c
          at MLogControls.wasm:0x143fcaa
          at ret.<computed> (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:113351)
          at eval (eval at completeLoadEmscriptenModule (qtloader.js:459:9), <anonymous>:9:250682)

      我的主函数如下:

      #include "mainwindow.h"
      #include "globalinfos.h"
      #include "HistoGram/histogrammainwindow.h"
      #include "realparams.h"
      #include <QApplication>
      #include <QFontDatabase>
      #include <QLocale>
      #include <QMessageBox>
      #include <QTranslator>
      #include <QSysInfo>
      #include <QDateTime>
      #include <QLibraryInfo>
      QApplication *app = nullptr;
      RealParams *realParams = nullptr;
      HistoGramMainWindow *histoGramContainer = nullptr;
      int main(int argc, char *argv[]) {
        app = new QApplication(argc, argv);
        int fontId = QFontDatabase::addApplicationFont(":/realparams/msyh");
        if (fontId >= 0)

      {     QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId);     qInfo() << QString("fontId =%1 fontfamilies:").arg(fontId) << fontFamilies;     QFont font;     auto fontFamilie = fontFamilies[0];     font.setFamily(fontFamilie); //设置全局字体     font.setPointSize(9);     app->setFont(font);   }

        QTranslator translator;
        const QStringList uiLanguages = QLocale::system().uiLanguages();
        for (const QString &locale : uiLanguages) {
          const QString baseName = "MLogControls_" + QLocale(locale).name();
          if (translator.load(":/i18n/" + baseName))

      {       app->installTranslator(&translator);       break;     }

        }
        if (translator.load(":/locale/qtbase_zh_CN"))

      {       app->installTranslator(&translator);   }

        GlobalInfos::install();

        if (argc >= 5) {
            qInfo() << QString("args =%1 ").arg(argv[1]);
          if (strcmp(argv[1], "realparams")==0)

      {       realParams = new RealParams(           GlobalInfos::globalWebHelper.url, argv[4], argv[2], argv[3]);       realParams->show();     }

          else if (strcmp(argv[1], "histogram")==0)

      { qInfo() << argv[5]<< argv[6] << argv[7];       histoGramContainer = new HistoGramMainWindow();       histoGramContainer->show();       histoGramContainer->loadRemoteFile(argv[4], argv[2], argv[3],argv[5],               QString(argv[6]).toDouble(),QString(argv[7]).toDouble());     }

        } else

      {     realParams = new RealParams(         GlobalInfos::globalWebHelper.url, "TL", "吐哈", "萨110井");     realParams->show();       histoGramContainer = new HistoGramMainWindow();       histoGramContainer->show();       /*histoGramContainer->loadRemoteFile("TL","吐哈","马78井","组合测井曲线图.tqg",                                                0,                                                10000);*/  histoGramContainer->loadRemoteFile("TL","吐哈","萨110井","综合实时曲线.tqg",                                          QDateTime(QDateTime::currentDateTime().date(),QTime(0,0,0)).toSecsSinceEpoch(),                                          QDateTime(QDateTime::currentDateTime().date().addDays(1),QTime(0,0,0)).toSecsSinceEpoch());       //histoGramContainer->loadRealData("klmy","pd","巴州001",1590076800000,1590163199000); #ifndef ISEMSCRIPTEN       app->exec();       if (realParams!=nullptr) delete realParams;       if (histoGramContainer!=nullptr) delete histoGramContainer;       GlobalInfos::Uninstall();       delete app; #else       char *a="1690076800";//       char * b="1690163199";       //histoGramContainer->loadRemoteFile("KL","pd","FNHW4006","综合实时曲线_WEB.tqg",QString(a).toDouble(),QString(b).toDouble()); #endif   }

        //QMessageBox::information(realParams, "F", argv[1]);

        return 0;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            wangzizhang wang zizhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes