qt

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 […]

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 […]

It seems QFileDialog::ShowDirsOnly does not work.¬† It is intended to show directories only. But it actually shows both files and directories. The Qt official document talks about two options related […]