In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what are the general methods and class libraries of Qt". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Function name / / initialize the database static void initDb (const QString & dbName); / / initialize the file, copy static void initFile (const QString & sourceName, const QString & targetName) if it doesn't exist; / / create a new directory static void newDir (const QString & dirName); / / write messages to the additional message log file static void writeInfo (const QString & info, bool needWrite = false, const QString & filePath = "log") Static void writeError (const QString & info, bool needWrite = false, const QString & filePath = "log"); / / set the borderless form static void setFramelessForm (QWidget * widgetMain, QWidget * widgetTitle, QLabel * labIco, QPushButton * btnClose, bool tool = true); function body void QUIHelper::initDb (const QString & dbName) {initFile (QString (": /% 1.db") .arg (appName ()), dbName) } void QUIHelper::initFile (const QString & sourceName, const QString & targetName) {/ / determine whether the file exists. If it does not exist, QFile file (targetName) is copied from the resource file; if (! file.exists () | | file.size () = = 0) {file.remove (); QUIHelper::copyFile (sourceName, targetName);}} void QUIHelper::newDir (const QString & dirName) {QString strDir = dirName / / if the path contains a slash character, it means the absolute path / / linux system path character with / windows system path character with: / if (! strDir.startsWith ("/") & &! strDir.contains (": /") {strDir = QString ("% 1ram% 2") .arg (QUIHelper::appPath ()) .arg (strDir);} QDir dir (strDir) If (! dir.exists ()) {dir.mkpath (strDir);}} void QUIHelper::writeInfo (const QString & info, bool needWrite, const QString & filePath) {if (! needWrite) {return } QString fileName = QString ("% 1/%2/%3_runinfo_%4.txt") .arg (QUIHelper::appPath ()) .arg (filePath) .arg (QUIHelper::appName ()) .arg (QDate::currentDate () .toString ("yyyyMM")); QFile file (fileName); file.open (QIODevice::WriteOnly | QIODevice::Append | QFile::Text); QTextStream stream (& file) Stream setWindowFlags (Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);} IconHelper::Instance ()-> setIcon (labIco, QUIConfig::IconMain, QUIConfig::FontSize + 2); IconHelper::Instance ()-> setIcon (btnClose, QUIConfig::IconClose, QUIConfig::FontSize);} "what are the Qt general methods and class libraries"? thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.