Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
omni::ui::FullScreen Class Reference

Widget for fullscreen display. More...

#include <FullScreen.h>

Inheritance diagram for omni::ui::FullScreen:
Inheritance graph
[legend]
Collaboration diagram for omni::ui::FullScreen:
Collaboration graph
[legend]

Public Slots

void deleteIfScreenRemoved (QScreen *)
 

Public Member Functions

 FullScreen (const QScreen *_screen)
 
 ~FullScreen ()
 
void hideDragWidget ()
 
void showDragWidget (int _subIndex, QColor const &_color)
 
void attach (int _subIndex, QWidget *_widget)
 
void detach (int _subIndex)
 
void detachAll ()
 

Protected Member Functions

void closeEvent (QCloseEvent *_event)
 
void resizeEvent (QResizeEvent *_event)
 

Private Member Functions

void setGeometry (QWidget *, int _subIndex) const
 

Private Attributes

QScreen const * screen_
 
std::map< int, QWidget * > widgets_
 
QUniquePtr< ScreenSetupDragWidgetdragWidget_
 

Detailed Description

Widget for fullscreen display.

Constructor & Destructor Documentation

omni::ui::FullScreen::FullScreen ( const QScreen *  _screen)
27  :
28  screen_(_screen),
29  dragWidget_(new ScreenSetupDragWidget(this))
30  {
31  setStyleSheet("* { background:black; }");
32  setWindowFlags(Qt::CustomizeWindowHint);
33  setWindowFlags(Qt::FramelessWindowHint);
34  QWidget::setGeometry(_screen->geometry());
35  this->hide();
36 
37  connect(QGuiApplication::instance(),SIGNAL(screenRemoved(QScreen*)),
38  this,SLOT(deleteIfScreenRemoved(QScreen*)));
39  }
void deleteIfScreenRemoved(QScreen *)
Definition: FullScreen.cpp:41
QUniquePtr< ScreenSetupDragWidget > dragWidget_
Definition: FullScreen.h:60
QScreen const * screen_
Definition: FullScreen.h:58
omni::ui::FullScreen::~FullScreen ( )
49  {
50  detachAll();
51  }
void detachAll()
Definition: FullScreen.cpp:53

Member Function Documentation

void omni::ui::FullScreen::attach ( int  _subIndex,
QWidget *  _widget 
)
76  {
77  if (widgets_.count(_subIndex) > 0)
78  {
79  detach(_subIndex);
80  }
82  repaint();
83 
84  widgets_[_subIndex] = _widget;
85 
86  setGeometry(_widget, _subIndex);
87  _widget->setParent(this);
88  _widget->show();
89  _widget->raise();
90  _widget->update();
91 
92  showFullScreen();
93  }
void setGeometry(QWidget *, int _subIndex) const
Definition: FullScreen.cpp:104
std::map< int, QWidget * > widgets_
Definition: FullScreen.h:59
void hideDragWidget()
Definition: FullScreen.cpp:95
void detach(int _subIndex)
Definition: FullScreen.cpp:64
void omni::ui::FullScreen::closeEvent ( QCloseEvent *  _event)
protected
127  {
128  detachAll();
129  }
void detachAll()
Definition: FullScreen.cpp:53
void omni::ui::FullScreen::deleteIfScreenRemoved ( QScreen *  _screen)
slot
41  {
43  this->hide();
44  this->deleteLater();
45  }
46  }
QScreen const * screen_
Definition: FullScreen.h:58
static QScreen const * standardScreen()
Return standard screen, where omnidome has to be placed.
Definition: ScreenSetup.cpp:52
void omni::ui::FullScreen::detach ( int  _subIndex)
65  {
66  if (widgets_.count(_subIndex) == 0) return;
67 
68  widgets_[_subIndex]->hide();
69  widgets_[_subIndex]->setParent(nullptr);
70  widgets_.erase(_subIndex);
71 
72  if (widgets_.empty()) hide();
73  }
std::map< int, QWidget * > widgets_
Definition: FullScreen.h:59
void omni::ui::FullScreen::detachAll ( )
54  {
55  for (auto& _widget : widgets_)
56  {
57  _widget.second->hide();
58  _widget.second->setParent(nullptr);
59  }
60  widgets_.clear();
61  hide();
62  }
std::map< int, QWidget * > widgets_
Definition: FullScreen.h:59
void omni::ui::FullScreen::hideDragWidget ( )
96  {
97  dragWidget_->setColor("#FFFFFF");
98  dragWidget_->repaint();
99  dragWidget_->hide();
100 
101  if (widgets_.empty()) hide();
102  }
QUniquePtr< ScreenSetupDragWidget > dragWidget_
Definition: FullScreen.h:60
std::map< int, QWidget * > widgets_
Definition: FullScreen.h:59
void omni::ui::FullScreen::resizeEvent ( QResizeEvent *  _event)
protected
131  {
132  if (this->geometry() != screen_->geometry()) {
133  deleteIfScreenRemoved(const_cast<QScreen*>(screen_));
134  }
135  }
void deleteIfScreenRemoved(QScreen *)
Definition: FullScreen.cpp:41
QScreen const * screen_
Definition: FullScreen.h:58
void omni::ui::FullScreen::setGeometry ( QWidget *  _widget,
int  _subIndex 
) const
private

Todo

105  {
106  /// Todo
108 
109  if (_subIndex < 0) _subIndex = 0;
110 
111  if (_subIndex >= _subScreenCount) _subIndex = _subScreenCount - 1;
112 
114  _widget->setGeometry(ScreenSetup::subScreenRectForScreen(_subIndex,screen_));
115  }
QScreen const * screen_
Definition: FullScreen.h:58
Singleton class which manages the current screen setup.
Definition: ScreenSetup.h:34
static int subScreenCountForScreen(QScreen const *)
Static method for getting subscreen count for screen Screen must not be nullptr! ...
Definition: ScreenSetup.cpp:136
void omni::ui::FullScreen::showDragWidget ( int  _subIndex,
QColor const &  _color 
)
118  {
119  setGeometry(dragWidget_.get(), _subIndex);
120  dragWidget_->show();
121  dragWidget_->setColor(_color);
122  dragWidget_->raise();
123  showFullScreen();
124  }
QUniquePtr< ScreenSetupDragWidget > dragWidget_
Definition: FullScreen.h:60
void setGeometry(QWidget *, int _subIndex) const
Definition: FullScreen.cpp:104

Field Documentation

QUniquePtr<ScreenSetupDragWidget> omni::ui::FullScreen::dragWidget_
private
QScreen const* omni::ui::FullScreen::screen_
private
std::map<int, QWidget *> omni::ui::FullScreen::widgets_
private

The documentation for this class was generated from the following files: