diff --git a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp index 5680ca3f6a..2b8a957709 100644 --- a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp +++ b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.cpp @@ -23,7 +23,11 @@ int main(int argc, char* argv[]) QLabel lab; // 1. we will paint into a QPixmap +#if QT_VERSION >= QT_VERSION_CHECK(6,0,0) const qreal dpr = lab.devicePixelRatioF(); +#else + const dpr=1.0; +#endif QPixmap pix(600*dpr,400*dpr); pix.setDevicePixelRatio(dpr); pix.fill(QColor("white")); @@ -42,13 +46,13 @@ int main(int argc, char* argv[]) // 3. here we do the painting painter.begin(&pix); - mathText.draw(painter, Qt::TopLeftCorner, QRectF(0,0,pix.width(), pix.height()), false); + mathText.draw(painter, Qt::AlignVCenter|Qt::AlignHCenter, QRectF(0,0,pix.width()/dpr, pix.height()/dpr), false); painter.end(); // now we display and resize the label as a window lab.setPixmap(pix); lab.show(); - lab.resize(600,400); + lab.resize(pix.width()/dpr,pix.height()/dpr); return app.exec(); } diff --git a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro index f858472fec..7b013017ff 100644 --- a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro +++ b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest.pro @@ -4,15 +4,17 @@ TEMPLATE = app SOURCES += jkqtmathtext_simpletest.cpp CONFIG += link_prl qt -QT += core gui xml svg +QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport DEPENDPATH += ../../lib ../../qmake/staticlib/jkqtmathtextlib INCLUDEPATH += ../../lib CONFIG (debug, debug|release) { + DEPENDPATH += ../../qmake/staticlib/jkqtmathtextlib/debug LIBS += -L../../qmake/staticlib/jkqtmathtextlib/debug -ljkqtmathtextlib_debug } else { + DEPENDPATH += ../../qmake/staticlib/jkqtmathtextlib/release LIBS += -L../../qmake/staticlib/jkqtmathtextlib/release -ljkqtmathtextlib } message("LIBS = $$LIBS") diff --git a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest_and_lib.pro b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest_and_lib.pro index 832c4ab304..922854f31e 100644 --- a/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest_and_lib.pro +++ b/examples/jkqtmathtext_simpletest/jkqtmathtext_simpletest_and_lib.pro @@ -1,8 +1,8 @@ TEMPLATE = subdirs -SUBDIRS += jkqtplotterlib jkqtmathtext_simpletest +SUBDIRS += jkqtmathtextlib jkqtmathtext_simpletest -jkqtplotterlib.file = ../../qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro +jkqtmathtextlib.file = ../../qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro jkqtmathtext_simpletest.file=$$PWD/jkqtmathtext_simpletest.pro -jkqtmathtext_simpletest.depends = jkqtplotterlib +jkqtmathtext_simpletest.depends = jkqtmathtextlib diff --git a/examples/jkqtmathtext_test/jkqtmathtext_test.pro b/examples/jkqtmathtext_test/jkqtmathtext_test.pro index 3c6a4cc054..573064796c 100644 --- a/examples/jkqtmathtext_test/jkqtmathtext_test.pro +++ b/examples/jkqtmathtext_test/jkqtmathtext_test.pro @@ -1,37 +1,19 @@ -include($$PWD/asana.pri) - -LIBS += - +TARGET = jkqtmathtext_test +TEMPLATE SOURCES += jkqtmathtext_test.cpp \ testform.cpp -RCC_DIR = rccs - -CONFIG += link_prl qt windows - - -TARGET = jkqtmathtext_test - -QT += core gui svg xml - -UI_DIR = .uics - HEADERS += testform.h -OBJECTS_DIR = .objs +FORMS += testform.ui -INCLUDEPATH += - -MOC_DIR = .mocs - -FORMS += \ - testform.ui - -DESTDIR = ./ +include($$PWD/asana.pri) DEFINES += AUTOLOAD_XITS_FONTS AUTOLOAD_Asana_FONTS +CONFIG += link_prl qt windows +QT += core gui svg xml greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport