scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

AbstractPart.cpp
Go to the documentation of this file.
1 
11 
30 #include "AbstractPart.h"
31 #include "PartMdiView.h"
32 #include <QMenu>
33 #include <QStyle>
34 
36 {
37  if (!d_mdi_window)
38  d_mdi_window = new PartMdiView(this, view());
39  return d_mdi_window;
40 }
41 
43 {
44  QMenu * menu = AbstractAspect::createContextMenu();
45  Q_ASSERT(menu);
46  const QStyle *widget_style = d_mdi_window->style();
47 
48  QAction *action_temp;
49  if(d_mdi_window->windowState() & (Qt::WindowMinimized | Qt::WindowMaximized))
50  {
51  action_temp = menu->addAction(tr("&Restore"), d_mdi_window, SLOT(showNormal()));
52  action_temp->setIcon(widget_style->standardIcon(QStyle::SP_TitleBarNormalButton));
53  }
54  if(!(d_mdi_window->windowState() & Qt::WindowMinimized))
55  {
56  action_temp = menu->addAction(tr("Mi&nimize"), d_mdi_window, SLOT(showMinimized()));
57  action_temp->setIcon(widget_style->standardIcon(QStyle::SP_TitleBarMinButton));
58  }
59  if(!(d_mdi_window->windowState() & Qt::WindowMaximized))
60  {
61  action_temp = menu->addAction(tr("Ma&ximize"), d_mdi_window, SLOT(showMaximized()));
62  action_temp->setIcon(widget_style->standardIcon(QStyle::SP_TitleBarMaxButton));
63  }
64 
65  return menu;
66 }
67 
AbstractPart.h
AbstractPart::d_mdi_window
PartMdiView * d_mdi_window
The MDI sub-window that is wrapped around my primary view.
Definition: AbstractPart.h:83
AbstractAspect::createContextMenu
virtual QMenu * createContextMenu() const
Return a new context menu.
Definition: AbstractAspect.cpp:303
AbstractPart::view
virtual QWidget * view()=0
Construct a primary view on me.
AbstractPart::mdiSubWindow
PartMdiView * mdiSubWindow()
Wrap the view() into a PartMdiView.
Definition: AbstractPart.cpp:35
PartMdiView
MDI sub window that implements functions common to all aspect views.
Definition: PartMdiView.h:50
AbstractPart::createContextMenu
virtual QMenu * createContextMenu() const
Return AbstractAspect::createContextMenu() plus operations on the primary view.
Definition: AbstractPart.cpp:42
PartMdiView.h