25 lines
542 B
C++
25 lines
542 B
C++
#include "arrowrectangle.h"
|
|
|
|
#include <DApplication>
|
|
|
|
ArrowRectangle::ArrowRectangle(ArrowDirection direction, QWidget *parent)
|
|
: DArrowRectangle(direction, DArrowRectangle::FloatWindow, parent)
|
|
{
|
|
connect(qApp, &DApplication::focusChanged, this, [=](QWidget* old, QWidget* now){
|
|
Q_UNUSED(old);
|
|
if (now != this && !this->isAncestorOf(now))
|
|
{
|
|
hide();
|
|
}
|
|
});
|
|
}
|
|
|
|
void ArrowRectangle::hideEvent(QHideEvent *e)
|
|
{
|
|
Q_UNUSED(e);
|
|
emit hideWindow();
|
|
}
|
|
|
|
ArrowRectangle::~ArrowRectangle()
|
|
{}
|