Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to Share links on Facebook through QT?
Forum Updated to NodeBB v4.3 + New Features

How to Share links on Facebook through QT?

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 4.8k 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.
  • S Offline
    S Offline
    syedasadalibs03
    wrote on last edited by
    #1

    I have tried Following Url ( "http://www.facebook.com/sharer.php?u="+"http://www.google.com"+&t=+"SearchEngine") but i have face the Problem of Java Scrip , that open the dialog of Yes and No
    after that, the Application is Crashed

    Although the Application share the URl on faceBook
    Through Simulator

    Thanks in Advance

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fcrochik
      wrote on last edited by
      #2

      Please provide more details about your scenario?
      Is this a native (c++) application creating a http request?
      Are you using a html page within a webkit control?
      Is it a qml application?
      Or?

      If you are writing a c++ application and want to access facebook there is qt library that may help you. I have never tried but I know it exists and it is used on a maemo5 qt application.

      Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

      1 Reply Last reply
      0
      • S Offline
        S Offline
        syedasadalibs03
        wrote on last edited by
        #3

        I am using the the QwebView and have facing the Problems of Javascript message i.e ("The Script on this page appears to have a problem do you want to stop the Script.
        Yes No")
        Finally the Memory full Message Occurs and the Application is Crashed.
        I have used the following code.

        ui->setupUi(this);
        QWebSettings::globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true);
        ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true);
        ui->webView->settings()->setAttribute(QWebSettings::PluginsEnabled, true);

        QString urlString ="http://www.facebook.com/sharer.php?u=" + "http://www.google.com" + &t= + " SearchEngine" ;
        ui->webView->setUrl(QUrl(urlString) ) ;

        Thanks for your Reply.

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          are you sure the urlString has the right value? can you debug and find out

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fcrochik
            wrote on last edited by
            #5

            [quote author="syedasadalibs03" date="1290753813"]
            QString urlString ="http://www.facebook.com/sharer.php?u=" + "http://www.google.com" + &t= + " SearchEngine" ;
            ui->webView->setUrl(QUrl(urlString) ) ;
            [/quote]

            The javascript shouldn't crash but neither should you use this string.
            You must encode, at least, the URL parameter (second string above).
            Try removing the "http://" from the second string and see if still crashes.

            Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

            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