In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 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 is the use of Qt function body". 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 / / initialization form static void initTableView (QTableView * tableView, int rowHeight = 25, bool headVisible = false, bool edit = false); / pop-up message box static void showMessageBoxInfo (const QString & info, int closeSec = 0, bool exec = false); / / pop-up error box static void showMessageBoxError (const QString & info, int closeSec = 0, bool exec = false); / pop-up query box static int showMessageBoxQuestion (const QString & info) / / pop up + hide the information box in the lower right corner static void showTipBox (const QString & title, const QString & tip, bool fullScreen = false, bool center = true, int closeSec = 0); static void hideTipBox () / / pop-up input box static QString showInputBox (const QString & title, int type = 0, int closeSec = 0, const QString & placeholderText = QString (), bool pwd = false, const QString & defaultValue = QString ()); / / pop-up date selection box static void showDateSelect (QString & dateStart, QString & dateEnd, const QString & format = "yyyy-MM-dd") Function body void QUIHelper::initTableView (QTableView * tableView, int rowHeight, bool headVisible, bool edit) {/ / Odd and even row colors alternately tableView- > setAlternatingRowColors (false); / / whether the vertical header is visible tableView- > verticalHeader ()-> setVisible (headVisible); / / Select whether the row header is bold tableView- > horizontalHeader ()-> setHighlightSections (false); / / the last row is stretched to fill tableView- > horizontalHeader ()-> setStretchLastSection (true) / / minimum width size of row headers tableView- > horizontalHeader ()-> setMinimumSectionSize (0); / / maximum height of row headers tableView- > horizontalHeader ()-> setMaximumHeight (rowHeight); / / default row height tableView- > verticalHeader ()-> setDefaultSectionSize (rowHeight); / / when selected, tableView- > setSelectionBehavior (QAbstractItemView::SelectRows) is selected as a whole; / / only single tableView- > setSelectionMode (QAbstractItemView::SingleSelection) is allowed / the header cannot be clicked # if (QT_VERSION > QT_VERSION_CHECK) tableView- > horizontalHeader ()-> setSectionsClickable (false); # else tableView- > horizontalHeader ()-> setClickable (false); # endif / / enter edit mode if (edit) {tableView- > setEditTriggers (QAbstractItemView::CurrentChanged | QAbstractItemView::DoubleClicked);} else {tableView- > setEditTriggers (QAbstractItemView::NoEditTriggers) }} void QUIHelper::showMessageBoxInfo (const QString & info, int closeSec, bool exec) {# ifdef Q_OS_ANDROID QAndroid::Instance ()-> makeToast (info); # else if (exec) {QUIMessageBox msg; msg.setMessage (info, 0, closeSec); msg.exec ();} else {QUIMessageBox::Instance ()-> setMessage (info, 0, closeSec); QUIMessageBox::Instance ()-> show () } # endif} void QUIHelper::showMessageBoxError (const QString & info, int closeSec, bool exec) {# ifdef Q_OS_ANDROID QAndroid::Instance ()-> makeToast (info); # else if (exec) {QUIMessageBox msg; msg.setMessage (info, 2, closeSec); msg.exec ();} else {QUIMessageBox::Instance ()-> setMessage (info, 2, closeSec); QUIMessageBox::Instance ()-> show () } # endif} int QUIHelper::showMessageBoxQuestion (const QString & info) {QUIMessageBox msg; msg.setMessage (info, 1); return msg.exec ();} void QUIHelper::showTipBox (const QString & title, const QString & tip, bool fullScreen, bool center, int closeSec) {QUITipBox::Instance ()-> setTip (title, tip, fullScreen, center, closeSec); QUITipBox::Instance ()-> show ();} void QUIHelper::hideTipBox () {QUITipBox::Instance ()-> hide () } QString QUIHelper::showInputBox (const QString & title, int type, int closeSec, const QString & placeholderText, bool pwd, const QString & defaultValue) {QUIInputBox input; input.setParameter (title, type, closeSec, placeholderText, pwd, defaultValue); input.exec (); return input.getValue ();} void QUIHelper::showDateSelect (QString & dateStart, QString & dateEnd, const QString & format) {QUIDateSelect select Select.setFormat (format); select.exec (); dateStart = select.getStartDateTime (); dateEnd = select.getEndDateTime ();} "what are the ways to use the body of Qt functions"? 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.