我想在Qt建立一个独一无二的申请,处理ole窗的近距离、最小化和最大化。 我的目标只是要在申请截止日期之前展示一些信息,即点击“近海顿”。
此外,我希望将申请降至最低程度,而不是任务限制。 然而,在用户点击系统的一个县时,似乎没有任何信号或事件可以处理。
是否可能?
我想在Qt建立一个独一无二的申请,处理ole窗的近距离、最小化和最大化。 我的目标只是要在申请截止日期之前展示一些信息,即点击“近海顿”。
此外,我希望将申请降至最低程度,而不是任务限制。 然而,在用户点击系统的一个县时,似乎没有任何信号或事件可以处理。
是否可能?
我认为,你不能通过Qt提供的APIC处理这种“信号”(管理、最大化和关闭管理QCoreApplic的终端窗口)。
但QCoreApplication about ToQuit()。 或许你可以利用它做你想要做的事情(例如,在终点站做成像),但不知道用户是否能够及时阅读。
尽量减少对拖拉的申请:很可能无法在终端应用中使用Qt AP。 但是,在http://doc.qt.io/qt-5/qapplication.html“rel=“nofollow noreferer”上完全可以做到。 (有窗户)。 见。 这回答了类似的SO问题。
You can use POSIX signals both in Linux and Windows #include
void quit_handle( int ) {
qApp->quit();
}
int main( int argc, char *argv[] ) {
QCoreApplication a(argc, argv);
...
signal( SIGINT, quit_handle );
return a.exec();
}
我只用Windows+MinGW对它进行了测试,但我认为,它也会在短链氯化石蜡中工作。
Are you using a Unix / Linux or a Windows? If you are using Unix or Linux you might want to look into the Posix / Unix Signals. They do not offer any solution to the maximize / minimize buttons, but they give you the possibility to at least catch the System Signal when you hit the close button. From my experience, the aboutToQuit() Signal is not as fast as a custom override of the Signal Handler.
一旦你抓住信号,你就可以处理信号。
这里为习俗信号手提供了良好的辅导:
I created an application for Windows in C++ using QT. If I want to port it to Linux or Mac OS, will sizeof(int) or sizeof(long) change? In other words, do types in QT applications for different ...
If I had a class A, where one of its functions does: void A::func() { emit first_signal(); emit second_signal(); } Assuming that a class B has 2 slots, one connected to first_signal, and the ...
I m using Qt and want a platform-independent way of getting the available free disk space. I know in Linux I can use statfs and in Windows I can use GetDiskFreeSpaceEx(). I know boost has a way, ...
I m working on a small project in QT (well, pyQT4 actually, but it shouldn t matter too much) and I ve run into the following problem. I have a QTableView with several rows and columns. I have set the ...
I m having big troubles with drag & drop. I ve created a new Qt Designer Form Class in which I have one QListWidget and one QWidget. Now I want to enable dragging & dropping between these two ...
I creating a small desktop application using Qt and Poco on Mac OS X Snow Leopard. Qt works fine, but once I started linking with Poco I get the following warning: ld: warning: in /Developer/SDKs/...
My friend and I have each created parts of a GUI using Qt 4. They both work independently and I am trying to integrate his form with the my main window. As of now this is the code I am using to try ...
Is there an equivalent of .NET s data binding in Qt? I want to populate some combo boxes and other widgets with QStrings that refer to specific entities in my database. However, it would be cleaner ...