| 2915 | //} |
| 2916 | |
| 2917 | bool NixNote::event(QEvent *event) { |
| 2918 | |
| 2919 | if (event->type() == QEvent::WindowStateChange && isMinimized()) { |
| 2920 | if (minimizeToTray) { |
| 2921 | hide(); |
| 2922 | return false; |
| 2923 | } |
| 2924 | } |
| 2925 | |
| 2926 | if (event->type() == QEvent::Close) { |
| 2927 | if (closeToTray && isVisible()) { |
| 2928 | QLOG_DEBUG() << "overriding close event"; |
| 2929 | this->toggleVisible(); |
| 2930 | event->ignore(); |
| 2931 | return false; |
| 2932 | } |
| 2933 | } |
| 2934 | return QMainWindow::event(event); |
| 2935 | } |
| 2936 | |
| 2937 | |
| 2938 |
nothing calls this directly
no test coverage detected