mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 13:24:05 +00:00
fix: better QObject hierarchy
* set scanpopup's parent to null because it is a top level window. * set macClipboard as a child of the mainWindow
This commit is contained in:
parent
9079e2125d
commit
10a79372f8
|
@ -770,7 +770,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
applyQtStyleSheet( cfg.preferences.addonStyle, cfg.preferences.displayStyle, cfg.preferences.darkMode );
|
||||
|
||||
// Scanpopup related
|
||||
scanPopup = new ScanPopup(this, cfg, articleNetMgr, audioPlayerFactory.player(),
|
||||
scanPopup = new ScanPopup(nullptr, cfg, articleNetMgr, audioPlayerFactory.player(),
|
||||
dictionaries, groupInstances, history );
|
||||
|
||||
scanPopup->setStyleSheet(styleSheet());
|
||||
|
@ -795,7 +795,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
|
|||
connect( scanPopup, &ScanPopup::isWordPresentedInFavorites, this, &MainWindow::isWordPresentedInFavorites );
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
macClipboard = new gd_clipboard();
|
||||
macClipboard = new gd_clipboard(this);
|
||||
connect(macClipboard, &gd_clipboard::changed, this, &MainWindow::clipboardChange );
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue