Solved

Unknown module(s) in QT: webkitwidgets

Posted on 2015-02-23
7
1,516 Views
Last Modified: 2015-02-23
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
Comment
Question by:Nusrat Nuriyev
  • 4
  • 3
7 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 500 total points
Comment Utility
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
 

Author Comment

by:Nusrat Nuriyev
Comment Utility
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
 
LVL 86

Expert Comment

by:jkr
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Nusrat Nuriyev
Comment Utility
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
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
>>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
 

Author Comment

by:Nusrat Nuriyev
Comment Utility
Thank you :)
Con: 5 more characters to type ;o)
you have forgotten to mention two spaces :D
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Yes, but they are optional ;o)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now