diverse bugfixes to qmake build-system

This commit is contained in:
jkriege2 2022-07-21 22:17:29 +02:00
parent dc715221c7
commit 25feb0b5fd
4 changed files with 18 additions and 30 deletions

View File

@ -23,7 +23,11 @@ int main(int argc, char* argv[])
QLabel lab; QLabel lab;
// 1. we will paint into a QPixmap // 1. we will paint into a QPixmap
#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
const qreal dpr = lab.devicePixelRatioF(); const qreal dpr = lab.devicePixelRatioF();
#else
const dpr=1.0;
#endif
QPixmap pix(600*dpr,400*dpr); QPixmap pix(600*dpr,400*dpr);
pix.setDevicePixelRatio(dpr); pix.setDevicePixelRatio(dpr);
pix.fill(QColor("white")); pix.fill(QColor("white"));
@ -42,13 +46,13 @@ int main(int argc, char* argv[])
// 3. here we do the painting // 3. here we do the painting
painter.begin(&pix); 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(); painter.end();
// now we display and resize the label as a window // now we display and resize the label as a window
lab.setPixmap(pix); lab.setPixmap(pix);
lab.show(); lab.show();
lab.resize(600,400); lab.resize(pix.width()/dpr,pix.height()/dpr);
return app.exec(); return app.exec();
} }

View File

@ -4,15 +4,17 @@ TEMPLATE = app
SOURCES += jkqtmathtext_simpletest.cpp SOURCES += jkqtmathtext_simpletest.cpp
CONFIG += link_prl qt CONFIG += link_prl qt
QT += core gui xml svg QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
DEPENDPATH += ../../lib ../../qmake/staticlib/jkqtmathtextlib DEPENDPATH += ../../lib ../../qmake/staticlib/jkqtmathtextlib
INCLUDEPATH += ../../lib INCLUDEPATH += ../../lib
CONFIG (debug, debug|release) { CONFIG (debug, debug|release) {
DEPENDPATH += ../../qmake/staticlib/jkqtmathtextlib/debug
LIBS += -L../../qmake/staticlib/jkqtmathtextlib/debug -ljkqtmathtextlib_debug LIBS += -L../../qmake/staticlib/jkqtmathtextlib/debug -ljkqtmathtextlib_debug
} else { } else {
DEPENDPATH += ../../qmake/staticlib/jkqtmathtextlib/release
LIBS += -L../../qmake/staticlib/jkqtmathtextlib/release -ljkqtmathtextlib LIBS += -L../../qmake/staticlib/jkqtmathtextlib/release -ljkqtmathtextlib
} }
message("LIBS = $$LIBS") message("LIBS = $$LIBS")

View File

@ -1,8 +1,8 @@
TEMPLATE = subdirs 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.file=$$PWD/jkqtmathtext_simpletest.pro
jkqtmathtext_simpletest.depends = jkqtplotterlib jkqtmathtext_simpletest.depends = jkqtmathtextlib

View File

@ -1,37 +1,19 @@
include($$PWD/asana.pri) TARGET = jkqtmathtext_test
TEMPLATE
LIBS +=
SOURCES += jkqtmathtext_test.cpp \ SOURCES += jkqtmathtext_test.cpp \
testform.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 HEADERS += testform.h
OBJECTS_DIR = .objs FORMS += testform.ui
INCLUDEPATH += include($$PWD/asana.pri)
MOC_DIR = .mocs
FORMS += \
testform.ui
DESTDIR = ./
DEFINES += AUTOLOAD_XITS_FONTS AUTOLOAD_Asana_FONTS 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 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport