Event accept

This commit is contained in:
Klaus Basan
2015-12-13 19:56:35 +01:00
parent 953dee6060
commit d3487bb375
3 changed files with 6 additions and 4 deletions

View File

@@ -157,7 +157,7 @@ namespace BlackGui
// which is the only visible one // which is the only visible one
// selecting is tab text independent (can be hidden) // selecting is tab text independent (can be hidden)
if (!this->m_tabBar || this->m_tabBar->count() < 1) { return nullptr; } if (!this->m_tabBar || this->m_tabBar->count() < 1) { return nullptr; }
foreach(const CDockWidgetInfoArea * ia, m_dockWidgetInfoAreas) for (const CDockWidgetInfoArea *ia : m_dockWidgetInfoAreas)
{ {
if (ia->isFloating()) { continue; } if (ia->isFloating()) { continue; }
if (ia->isWidgetVisible()) { return ia; } if (ia->isWidgetVisible()) { return ia; }
@@ -177,7 +177,7 @@ namespace BlackGui
QList<const CDockWidgetInfoArea *> CInfoArea::getDockWidgetInfoAreas() const QList<const CDockWidgetInfoArea *> CInfoArea::getDockWidgetInfoAreas() const
{ {
QList<const CDockWidgetInfoArea *> constDockWidgets; QList<const CDockWidgetInfoArea *> constDockWidgets;
foreach(const CDockWidgetInfoArea * dockWidgetInfoArea, m_dockWidgetInfoAreas) for (const CDockWidgetInfoArea *dockWidgetInfoArea : m_dockWidgetInfoAreas)
{ {
constDockWidgets.append(dockWidgetInfoArea); constDockWidgets.append(dockWidgetInfoArea);
} }
@@ -246,10 +246,12 @@ namespace BlackGui
if (event->key() == Qt::Key_Right) if (event->key() == Qt::Key_Right)
{ {
this->selectRightTab(); this->selectRightTab();
event->accept();
} }
else if (event->key() == Qt::Key_Left) else if (event->key() == Qt::Key_Left)
{ {
this->selectLeftTab(); this->selectLeftTab();
event->accept();
} }
else else
{ {

View File

@@ -154,7 +154,7 @@ namespace BlackGui
if (this->isVisible() && event->key() == Qt::Key_Escape) if (this->isVisible() && event->key() == Qt::Key_Escape)
{ {
this->close(); this->close();
event->setAccepted(true); event->accept();
} }
else else
{ {

View File

@@ -74,7 +74,7 @@ namespace BlackGui
if (m_overlayMessages && event->key() == Qt::Key_Escape) if (m_overlayMessages && event->key() == Qt::Key_Escape)
{ {
m_overlayMessages->close(); m_overlayMessages->close();
event->setAccepted(true); event->accept();
} }
else else
{ {