Loading [MathJax]/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ViewportMdiSubWindow.cpp
1 #include "ViewportMdiSubWindow.h"
2 
3 #include <QCloseEvent>
4 #include <QDebug>
5 #include <QProgressBar>
6 #include <QVBoxLayout>
7 #include <QWidget>
8 
9 #include "CubeViewport.h"
10 #include "MdiCubeViewport.h"
11 
12 namespace Isis {
14  : QMdiSubWindow(parent) {
15  m_viewport = NULL;
16 
17  setWidget(new QWidget());
18 
19  widget()->setLayout(new QVBoxLayout());
20 
21  m_viewport = new MdiCubeViewport(cubeToView, NULL, widget());
22  widget()->layout()->addWidget(m_viewport);
23 
24  QProgressBar *progressBar = new QProgressBar;
25  progressBar->setRange(0, 100);
26  progressBar->setValue(0);
27 
28  connect(m_viewport, SIGNAL(progressChanged(int)),
29  progressBar, SLOT(setValue(int)));
30  connect(m_viewport, SIGNAL(progressComplete()), progressBar, SLOT(hide()));
31  connect(this, SIGNAL(closeViewport(CubeViewport *)),
32  m_viewport, SIGNAL(viewportClosed(CubeViewport *)));
33  widget()->layout()->addWidget(progressBar);
34 
35  setOption(QMdiSubWindow::RubberBandResize, true);
36  setOption(QMdiSubWindow::RubberBandMove, true);
37  }
38 
39 
41  m_viewport = NULL;
42  }
43 
44 
46  return m_viewport;
47  }
48 
49 
50  void ViewportMdiSubWindow::closeEvent(QCloseEvent *e) {
51  if (!m_viewport->confirmClose()) {
52  e->ignore();
53  }
54  else {
55  e->accept();
56  QMdiSubWindow::closeEvent(e);
58  }
59  }
60 }
Isis::MdiCubeViewport
Cube display widget for certain Isis MDI applications.
Definition: MdiCubeViewport.h:39
QWidget
QProgressBar
Isis::ViewportMdiSubWindow::closeEvent
virtual void closeEvent(QCloseEvent *e)
This method is called as the closeEvent.
Definition: ViewportMdiSubWindow.cpp:50
Isis::ViewportMdiSubWindow::~ViewportMdiSubWindow
~ViewportMdiSubWindow()
Deconstructor for ViewportMdiSubWindow.
Definition: ViewportMdiSubWindow.cpp:40
Isis::ViewportMdiSubWindow::ViewportMdiSubWindow
ViewportMdiSubWindow(Cube *cubeToView, QWidget *parent=NULL)
Constrctor for the ViewportMdiSubWindow.
Definition: ViewportMdiSubWindow.cpp:13
Isis::ViewportMdiSubWindow::m_viewport
QPointer< MdiCubeViewport > m_viewport
Pointer to the MdiCubeViewports.
Definition: ViewportMdiSubWindow.h:75
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::CubeViewport
Widget to display Isis cubes for qt apps.
Definition: CubeViewport.h:122
Isis::ViewportMdiSubWindow::closeViewport
void closeViewport(CubeViewport *vp)
This method closes the viewport.
Isis::ViewportMdiSubWindow::viewport
MdiCubeViewport * viewport()
Grabs the viewport.
Definition: ViewportMdiSubWindow.cpp:45
QMdiSubWindow
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:17:27