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.openUrlExternally() sometimes works on Symbian^3 and sometimes not, why is this?

Qt.openUrlExternally() sometimes works on Symbian^3 and sometimes not, why is this?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 3.5k 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.
  • Q Offline
    Q Offline
    QtQueries
    wrote on last edited by
    #1

    I am having some difficulty with @Qt.openUrlExternally@ on Symbian^3. Sometimes it works, sometimes not, and I can't find any pattern to it.

    Another user seems to be having the same problem here.

    When it does not work, the actual behaviour is that a web browser opens, comes to the foreground briefly (for a few seconds), then goes to the background. It is still open, but the URL does not load.

    @Qt.openUrlExternally("http://www.nokia.com")@ works.

    @Qt.openUrlExternally("http://twitter.com/share?text=ZOMG")@ fails. I initially concluded that this meant any URL with ? does not work, however this is wrong because...

    @Qt.openUrlExternally("http://twitter.com/intent/tweet?text=ZOMG")@ works. However, it seems to work for one word only because:

    @Qt.openUrlExternally("http://twitter.com/intent/tweet?text=Will this work")@ fails.

    Has anyone encountered a similar issue (specifically for sending arbitrary text to Twitter I suppose), and what have they done about it?

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      replace the spaces by + signs, that's the usual way to encode URL queries.

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtQueries
        wrote on last edited by
        #3

        Hmm.

        I had already passed my URL through Javascript's encodeURI() function, so the actual string was http://twitter.com/intent/tweet?text=Will(percent20)this(percent20)work -- the forum code block option changed it to a space for me.

        However, replacing the (percent20)'s with +'s in the final URL does in fact work. Surely is the standard replacement for spaces? What if the URI parameter includes a plus sign?

        experiments

        So, the following works OK: http://twitter.com/intent/tweet?text=Will+this+(percent2B)+work.

        I conclude from this that any URI parameters should be passed through Javascript's encodeURIComponent() function, with any (percent20)'s on the resulting string replaced with +'s.

        By this reasoning I see also that I was wrong in my second assertion above, "http://twitter.com/share?text=ZOMG" does work OK.

        Seems like a bug to me that (percent20) does not work, however this is what the Javascript encode functions use for space.

        Thanks for the help.

        EDITED to replace (percent20) which this damn forum software always actually substitutes for a space.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          As a workaround wrap text you do not want to be substituted within @ tags.

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            QtQueries
            wrote on last edited by
            #5

            Hi.

            I did that the first time, it substituted percent20 for space.

            @typing percent20 HERE --> <--@

            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