Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QUrl schema

QUrl schema

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.6k 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
    redlars
    wrote on last edited by
    #1

    The following code;
    @QUrl url2("c:\Temp\file.txt");
    cout << "url2.isValid: " << (url2.isValid() ? "true" : "false") <<endl;
    cout << "url2.schema: " << url2.scheme().toStdString() << endl;
    @

    produces this output;
    @
    url2.isValid: true
    url2.schema: c
    @

    Why is the schema equal to "c"? Is this correct behaviour ?

    By changing the QUrl constructor parameter to "file://c:/Temp/file.txt" then schema is "file" which is as expected.

    Using Qt 4.7.1

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

      The constructor you're using for [[doc:QUrl]] is broken. My docnote at the bottom of the documentation page (referenced by the link) explains this.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        redlars
        wrote on last edited by
        #3

        Thanks for quick and good response. Sorry missed your comment.

        1 Reply Last reply
        0

        • Login

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