Make a QT that cannot be closedProgram(You need to close it in the task manager when you want to close it.) It seems very difficult,
In fact, it is not difficult, as long as the program starts itself when it is closed.
UpperCode:
# Include <qtgui> class temp: Public qwidget {q_object PRIVATE: qlabel * label; protected: void closeevent (qcloseevent * event); Public: temp (qwidget * parent = 0 );~ Temp () ;}; temp: temp (qwidget * parent): qwidget (parent) {label = new qlabel ("you can't close me, haha. ", this); qvboxlayout * layout = new qvboxlayout; Layout-> addwidget (Label); setlayout (layout); move (200,200);} temp ::~ Temp () {} void temp: closeevent (qcloseevent * event) {// reload the relational event function, enable the program to re-open its qprocess * P = new qprocess (this); qstring STR = qapplication: applicationfilepath (); P-> startdetached (STR );} # include "Main. MOC "int main (INT argc, char * argv []) {qapplication app (argc, argv); temp * temp = new temp; temp-> show (); return app.exe C ();}