QT close 没有调用析构?
Login::Login(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::Login)
{
ui->setupUi(this);
。。。
}
Login::~Login()
{
qDebug()<< "inner destrucor...";
delete ui;
}
Login::Jump123(){
//Mainpage *mp = new... // 另一个界面
//mp.show(); // 大概这意思
this->close();
qDebug()<< "inner Jump...";
}
运行后,页面跳转问题的,但是没有进入login的析构函数,只有关掉窗口才能调用,那close与hide有啥区别,甚至用了this->destory();同样没有销毁
另外,这个close还是QWidget的一个槽,页面跳转,怎么销毁当前页面,做到真正的跳转?
[slot] bool QWidget::close()
Closes this widget. Returns true if the widget was closed; otherwise returns false.
First it sends the widget a QCloseEvent. The widget is hidden if it accepts the close event. If it ignores the event, nothing happens. The default implementation of QWidget::closeEvent() accepts the close event.
If the widget has the Qt::WA_DeleteOnClose flag, the widget is also deleted. A close events is delivered to the widget no matter if the widget is visible or not.
The QApplication::lastWindowClosed() signal is emitted when the last visible primary window (i.e. window with no parent) with the Qt::WA_QuitOnClose attribute set is closed. By default this attribute is set for all widgets except transient windows such as splash screens, tool windows, and popup menus.
...全文
相关推荐
QT读写word
QT是Qt Company开发的一种跨平台应用程序开发框架,广泛用于创建GUI(图形用户界面)和非GUI应用程序。
Qt 调用USB HID
**Qt调用USB HID**是关于使用Qt框架与USB设备通信的一个主题,特别是涉及到HID(Human Interface Device)类设备,如键盘、鼠标或游戏控制器等。
QT主界面调用模态对话框示例程序
QT框架是Qt公司开发的一款强大的跨平台应用程序开发框架,它提供了丰富的API和工具,使得开发者可以轻松地创建出美观且功能丰富的桌面及移动应用。
QT 窗口切换
QT框架是Qt公司开发的一种跨平台应用程序开发框架,主要用C++语言编写,广泛应用于桌面应用、嵌入式系统和移动设备。
基于qt平台的halcon读图的basler相机调用
在本文中,我们将深入探讨如何在Qt平台上使用Halcon库来调用Basler相机进行图像采集。首先,我们要理解三个核心概念:Qt、Halcon和Basler相机。


