Results 1 to 4 of 4

Thread: QUrl isValid always true

  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Question QUrl isValid always true

    Hello,
    I'm using QUrl to validate uri but in 4.7.0 this always return true, even for "blabla". According to this that is correct behaviour but it doesn't really help me.
    So the question: is there any equivalent in Qt4.7. to Qurl::isValid() that will works like the "old qurl::isValid()"?

    Best regards
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QUrl isValid always true

    You could write it yourself, but really, the old QUrl was non-compliant - "blabla" is a perfectly valid URL.

    If you require certain characteristics such as protocol or site address (ie, a fully qualified URL rather than relative), then this can easily be done and you can AND the results of that function with isValid of QUrl.

  3. The following user says thank you to squidge for this useful post:

    Talei (1st March 2011)

  4. #3
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QUrl isValid always true

    Thank you for the reply.
    Yes I know that's valid uri and I don't question that.
    I only ask because I don't want to "reinvent the wheel", and I know that I can write regexp for that, but I found many times in the past that Qt offers functionality that I need, so that's why I asked if they maybe moved / added that functionality "some place else".
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  5. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QUrl isValid always true

    There is no mention in the GIT repo: http://qt.gitorious.org/qt/qt/blobs/...ib/io/qurl.cpp

    So I can only assume it was considered a bug that needed fixing (without going through every commit, I couldn't comment in which it was that changed the functionality)

  6. The following user says thank you to squidge for this useful post:

    Talei (2nd March 2011)

Similar Threads

  1. Replies: 6
    Last Post: 24th January 2011, 18:48
  2. please explain QUrl::isValid() to me
    By momesana in forum Qt Programming
    Replies: 5
    Last Post: 19th May 2010, 01:19
  3. QUrl and EUC-JP
    By Ignacio Serantes in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2009, 15:19
  4. QGLWidget::isValid() not valid in Qt-4.3.2?
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 16th November 2008, 22:14
  5. QSqlQuery::isValid returns false
    By mismael85 in forum Qt Programming
    Replies: 24
    Last Post: 7th September 2008, 23:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.