Fixed tooltip now closing properly. Fixes #159

This commit is contained in:
fourtf 2017-12-24 23:56:08 +01:00
parent 91099c028e
commit 0ca4a098e1
4 changed files with 10 additions and 21 deletions

View file

@ -104,7 +104,14 @@ bool BaseWidget::nativeEvent(const QByteArray &eventType, void *message, long *r
}
#endif
void BaseWidget::focusOutEvent(QFocusEvent *)
void BaseWidget::changeEvent(QEvent *)
{
if (this->isWindow) {
TooltipWidget::getInstance()->hide();
}
}
void BaseWidget::leaveEvent(QEvent *)
{
if (this->isWindow) {
TooltipWidget::getInstance()->hide();

View file

@ -28,7 +28,8 @@ protected:
virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
#endif
virtual void focusOutEvent(QFocusEvent *) override;
virtual void changeEvent(QEvent *) override;
virtual void leaveEvent(QEvent *) override;
// XXX: Should this be pure virtual?
// fourtf: hell no

View file

@ -107,20 +107,6 @@ void Window::closeEvent(QCloseEvent *)
this->closed();
}
// void Window::changeEvent(QEvent *event)
//{
// if (!this->isActiveWindow()) {
// this->lostFocus.invoke();
// }
// BaseWidget::changeEvent(event);
//}
// void Window::leaveEvent(QEvent *event)
//{
// this->lostFocus.invoke();
// BaseWidget::leaveEvent(event);
//}
void Window::refreshTheme()
{
QPalette palette;

View file

@ -56,14 +56,9 @@ public:
boost::signals2::signal<void()> closed;
// pajlada::Signals::NoArgSignal lostFocus;
protected:
virtual void closeEvent(QCloseEvent *event) override;
// virtual void changeEvent(QEvent *event) override;
// virtual void leaveEvent(QEvent *event) override;
private:
float dpi;