diff options
| author | 2015-07-31 23:35:37 +0200 | |
|---|---|---|
| committer | 2015-07-31 23:35:37 +0200 | |
| commit | ba6e374f66ae00ca419820bcfcc462f04405ff46 (patch) | |
| tree | 8a251f49e0a3e19d140afc0bc49010a5fa81b39a /src | |
| parent | Fix AppVeyor build. (diff) | |
| download | KVIrc-ba6e374f66ae00ca419820bcfcc462f04405ff46.tar.gz KVIrc-ba6e374f66ae00ca419820bcfcc462f04405ff46.tar.bz2 KVIrc-ba6e374f66ae00ca419820bcfcc462f04405ff46.zip | |
Fix for minimizing to tray when using Qt5 in Windows
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvirc/ui/KviMainWindow.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/kvirc/ui/KviMainWindow.cpp b/src/kvirc/ui/KviMainWindow.cpp index f4259fa47..8f20a7e8a 100644 --- a/src/kvirc/ui/KviMainWindow.cpp +++ b/src/kvirc/ui/KviMainWindow.cpp @@ -793,6 +793,21 @@ void KviMainWindow::childWindowActivated(KviWindow *wnd, bool bForce) void KviMainWindow::changeEvent(QEvent * e) { +#ifndef COMPILE_ON_MAC + // For Qt5 this should be used to minimize to tray + if(e->type() == QEvent::WindowStateChange && KVI_OPTION_BOOL(KviOption_boolMinimizeInTray) && e->spontaneous()) + { + if(!trayIcon()) + { + executeInternalCommand(KVI_INTERNALCOMMAND_TRAYICON_SHOW); + } + if(trayIcon()) + { + KVI_OPTION_BOOL(KviOption_boolFrameIsMaximized) = isMaximized(); + QTimer::singleShot( 0, this, SLOT(hide()) ); + } + } +#endif if (e->type() == QEvent::ActivationChange) { //WINDOW (DE)ACTIVATION @@ -883,6 +898,7 @@ void KviMainWindow::closeEvent(QCloseEvent *e) } } +// For Qt4, see changeEvent method for Qt5 void KviMainWindow::hideEvent(QHideEvent *e) { #ifndef COMPILE_ON_MAC |
