projectWindow
parent
70a6edf824
commit
4782eedf9c
|
@ -522,6 +522,11 @@ MainWindow::~MainWindow() {
|
|||
delete ui;
|
||||
}
|
||||
|
||||
MainWindow* MainWindow::projectWindow(const QString &fileName) {
|
||||
for (auto w : openWindows) if (w->project && w->project->fileName == fileName) return w;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* e) {
|
||||
if (promptSave()) {
|
||||
e->ignore();
|
||||
|
@ -547,6 +552,8 @@ bool MainWindow::eventFilter(QObject *obj [[maybe_unused]], QEvent *event) {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MainWindow::openProject(const QString& fileName, bool failSilent) {
|
||||
auto np = FileOps::loadProject(fileName);
|
||||
if (!np) {
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace Xybrid {
|
|||
~MainWindow() override;
|
||||
|
||||
static std::unordered_set<MainWindow*> openWindows;
|
||||
static MainWindow* projectWindow(const QString& fileName);
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui;
|
||||
|
|
Loading…
Reference in New Issue