Unsolved How can get all holidays a year?
-
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?
-
@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.
-
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 theQJson*
classes to manage the reply.
See https://stackoverflow.com/questions/30833844/get-holidays-list-of-a-country-from-google-calendar-api -
@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(); }
-
@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-20172- 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
-
@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.... -
@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