diff --git a/QtQlistWidgetEx/ExQListWidget.cpp b/QtQlistWidgetEx/ExQListWidget.cpp index 7bfaa8f..66ac4f7 100644 --- a/QtQlistWidgetEx/ExQListWidget.cpp +++ b/QtQlistWidgetEx/ExQListWidget.cpp @@ -214,3 +214,9 @@ void ExQListWidget::on_listWidget_customContextMenuRequested(const QPoint &pos) menu->exec(QCursor::pos()); //在鼠标光标位置显示右键快捷菜单 delete menu; //手工创建的指针必须手工删除 } + +//退出 +void ExQListWidget::on_actExit_triggered() +{ + this->close(); +} diff --git a/QtQlistWidgetEx/ExQListWidget.h b/QtQlistWidgetEx/ExQListWidget.h index 7e9a7ab..83825de 100644 --- a/QtQlistWidgetEx/ExQListWidget.h +++ b/QtQlistWidgetEx/ExQListWidget.h @@ -28,6 +28,7 @@ private slots: void on_actSelInvs_triggered(); //反选已筛选的item void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous); //显示当前item的变动 void on_listWidget_customContextMenuRequested(const QPoint &pos); //ListWidget弹出鼠标右键菜单 + void on_actExit_triggered(); //退出软件 private: void setActionForToolBtn(); //创建cation和toolButton的关联 diff --git a/QtQlistWidgetEx/QtQlistWidgetEx.pro b/QtQlistWidgetEx/QtQlistWidgetEx.pro index 72fe7ea..a72dbd6 100644 --- a/QtQlistWidgetEx/QtQlistWidgetEx.pro +++ b/QtQlistWidgetEx/QtQlistWidgetEx.pro @@ -34,7 +34,7 @@ HEADERS += \ FORMS += \ ExQListWidget.ui -#RC_ICONS += qt.ico +RC_ICONS += qt.ico # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin