#include "EPaperTest.h" #include "CppUnitTest.h" #include #include #include using namespace Microsoft::VisualStudio::CppUnitTestFramework; namespace UnitTest { TEST_CLASS(EPaperTest) { private: char* argv[1]; int argc; public: EPaperTest() :argv{ (char*)"" }, argc(1) {} TEST_METHOD(TestBothSidesRound) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); QApplication a(argc, argv); QLabel w; w.setFixedSize({296,128}); QImage image(QSize(296, 128), QImage::Format_RGB32); image.fill(Qt::red); w.setPixmap(QPixmap::fromImage(image)); w.show(); a.exec(); } }; }