php variable substitution/expansion
We know that a variable will be substituted with its value in a “” delimited string such as: $var1=”var1″; echo “this is $var1”; will print “this is var1”. This variable […]
We know that a variable will be substituted with its value in a “” delimited string such as: $var1=”var1″; echo “this is $var1”; will print “this is var1”. This variable […]
I never used Qt creator to create projects for source file management because I am scared by the mysterious .pro, .pro.user, Makefile Makefile.Debug, Makefile.Release, and the build directories Qt creator creates for […]
I had a case to use regexp to match unicode codes of chinese characters. The unicode codes are of the form \uxxxx where x is hexidecimal digit. To match them, […]
In a php file, you can define a string using ” ” or ‘ ‘. You specify what characters the string consists of in between ‘ ‘ or ” “such […]
The following code can print the current web page to an image. page()->setViewportSize(page()->mainFrame()->contentsSize()); QImage *image=new QImage(page()->mainFrame()->contentsSize(), QImage::Format_ARGB32); QPainter *painter = new QPainter(image); page()->mainFrame()->render(painter); image->save(QString(“images/%1.png”).arg(name)); However there are some issues […]
By default, if you click a link on a QWebView window, QWebView will open the url in its own window if the link has not a target=”_blank” attribute, and do […]
Today, when I opened one of my qt program(normally this program will open a website on its GUI), I found it could not load and display the website as usual. […]
Although it is called QFileInfo, QFileInfo not only handle files but also directories. This function is often used to traverse all items under a directory including files and sub-directories. QFileInfo::fileName() […]
You may think it is easy to get the QWebFrame object for an iframe element in a web page since QWebFrame is formed by iframe/frame(http://doc.qt.io/qt-5/qwebview.html) and there must be a […]
To obtain the text on a textarea element, you may think about using QWebElement::attribute(“value”) because the text seems to be the value of the textarea element. But actually what is […]