MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / createNewWindow

Method createNewWindow

src/NotepadNextApplication.cpp:472–493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472MainWindow *NotepadNextApplication::createNewWindow()
473{
474 Q_ASSERT(window == Q_NULLPTR);
475
476 window = new MainWindow(this);
477
478 // Keep Lua's editor reference up to date
479 connect(window, &MainWindow::editorActivated, this, [](ScintillaNext *editor) {
480 LuaExtension::Instance().setEditor(editor);
481 });
482
483 // TODO: this shouldn't be dependent on a MainWindow closing, but this works for now
484 // since the assumption is MainWindow::aboutToClose() infers the application is shutting
485 // down but the editors are still active.
486 connect(window, &MainWindow::aboutToClose, this, &NotepadNextApplication::saveSession);
487
488 // Timer to autosave the session
489 connect(&autoSaveTimer, &QTimer::timeout, this, &NotepadNextApplication::saveSession);
490 autoSaveTimer.start(60 * 1000);
491
492 return window;
493}
494
495QStringList NotepadNextApplication::debugInfo() const
496{

Callers

nothing calls this directly

Calls 2

startMethod · 0.80
setEditorMethod · 0.45

Tested by

no test coverage detected