
Originally Posted by
arnaizf
I did it a few minutes ago for my application. In main.cpp, write:
Now you do not have close button, neither a menu close and ALT-F4 won't work.
Hope this can be helpful.
I'm using Qt4 under Linux
I believe another way around would be hijacking close event, add this ti header file:
private:
private:
void closeEvent(QCloseEvent *event) override;
To copy to clipboard, switch view to plain text mode
and this to cpp file:
{
cout << "Here in close" << endl;
event->ignore();
}
void MainWindow::closeEvent(QCloseEvent *event)
{
cout << "Here in close" << endl;
event->ignore();
}
To copy to clipboard, switch view to plain text mode
More info? https://doc.qt.io/qt-5/qwidget.html#closeEvent
Bookmarks