Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt.resolvedUrl() - What is the magic inside?
Forum Update on Monday, May 27th 2025

Qt.resolvedUrl() - What is the magic inside?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlcomponenturl
2 Posts 2 Posters 4.9k Views
  • 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.
  • I Offline
    I Offline
    iLya84a
    wrote on 7 Oct 2017, 16:34 last edited by
    #1

    Hello everyone!
    I'd like to know how this method Qt.resolvedUrl() works. Moreover I'd like to recreate it on the C++ side.
    Why? Let me explain. I'm implementing my own internationalization system.
    I have a lot of folder-based qml components.
    Every time I write something like this source: MyObject.localizedUrl("image.svg") I'd like to implicitly pass a component url to my localizedUrl() method.
    What for? I have to check the existence of my localized files. For example: "image_en.svg", "image_de.svg", "image_fi.svg", etc.
    Certainly I can write source: MyObject.localizedUrl(Qt.resolvedUrl("image.svg")) but I'm looking for more elegant solution.
    Thank you in advance!

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 7 Oct 2017, 16:50 last edited by
      #2

      Hi! resolvedUrl is declared in qqmlcontext.h, the definition is here: qqmlcontext.cpp#n419.

      1 Reply Last reply
      1

      2/2

      7 Oct 2017, 16:50

      • Login

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