In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Toolbar class
QToolBar
Shortcut item
QAciton
QToolBar* tb = addToolBar ("ToolBar"); / / addToolBar is a member function of the Qt main window, create a toolbar in the main window and get the pointer QAciton * action = new QAciton (", NULL); / / create a shortcut action- > setToolTip (" Open ") / / display open action- > setIcon (QIcon (": / Res/pic/open.png")) when the mouse is moved here; / / set the shortcut icon in the resource file / / path tb- > addAction (action); / / add the shortcut to the toolbar
1. Key member functions of QToolBar
-void setFloatable (bool floatable) / / sets whether it can be suspended in the created toolbar.
-void setMoveable (bool moveable) / / Settings toolbar cannot be moved
-void setIconSize (const QSize& iconSize) / / s sets the size of each shortcut icon in the toolbar
2. Any QWidget component can be added to QToolBar.
QToolBar * tb = addToolBar ("ToolBar"); QPushButton * b = new QPushButton ("Button"); QLabel * l = new QLable ("Label"); QLineEdit * e = new QLineEdit (); tb- > addWidget (b); tb- > addWidget (l); tb- > addWidget (e)
3. Toolbar application
This- > resize (800,480); QToolBar * tb = this- > addToolBar ("ToolBar"); QAction * action = new QAction ("", NULL); action- > setToolTip ("Open"); / / set the word action- > setIcon (QIcon (": / Res/open.png") that appears when the mouse moves over the shortcut /: indicates that the added picture is under the resource file, / Res is the prefix tb- > addAction (action) where the open.png is located in the resource file; / / add shortcut items to the toolbar tb- > setIconSize (QSize (100,100)); / / set the shortcut icon size tb- > setFloatable (false) in the toolbar; / / set the toolbar cannot be docked in another location tb- > setMovable (false) / / the Settings toolbar cannot be moved.
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.