Improve Qt4 -> Qt5 compatibility.

merge-requests/1/head
Teuniz 2015-12-29 14:07:51 +01:00
rodzic 4474b96baa
commit 3f833e63ef
5 zmienionych plików z 28 dodań i 1 usunięć

Wyświetl plik

@ -33,7 +33,7 @@
#define PROGRAM_NAME "DSRemote"
#define PROGRAM_VERSION "0.31_1512251807"
#define PROGRAM_VERSION "0.31_1512291404"
#define MAX_PATHLEN 4096

Wyświetl plik

@ -455,6 +455,19 @@ UI_Mainwindow::UI_Mainwindow()
vertScaleDial_timer = new QTimer(this);
vertScaleDial_timer->setSingleShot(true);
#if QT_VERSION >= 0x050000
scrn_timer->setTimerType(Qt::PreciseTimer);
adjdial_timer->setTimerType(Qt::PreciseTimer);
navDial_timer->setTimerType(Qt::PreciseTimer);
label_timer->setTimerType(Qt::PreciseTimer);
test_timer->setTimerType(Qt::PreciseTimer);
horPosDial_timer->setTimerType(Qt::PreciseTimer);
trigAdjDial_timer->setTimerType(Qt::PreciseTimer);
vertOffsDial_timer->setTimerType(Qt::PreciseTimer);
horScaleDial_timer->setTimerType(Qt::PreciseTimer);
vertScaleDial_timer->setTimerType(Qt::PreciseTimer);
#endif
connect(scrn_timer, SIGNAL(timeout()), this, SLOT(scrn_timer_handler()));
connect(scrn_thread, SIGNAL(finished()), this, SLOT(screenUpdate()));
connect(adjdial_timer, SIGNAL(timeout()), this, SLOT(adjdial_timer_handler()));

Wyświetl plik

@ -38,6 +38,9 @@ void UI_Mainwindow::save_screenshot()
opath[MAX_PATHLEN];
QPainter painter;
#if QT_VERSION >= 0x050000
painter.setRenderHint(QPainter::Qt4CompatiblePainting, true);
#endif
QPainterPath path;

Wyświetl plik

@ -55,6 +55,11 @@ SignalCurve::SignalCurve(QWidget *w_parent) : QWidget(w_parent)
trig_stat_timer = new QTimer(this);
#if QT_VERSION >= 0x050000
trig_line_timer->setTimerType(Qt::PreciseTimer);
trig_stat_timer->setTimerType(Qt::PreciseTimer);
#endif
bufsize = 0;
bordersize = 60;
@ -126,6 +131,9 @@ void SignalCurve::paintEvent(QPaintEvent *)
if(updates_enabled == true)
{
QPainter paint(this);
#if QT_VERSION >= 0x050000
paint.setRenderHint(QPainter::Qt4CompatiblePainting, true);
#endif
drawWidget(&paint, width(), height());

Wyświetl plik

@ -43,6 +43,9 @@ TLed::TLed(QWidget *p) : QWidget(p)
void TLed::paintEvent(QPaintEvent *)
{
QPainter paint(this);
#if QT_VERSION >= 0x050000
paint.setRenderHint(QPainter::Qt4CompatiblePainting, true);
#endif
drawLed(&paint);
}