Merge remote-tracking branch 'origin/master' into master-mac-qt6

This commit is contained in:
Kazunari Sekigawa 2022-09-24 21:14:43 +09:00
commit 1c361ff17f
4 changed files with 23 additions and 7 deletions

View File

@ -112,7 +112,7 @@ equals(HAVE_RUBY, "1") {
plugins.depends += lay
klayout_main.depends += plugins $$MAIN_DEPENDS
klayout_main.depends += doc icons plugins $$MAIN_DEPENDS
} else {

View File

@ -302,6 +302,7 @@ klayout_main_cont (int &argc, char **argv)
if (non_ui_mode) {
app.reset (new lay::NonGuiApplication (argc, argv));
} else {
lay::GuiApplication::initialize ();
app.reset (new lay::GuiApplication (argc, argv));
lay::enable_signal_handler_gui (true);
}

View File

@ -1434,12 +1434,6 @@ GuiApplication::GuiApplication (int &argc, char **argv)
setStyle (new lay::BackgroundAwareTreeStyle (0));
setWindowIcon (QIcon (QString::fromUtf8 (":/logo.png")));
#if QT_VERSION >= 0x040500
setAttribute (Qt::AA_DontShowIconsInMenus, false);
#endif
#if QT_VERSION >= 0x050000
setAttribute (Qt::AA_UseHighDpiPixmaps, true);
#endif
}
GuiApplication::~GuiApplication ()
@ -1453,6 +1447,20 @@ GuiApplication::~GuiApplication ()
shutdown ();
}
void
GuiApplication::initialize ()
{
#if QT_VERSION >= 0x040500
QCoreApplication::setAttribute (Qt::AA_DontShowIconsInMenus, false);
#endif
#if QT_VERSION >= 0x050000
QCoreApplication::setAttribute (Qt::AA_UseHighDpiPixmaps, true);
#endif
#if QT_VERSION >= 0x050600
QCoreApplication::setAttribute (Qt::AA_EnableHighDpiScaling, true);
#endif
}
bool
GuiApplication::notify (QObject *receiver, QEvent *e)
{

View File

@ -390,6 +390,13 @@ public:
QApplication *qapp_gui () { return this; }
/**
* @brief Does some pre-initialization
*
* Must be called before the GuiApplication object is created
*/
static void initialize ();
/**
* @brief Reimplementation of notify from QApplication
*/