Qt:QToolButton 喜欢ヅ旅行 2023-01-12 11:40 67阅读 0赞 功能和pushButton类型,其他类似, ![be568f93096a430dd9e1f2728e84b187dcc.jpg][] 只是将mywidget中改成了 #include "mywidget.h" #include <qapplication.h> #include <qtoolbutton.h> #include <qfont.h> MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { setMinimumSize( 200, 120 ); setMaximumSize( 200, 120 ); QToolButton *quit = new QToolButton(this); quit->setText("quit"); quit->setGeometry( 62, 40, 75, 30 ); quit->setFont( QFont( "Times", 18, QFont::Bold ) ); connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) ); } MyWidget::~MyWidget() { } [be568f93096a430dd9e1f2728e84b187dcc.jpg]: /images/20221119/75f791ac37c04fccbe8fb7db31ba7c42.png
还没有评论,来说两句吧...