MCPcopy Create free account
hub / github.com/cxasm/notepad-- / openFileInNewWin

Method openFileInNewWin

src/cceditor/ccnotepad.cpp:2545–2570  ·  view source on GitHub ↗

把文件在新窗口中打开。如果是新文件,则不行

Source from the content-addressed store, hash-verified

2543
2544//把文件在新窗口中打开。如果是新文件,则不行
2545void CCNotePad::openFileInNewWin(int index)
2546{
2547 QString path;
2548 QWidget* pw = ui.editTabWidget->widget(index);
2549 if (pw != nullptr)
2550 {
2551 if (-1 != getFileNewIndexProperty(pw))
2552 {
2553 return;
2554 }
2555
2556 path = getFilePathProperty(pw);
2557 slot_tabClose(index);
2558
2559 CCNotePad* pNewWin = new CCNotePad(false, nullptr);
2560 pNewWin->quickshow();
2561 pNewWin->setShareMem(this->getShareMem());
2562 pNewWin->setAttribute(Qt::WA_DeleteOnClose);
2563 pNewWin->openFile(path);
2564
2565#ifdef uos
2566 adjustWInPos(pNewWin);
2567#endif
2568 s_padInstances->append(pNewWin);
2569 }
2570}
2571void CCNotePad::slot_openFileInNewWin()
2572{
2573 int curIndex = ui.editTabWidget->currentIndex();

Callers

nothing calls this directly

Calls 7

getShareMemMethod · 0.95
getFileNewIndexPropertyFunction · 0.85
getFilePathPropertyFunction · 0.85
quickshowMethod · 0.80
setShareMemMethod · 0.80
openFileMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected