[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3012
  • Last Modified:

Unknown module(s) in QT: webkitwidgets

Error while building project in Qt.
Code in my .pro file
 QT += network webkitwidgets

Open in new window


:-1: error: Unknown module(s) in QT: webkitwidgets

Generally, I need to add build this

http://qt-project.org/doc/qt-4.8/webkit-webftpclient.html

My qt is 5.0.2 is that a problem?
0
Nusrat Nuriyev
Asked:
Nusrat Nuriyev
  • 4
  • 3
2 Solutions
 
jkrCommented:
The version is fine - but: Do you have WebKit installed (and built)? It's been a year or two since I last worked with WebKit, but IIRC it is not included in the setup/build process by default. See https://trac.webkit.org/wiki/BuildingQtOnLinux and the subsection "Building WebKit" on that.
0
 
Nusrat NuriyevAuthor Commented:
Yeap, when you work with new technology 97% of time is spend on building not programming :)
That's known issue.

root@nusik-PC:/tmp# git clone git://gitorious.org/webkit/webkit.git
Cloning into 'webkit'...
remote: Counting objects: 2233225, done.
remote: Compressing objects: 100% (410870/410870), done.

Open in new window


Do I need to download 6 GB(with 2 mln files) in order to compile a few lines?
:)
0
 
jkrCommented:
If you try to go 'slim', Qt is the wrong route anyway, the runtime libs alone are *huge*. If your goal is to download files using FTP, why not using cURL (or, to be specific, libcurl)? http://curl.haxx.se/libcurl/
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Nusrat NuriyevAuthor Commented:
I've got you.
The requirement is crossplatform GUI.

I have recently worked with curl :)
By the  way,  could you make code review of this source code?
http://programmist.az/getting-currency-rates-from-central-bank/
0
 
jkrCommented:
>>The requirement is crossplatform GUI.

OK, that's a good reason to use Qt - but not without mentioning wxWidgets (http://wxwidgets.org/) as well.

>>By the  way,  could you make code review of this source code?

Sure, looks OK overall, only small things to criticise:

- in 'get_currency_rate_from_xml()' you're mixing both 'cerr()' and 'stderr', I assume you forgot to change the latter.

- 'get_currency_rate_from_xml()' is declared to return an 'int', yet it in fact not all control paths return a value. It's only '-1' on failure, but no value is returned on success. The compiler should issue an error here.

- in 'main()':

            if (res != CURLE_OK)
            {
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                                curl_easy_strerror(res));
                in.close();
                out.close();
                fclose(bodyfile);
                fclose(headerfile);
                curl_easy_cleanup(curl);
 
            }
            else
            {
                usleep(500500);
                fclose(bodyfile);
                fclose(headerfile);
                curl_easy_cleanup(curl);
                double drate = 0;
 
                get_currency_rate_from_xml(bodyfilename.c_str(), drate, "UAH");
                cout << ratecount++ << ": " << cur_date << " " << drate << endl;
                out << cur_date << " " << drate << endl;
            }

Open in new window


could be rewritten as

            if (res != CURLE_OK)
            {
                fprintf(stderr, "curl_easy_perform() failed: %s\n",
                                curl_easy_strerror(res));

                curl_easy_cleanup(curl);
            }
            else
            {
                usleep(500500);
                curl_easy_cleanup(curl);
                double drate = 0;
 
                get_currency_rate_from_xml(bodyfilename.c_str(), drate, "UAH");
                cout << ratecount++ << ": " << cur_date << " " << drate << endl;
                out << cur_date << " " << drate << endl;
            }

            in.close();  // not really needed, the destructor will do that
            out.close();  // not really needed, the destructor will do that
            fclose(bodyfile);
            fclose(headerfile);

Open in new window


- general: I tend to always initialize pointers to 'NULL' when they're declared. Pro: No weird behaviour, always a segfault when hit. Con: 5 more characters to type ;o)
0
 
Nusrat NuriyevAuthor Commented:
Thank you :)
Con: 5 more characters to type ;o)
you have forgotten to mention two spaces :D
0
 
jkrCommented:
Yes, but they are optional ;o)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now