QWebEngine is a new web browser engine introduced in Qt 5.4, it’s used to replace the old QWebView. QWebView is based on WebKit, while QWebEngine is based on Chromium browser, so it’s faster and supports more features.
I wrote a very simple program to test QWebEngine, following is the code:
Compiling and running is smooth. But when I tried to run this demo on another machine, it crashed, and an error dialog is shown with the message “An unknown software exception (0×80000003) has occurred at 0x023c5b7e. Click OK to terminate the program.”
By chekcing the log file (debug.log) I found some helpful information:
WebServlet annotation is introduced in Servlet 3.0, it’s used to simplify the servlet creation (we don’t need to define it and its URL mapping in web.xml)
The WebServlet annotation usage is
Then the user can visit /servlet/GetMailFileOwner to access this servlet
But today I met a problem with using WebServlet annotation. First I added WebServlet on the Linux machine (Eclipse Luna), and switched to another Windows machine (MyEclipse), then I tried to rebuild the project, I got following error:
WebServlet cannot be resolved toatype
On the Windows machine, I use the default servlet.jar which is added when I create the new Dynamic Web Project. But I replaced the default servlet.jar file with Tomcat 8.0 libraries.
So the solution is to add Tomcat 8.0 libraries to Java Build Path (We need first download Tomcat 8.0 and set it up for Eclipse, otherwise Eclipse will not find this Tomcat 8.0 libraries)
Sometimes we don’t want to make some form fields non-editable to users, like Product ID, Order Created Date, Post Author, etc.
For HTML text input and textarea controls, we can add “readonly” attribute to disallow users to modify their value, but this attribute will not work for checkbox control. So how should we disable the checkbox (or set it as readonly)? The “disabled” attribute will do the job
<input type="checkbox"checked disabled>
(It works for both radio box and checkbox)
You will see following checkbox and radio button is disabled:
When I tried to import the “paramiko” module, I got following error:
No module named Crypto.PublicKey
That means we need to install pycrypto library. Run following command to install pycrypto library by using pip:
pip install pycrypto
In the installation I got a different error message:
error: Unable to find vcvarsall.bat
That means we need a C compiler to compile this extension. But we can also download a pre-built extension for windows: http://www.voidspace.org.uk/python/modules.shtml#pycrypto
After installing this extension and tried to import “paramiko” module, I got the error “No module named Crypto.PublicKey” again. We should rename “crypto” directory under “Lib/site-packages” to “Crypto”, then importing paramiko will work.