Implemented initial support for floating widgets

This commit is contained in:
Uwe Kindler
2017-03-01 14:09:56 +01:00
parent b31c5f1f3d
commit 2c9ceb8645
15 changed files with 722 additions and 70 deletions

View File

@@ -229,6 +229,26 @@ void FloatingWidget::onCloseButtonClicked()
}
void FloatingWidget::setDraggingActive(bool Active)
{
if (m_DraggingActive == Active)
{
return;
}
m_DraggingActive = Active;
if (Active)
{
std::cout << "FloatingWidget:: InstallEventFilter" << std::endl;
qApp->installEventFilter(this);
}
else
{
std::cout << "FloatingWidget:: RemoveEventFilter" << std::endl;
qApp->removeEventFilter(this);
}
}
void FloatingWidget::changeEvent(QEvent *event)
{
QWidget::changeEvent(event);
@@ -251,28 +271,6 @@ void FloatingWidget::moveEvent(QMoveEvent *event)
}
}
void FloatingWidget::setDraggingActive(bool Active)
{
if (m_DraggingActive == Active)
{
return;
}
m_DraggingActive = Active;
if (Active)
{
std::cout << "FloatingWidget:: InstallEventFilter" << std::endl;
qApp->installEventFilter(this);
}
else
{
std::cout << "FloatingWidget:: RemoveEventFilter" << std::endl;
qApp->removeEventFilter(this);
}
}
bool FloatingWidget::event(QEvent *e)
{
if ((e->type() == QEvent::NonClientAreaMouseButtonPress))