Solved

Unknown module(s) in QT: webkitwidgets

Posted on 2015-02-23
7
1,963 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
ID: 40626216
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
ID: 40626295
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
ID: 40626524
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:Nusrat Nuriyev
ID: 40626595
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
ID: 40626695
>>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
ID: 40626724
Thank you :)
Con: 5 more characters to type ;o)
you have forgotten to mention two spaces :D
0
 
LVL 86

Expert Comment

by:jkr
ID: 40627324
Yes, but they are optional ;o)
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

831 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