Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • external
  • win32
win32.cpp
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2009 Mj Mendoza IV
6Copyright (C) 2012-2020 Matthew Chiawen Chang
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17*/
18
19#include "platformhandler.h"
20
21#include <QCoreApplication>
22#include <QSettings>
23
24#include <ShObjIdl.h>
25
26#include "pencildef.h"
27
28namespace PlatformHandler
29{
30 void configurePlatformSpecificSettings() {}
31 bool isDarkMode() { return false; }
32 void initialise()
33 {
34#if _WIN32_WINNT >= _WIN32_WINNT_WIN7
35 QString version(APP_VERSION);
36 if (version.startsWith("99.0.0")) {
37 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D.Nightly");
38 } else if (version == "0.0.0.0") {
39 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D.Development");
40 } else {
41 SetCurrentProcessExplicitAppUserModelID(L"Pencil2D.Pencil2D.Release");
42 }
43#endif // _WIN32_WINNT >= _WIN32_WINNT_WIN7
44
45#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
46 // Temporary solution for high DPI displays
47 // EnableHighDpiScaling is a just in case mechanism in the event that we
48 // want to disable this without recompiling, see #922
49 QSettings settings(PENCIL2D, PENCIL2D);
50 if (settings.value("EnableHighDpiScaling", "true").toBool())
51 {
52 // Enable auto screen scaling on high dpi display, for example, a 4k monitor
53 // This attr has to be set before the QApplication is constructed
54 // Only works on Windows & X11
55 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
56 }
57#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
58 };
59}
QCoreApplication::setAttribute
void setAttribute(Qt::ApplicationAttribute attribute, bool on)
QSettings
QString
Qt::AA_EnableHighDpiScaling
AA_EnableHighDpiScaling
Generated on Fri Feb 27 2026 07:33:49 for Pencil2D by doxygen 1.9.6 based on revision e1e2bc04715617e3bb4d4796f67a4493290639ca