把文件在新窗口中打开。如果是新文件,则不行
| 2543 | |
| 2544 | //把文件在新窗口中打开。如果是新文件,则不行 |
| 2545 | void 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 | } |
| 2571 | void CCNotePad::slot_openFileInNewWin() |
| 2572 | { |
| 2573 | int curIndex = ui.editTabWidget->currentIndex(); |
nothing calls this directly
no test coverage detected