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. Can't open text file resource
Forum Updated to NodeBB v4.3 + New Features

Can't open text file resource

Scheduled Pinned Locked Moved Unsolved Qt for WebAssembly
2 Posts 2 Posters 415 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.
  • R Offline
    R Offline
    rejuce
    wrote on last edited by
    #1

    I try to open a text file that I added as resource but can't find any valid argument for open(... )

    With gcc it compiles fine and I can work with the file after opening

    QFile file("qrc:/myfile.txt);

    if (!file.open(QIODevice::ReadOnly))..

    Once I switch to the wasm kit the line with. Open gets red with the error that no valid argument is supplied to open() ... I can't find out what the valid argument would be
    Just to clarify I am not talking about a local file, the text file is compiled into the application as resource
    Any hints?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alexander Jaehrling
      wrote on last edited by
      #2

      If the resource is in a library make sure to invoke Q_INIT_RESOURCE for your resource file (see documentation for details).

      1 Reply Last reply
      1

      • Login

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