mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-19 04:02:09 +01:00
Fixed flickering & QT4 problems
This commit is contained in:
parent
a9ce6f54c7
commit
f2bfd584d0
@ -9,8 +9,6 @@
|
|||||||
#include <QBasicTimer>
|
#include <QBasicTimer>
|
||||||
#include "popup.h"
|
#include "popup.h"
|
||||||
|
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
|
|
||||||
class Label : public QLabel
|
class Label : public QLabel
|
||||||
{
|
{
|
||||||
@ -28,6 +26,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent *event);
|
||||||
|
void contextMenuEvent(QContextMenuEvent *) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QBasicTimer _timer;
|
QBasicTimer _timer;
|
||||||
@ -107,7 +106,7 @@ bool Label::eventFilter(QObject *o, QEvent *ev)
|
|||||||
break;
|
break;
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
QRectF r(geometry().adjusted(-5, -20, 5, 20));
|
QRectF r(geometry().adjusted(-5, -20, 5, 20));
|
||||||
QPointF p(static_cast<QMouseEvent*>(ev)->screenPos());
|
QPointF p(static_cast<QMouseEvent*>(ev)->globalPos());
|
||||||
if (!r.contains(p))
|
if (!r.contains(p))
|
||||||
deleteAfterTimer();
|
deleteAfterTimer();
|
||||||
break;
|
break;
|
||||||
@ -152,11 +151,10 @@ void Popup::show(const QPoint &pos, const QString &text, QWidget *w)
|
|||||||
if (Label::_instance) {
|
if (Label::_instance) {
|
||||||
Label::_instance->stopTimer();
|
Label::_instance->stopTimer();
|
||||||
Label::_instance->setText(text);
|
Label::_instance->setText(text);
|
||||||
Label::_instance->resize(Label::_instance->sizeHint());
|
} else
|
||||||
} else {
|
|
||||||
Label::_instance = new Label(text);
|
Label::_instance = new Label(text);
|
||||||
Label::_instance->showNormal();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Label::_instance->resize(Label::_instance->sizeHint());
|
||||||
Label::_instance->place(pos, w);
|
Label::_instance->place(pos, w);
|
||||||
|
Label::_instance->showNormal();
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ QString ToolTip::toString() const
|
|||||||
|
|
||||||
html += "<div align=\"center\">";
|
html += "<div align=\"center\">";
|
||||||
html += QString("<a href=\"file:%0\">"
|
html += QString("<a href=\"file:%0\">"
|
||||||
"<img src=\"file:%0\" width=\"%1\" height=\"%2\"/></a>")
|
"<img src=\"%0\" width=\"%1\" height=\"%2\"/></a>")
|
||||||
.arg(_img.path(), QString::number(width), QString::number(height));
|
.arg(_img.path(), QString::number(width), QString::number(height));
|
||||||
html += "</div>";
|
html += "</div>";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user