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. How can get all holidays a year?
Forum Updated to NodeBB v4.3 + New Features

How can get all holidays a year?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.1k 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.
  • zhmhZ Offline
    zhmhZ Offline
    zhmh
    wrote on last edited by zhmh
    #1

    I want to get all holidays a year for save and use it in program , I found the google has Calendar API that I can send request to get listing of events like this link
    I found this library in QT to get events from google calendar but when open it in QT creator get this output error messages:Unknown module(s) in QT: webkit webkitwidgets
    my version of QT is 5.8 -mingw-x86 I downloaded qtwebkit-tp5-qt58-mingw530-x86.zip
    from this link and extract it in theseC:\Qt\Qt5.8.0\5.8\mingw53_32 and C:\Qt\Qt5.8.0\Tools\mingw530_32 addresses but still I have that error
    .pro :

    QT       += core gui webkit network
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets
    
    INCLUDEPATH += ../qjson/include
    
    linux* {
    LIBS += ../qjson/build/lib/libqjson.so
    }
    
    win32-g++ {
        LIBS += ../qjson/build/lib/qjson0.dll
    }
    
    win32-msvc* {
        LIBS += ../qjson/build/lib/qjson0.lib
    }
    
    macx* {
    LIBS += -F../qjson/build/lib -framework qjson
    }
    
    
    TARGET = google_api_calendar_clent
    TEMPLATE = app
    
    

    how can I solve it?

    Is it an other easy way to get holidays? or I'm in the right way?

    JonBJ 1 Reply Last reply
    0
    • zhmhZ zhmh

      I want to get all holidays a year for save and use it in program , I found the google has Calendar API that I can send request to get listing of events like this link
      I found this library in QT to get events from google calendar but when open it in QT creator get this output error messages:Unknown module(s) in QT: webkit webkitwidgets
      my version of QT is 5.8 -mingw-x86 I downloaded qtwebkit-tp5-qt58-mingw530-x86.zip
      from this link and extract it in theseC:\Qt\Qt5.8.0\5.8\mingw53_32 and C:\Qt\Qt5.8.0\Tools\mingw530_32 addresses but still I have that error
      .pro :

      QT       += core gui webkit network
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkitwidgets
      
      INCLUDEPATH += ../qjson/include
      
      linux* {
      LIBS += ../qjson/build/lib/libqjson.so
      }
      
      win32-g++ {
          LIBS += ../qjson/build/lib/qjson0.dll
      }
      
      win32-msvc* {
          LIBS += ../qjson/build/lib/qjson0.lib
      }
      
      macx* {
      LIBS += -F../qjson/build/lib -framework qjson
      }
      
      
      TARGET = google_api_calendar_clent
      TEMPLATE = app
      
      

      how can I solve it?

      Is it an other easy way to get holidays? or I'm in the right way?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @zhmh said in How can get all holidays a year?:

      Unknown module(s) in QT: webkit webkitwidgets

      Google for exactly this string: you will find many hits (including this forum's https://forum.qt.io/topic/82894/project-error-unknown-module-s-in-qt-webkitwidgets), you need to install/build these modules.

      zhmhZ 1 Reply Last reply
      1
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #3

        Qt WebKit was discontinued from version 5.6. Given your requirements I'd advise to use a different method rather than making that library work. It's very easy, you just need QNetworkAccessManager to send a request to google and the QJson* classes to manage the reply.
        See https://stackoverflow.com/questions/30833844/get-holidays-list-of-a-country-from-google-calendar-api

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        zhmhZ 1 Reply Last reply
        5
        • VRoninV VRonin

          Qt WebKit was discontinued from version 5.6. Given your requirements I'd advise to use a different method rather than making that library work. It's very easy, you just need QNetworkAccessManager to send a request to google and the QJson* classes to manage the reply.
          See https://stackoverflow.com/questions/30833844/get-holidays-list-of-a-country-from-google-calendar-api

          zhmhZ Offline
          zhmhZ Offline
          zhmh
          wrote on last edited by zhmh
          #4

          @VRonin I did this before with other site for one date but with google calendar to get list of event I don't know how can I do

          int main(int argc, char *argv[])
          {
            QCoreApplication a(argc, argv);
                QNetworkRequest request(QUrl("https://pholiday.herokuapp.com/date/1398-3-5/holiday"));
          
            request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
          
          
            QNetworkAccessManager nam;
           QNetworkReply *reply = nam.get(request);
            while(!reply->isFinished()) {
                qApp->processEvents();
            }
            if (reply->error() == QNetworkReply::NoError)
            {
                QByteArray response_data = reply->readAll();
                QString s(response_data);
                qDebug("res:"+ response_data + "\n");
          return a.exec();
          }
          
          
          VRoninV 1 Reply Last reply
          0
          • JonBJ JonB

            @zhmh said in How can get all holidays a year?:

            Unknown module(s) in QT: webkit webkitwidgets

            Google for exactly this string: you will find many hits (including this forum's https://forum.qt.io/topic/82894/project-error-unknown-module-s-in-qt-webkitwidgets), you need to install/build these modules.

            zhmhZ Offline
            zhmhZ Offline
            zhmh
            wrote on last edited by zhmh
            #5

            @JonB I see this issue before and like I said I did this

            1-I downloaded qtwebkit-tp5-qt58-mingw530-x86.zip
            from this link and extract it in theseC:\Qt\Qt5.8.0\5.8\mingw53_32 and C:\Qt\Qt5.8.0\Tools\mingw530_32 addresses and C:\Qt\Qt5.8.0\5.8\mingw53_32\mkspecs\win32-msvc2005-2017

            2- Include webkitwidgets and webkit to .pro file;

            3-Include #include <QtWebKitWidgets/QWebView> in all header file

            4-Initialized the QWebView *mapBrowserView; object; in all .cpp

            but still I have that error

            JonBJ 1 Reply Last reply
            0
            • zhmhZ zhmh

              @JonB I see this issue before and like I said I did this

              1-I downloaded qtwebkit-tp5-qt58-mingw530-x86.zip
              from this link and extract it in theseC:\Qt\Qt5.8.0\5.8\mingw53_32 and C:\Qt\Qt5.8.0\Tools\mingw530_32 addresses and C:\Qt\Qt5.8.0\5.8\mingw53_32\mkspecs\win32-msvc2005-2017

              2- Include webkitwidgets and webkit to .pro file;

              3-Include #include <QtWebKitWidgets/QWebView> in all header file

              4-Initialized the QWebView *mapBrowserView; object; in all .cpp

              but still I have that error

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @zhmh
              Sorry, I don't know, I was just quoting you the link. As @VRonin says, although there is still a separate (third-party) maintenance of WebKitWidgets for later Qts, released Qt has moved over to WebEngine. I moved our own software over a while back. I don't know how much work it would be for you to consider converting your library to Engine in place of Kit if you chose to do that....

              1 Reply Last reply
              2
              • zhmhZ zhmh

                @VRonin I did this before with other site for one date but with google calendar to get list of event I don't know how can I do

                int main(int argc, char *argv[])
                {
                  QCoreApplication a(argc, argv);
                      QNetworkRequest request(QUrl("https://pholiday.herokuapp.com/date/1398-3-5/holiday"));
                
                  request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
                
                
                  QNetworkAccessManager nam;
                 QNetworkReply *reply = nam.get(request);
                  while(!reply->isFinished()) {
                      qApp->processEvents();
                  }
                  if (reply->error() == QNetworkReply::NoError)
                  {
                      QByteArray response_data = reply->readAll();
                      QString s(response_data);
                      qDebug("res:"+ response_data + "\n");
                return a.exec();
                }
                
                
                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7

                @zhmh said in How can get all holidays a year?:

                but with google calendar to get list of event I don't know how can I do

                @VRonin said in How can get all holidays a year?:

                See https://stackoverflow.com/questions/30833844/get-holidays-list-of-a-country-from-google-calendar-api

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                1

                • Login

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