Skip to content

Qt for WebAssembly

Specific issues when using Qt for WebAssembly

453 Topics 1.8k Posts
QtWS25 Last Chance
  • 0 Votes
    4 Posts
    517 Views
    @lorn-potter Compile the app with 1.38.43, got error messages Fatal: error in validating output shared:ERROR: '/home/yyyy/Qt/3rdLibs/emsdk/fastcomp/bin/asm2wasm chinese_teacher.temp.asm.js --total-memory=16777216 --trap-mode=allow -O3 --mem-init=chinese_teacher.js.mem --mem-base=1024 --wasm-only -o chinese_teacher.wasm --mvp-features' failed (1) Makefile:316: recipe for target 'chinese_teacher.js' failed make: *** [chinese_teacher.js] Error 1
  • 0 Votes
    2 Posts
    477 Views
    @Vadi2 said in Qt Creator webassembly: calendar widget doesn't compile: I've tried compiling the calendar widget using the new webassembly support in Qt Creator 4.11 beta, and it took a really long while to print out the entire text representation of the program, and then failed with: Its not supposed to print out that wasm text in that way. Something qtcreator is doing is breaking the build. Building will still work when you do it from the commandline and using the Qt wasm binaries.
  • Sql positiotioning

    Solved 16 Oct 2019, 19:40
    0 Votes
    3 Posts
    492 Views
    @niqt said in Sql positiotioning: Have i do use some "special" compilation option? My guess is that you did not compile those modules
  • QNetworkConfigurationManager QSharedMemory unknown

    Solved 17 Oct 2019, 08:38
    0 Votes
    4 Posts
    628 Views
    Hi, Although QNetworkAccessManager is supported, QNetworkConfigurationManager is not. That said, there is a patch that implements a very simple configuration plugin for wasm, but this is out of date that you could use if you really needed to know if/when your app is online. https://codereview.qt-project.org/c/qt/qtbase/+/235844
  • Webassembly: module QtQuick.Shapes is not installed

    Unsolved 16 Oct 2019, 11:58
    0 Votes
    1 Posts
    600 Views
    No one has replied
  • Configure script says C++14 support is not available

    Solved 1 Oct 2019, 19:04
    0 Votes
    16 Posts
    2k Views
    I managed to get it working. I just need to know how I can get Emscripten to generate the notepad_ui.h header file from the uic file. For now I built it from within Qt Creator itself using the MSVC 2017 compiler, but I do want to know how to do it with Emscripten from the command line. I also created the menus in such a way that clicking them gives you a dropdown with one item with the same text as the button where you have to click the dropdown to perform the action. Is there a way to do it without needing to create the dropdown? Also, how do I change the configuration from Debug to Release? Edit: I changed it to Release mode just fine so never mind that. Anyway, although I can build it just fine in Qt Creator, trying it with Emscripten on the command line keeps failing. I get exceptions from the Emscripten script. If Qt developers can help with this, maybe I should open a new issue asking for help on building Qt apps to Wasm. And for some reason, when running the app, I have to choose a font twice from the font selection dialog box when I click on the menu button for selecting a font. I also don't understand why it won't just create an action in Action Editor the moment I create a menu item. Why do I have to click on the "Type here" that comes up when I click on that and create another menu item there for the same action for it to work?
  • 0 Votes
    10 Posts
    2k Views
    There is a way to 'persist' files, but you need to sync them from the local system into the sandbox. https://emscripten.org/docs/api_reference/Filesystem-API.html Using the IDBFS you can copy files to a mounted IndexDB filesystem. In fact, QSettings on wasm uses this to attempt to persist QSettings.
  • Issues Found When Trying to Build

    Unsolved 6 Oct 2019, 16:48
    0 Votes
    4 Posts
    1k Views
    Hi, Any reason why you are not using qmake?
  • 0 Votes
    4 Posts
    458 Views
    wasm or emscripten? I've been using the latter and it works.
  • 0 Votes
    14 Posts
    1k Views
    @lorn-potter Thanks, tried, can show the widgets but the ui components are too small, any suggestions to solve this issue? By the way, do you know any way to make the QLineEdit accept non ascii input?This question is related to QTBUG-78826. I load the fonts already, can paste the words from text file to QLineEdit or print the non ascii characters by program, but the QLineEdit cannot type the non ascii characters on it directly. QFile ifile(":/fonts/wqy_compress"); if(ifile.open(QIODevice::ReadOnly)){ auto const font_id = QFontDatabase::addApplicationFontFromData(qUncompress(ifile.readAll())); qDebug()<<__func__<<"font id:"<<font_id; font_family_ = QFontDatabase::applicationFontFamilies(font_id).at(0); } QFont const monospace(font_family_ ); ui->lineEditNewChar->setFont(monospace); Any suggestions?Thanks
  • Issue with running configure.bat (Windows)

    Solved 30 Sept 2019, 20:58
    0 Votes
    7 Posts
    2k Views
    @DragonOsman said in Issue with running configure.bat (Windows): Should I close this one and open a new thread for these questions or is this thread fine? Yes please, so other users can expect to find answers to the issue based on topic title. If not, the solution(s) for the new issue will be embedded within the posts.
  • 0 Votes
    4 Posts
    560 Views
    @mrjj Thanks for your helps, post a bug at JIRA, 78825
  • Qt for WebAssembly on Windows 10

    Unsolved 23 Sept 2019, 17:00
    0 Votes
    2 Posts
    2k Views
    Hi, first of all: Are you using a linux subsystem? Because you need to use Linux its not possible on windows. The secon thing is that the Qt mkspecs need to be specified in the compilers sub. In em and em++ both need to have "wasm-emscripten" as Qt mkspecs. The third thing is that actually it is still not possible to to build via Qt Creator. You need to use qmake and make. After running them the project is build and you are ready to go with a webserver like the simple python one. From there you just open the .html. If you need more help just message me, had some issues too as right now there is still the same warning on my linux system as you have with QtVersions. I'll figure that one out soon didn't deal with it until now.