Added dynamic property used to hide the window when inactive.

git-svn-id: http://voip.null.ro/svn/yate@2499 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2009-02-27 16:58:10 +00:00
parent a683c2f5f7
commit 93c1a84caf
2 changed files with 13 additions and 0 deletions

View File

@ -314,6 +314,7 @@ using namespace TelEngine;
static String s_propHHeader = "dynamicHHeader"; // Tables: show/hide the horizontal header
static String s_propAction = "dynamicAction"; // Prefix for properties that would trigger some action
static String s_propWindowFlags = "dynamicWindowFlags"; // Window flags
static String s_propHideInactive = "dynamicHideOnInactive"; // Hide inactive window
static String s_qtPropPrefix = "_q_"; // QT dynamic properties prefix
//
static Qt4ClientFactory s_qt4Factory;
@ -1630,6 +1631,17 @@ bool QtWindow::getProperty(const String& name, const String& item, String& value
return obj ? QtClient::getProperty(obj,item,value) : false;
}
bool QtWindow::event(QEvent* ev)
{
if (ev->type() == QEvent::WindowDeactivate) {
String hideProp;
QtClient::getProperty(wndWidget(),s_propHideInactive,hideProp);
if (hideProp && hideProp.toBoolean())
setVisible(false);
}
return QWidget::event(ev);
}
void QtWindow::closeEvent(QCloseEvent* event)
{
// NOTE: Don't access window's data after calling hide():

View File

@ -452,6 +452,7 @@ protected:
{ updatePosSize(); }
virtual void resizeEvent(QResizeEvent* event)
{ updatePosSize(); }
virtual bool event(QEvent* ev);
virtual void mousePressEvent(QMouseEvent* event);
virtual void mouseReleaseEvent(QMouseEvent* event);
virtual void mouseMoveEvent(QMouseEvent* event);