#include </home/clem/local/src/opie/libopie2/opieui/big-screen/owidgetstack.h>
Collaboration diagram for Opie::Ui::OWidgetStack:

Public Types | |
| enum | Mode { SmallScreen, BigScreen, NoForce } |
Public Slots | |
| void | raiseWidget (int) |
| void | raiseWidget (QWidget *) |
| void | hideWidget (int) |
| void | hideWidget (QWidget *) |
| void | setMainWindow (QWidget *) |
| void | setMainWindow (int) |
Signals | |
| void | modeChanged (enum Mode mode) |
| void | aboutToShow (QWidget *) |
| void | aboutToShow (int) |
Public Member Functions | |
| OWidgetStack (QWidget *parent, const char *name=0, WFlags fl=0) | |
| ~OWidgetStack () | |
| enum Mode | mode () const |
| void | forceMode (enum Mode) |
| void | addWidget (QWidget *, int) |
| void | removeWidget (QWidget *) |
| QWidget * | widget (int) const |
| int | id (QWidget *) const |
| QWidget * | visibleWidget () const |
| bool | eventFilter (QObject *, QEvent *) |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *) |
Private Member Functions | |
| void | switchStack () |
| void | switchTop () |
Private Attributes | |
| QMap< int, QWidget * > | m_list |
| QWidgetStack * | m_stack |
| QWidget * | m_mWidget |
| QWidget * | m_last |
| enum Mode | m_mode |
| bool | m_forced: 1 |
| Private * | d |
OWidgetStack is the answer to the problem of using Opie at different screen sizes and to have a different behaviour. Most applications use a QWidgetStack to supply a view on click. And by clicking the (X) you go back but this behaviour feels strange on bigger screens. It's ok on smaller one because one can't determine the difference. This stack reads the default out of the size of the desktop widget but can be forced to have either the one or the other behaviour. The first widget added is considered the 'main' widget and its sizeHint will be taking if in BigScreen mode. In small screen mode this widget behaves exactly like a QWidgetStack and in BigScreen mode it'll use the MainWindow as child of this widget and arranges the others as hidden top level widgets.
Definition at line 59 of file owidgetstack.h.
|
|
Definition at line 62 of file owidgetstack.h. |
|
||||||||||||||||
|
This is the standard widget. For simple usage see the example. Normally this widget is the central widget of a QMainWindow. Use removeWidget before you delete a widget yourself. OWidgetStack does not yet recognize removal of children.
Definition at line 55 of file owidgetstack.cpp. References m_forced, m_last, m_mWidget, m_stack, and switchStack(). |
|
|
The destructor. It deletes also all added widgets. Definition at line 75 of file owidgetstack.cpp. References QMap< Key, T >::begin(), BigScreen, QMap< Key, T >::clear(), QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), m_list, and m_mode. |
|
|
|
|
|
These two signals are emitted whenever we're about to show one of the widgets Referenced by raiseWidget(), and switchStack(). |
|
||||||||||||
|
Adds a widget to the stack. The first widget added is considered to be the mainwindow. This is important because if Opie is in BigScreen mode the sizeHint of the MainWindow will be returned. In Small Screen the sizeHint of the QWidgetStack is returned. See QWidgetStack::sizeHint. This widget takes ownership of the widget and may even reparent. All windows will be hidden
Definition at line 141 of file owidgetstack.cpp. References QMap< Key, T >::insert(), m_list, m_mode, m_mWidget, m_stack, and SmallScreen. Referenced by PMainWindow::closeEvent(), PMainWindow::initT(), and PMainWindow::setupViewWindow(). |
|
||||||||||||
|
Definition at line 312 of file owidgetstack.cpp. References m_forced, Opie::Ui::mode_size, size, switchStack(), and switchTop(). |
|
|
You can also force one of the modes and then this widget stops on listening to size changes. You can revert to the scanning behaviour by setting mode to NoForce Definition at line 102 of file owidgetstack.cpp. References BigScreen, m_forced, m_mode, Opie::Ui::mode_size, NoForce, SmallScreen, switchStack(), switchTop(), and width. Referenced by PMainWindow::slotForceSmall(). |
|
|
This is overloaded and only differs in the parameters it takes. Definition at line 303 of file owidgetstack.cpp. References BigScreen, m_last, m_mode, m_mWidget, and raiseWidget(). |
|
|
This will hide the currently visible widget and raise the widget specified by the parameter. Note that this method does not use visibleWIdget but remembers the last raisedWidget Definition at line 292 of file owidgetstack.cpp. References BigScreen, m_last, m_mode, m_mWidget, and raiseWidget(). |
|
|
Tries to find the assigned id for the widget or returns -1 if no widget could be found
Definition at line 226 of file owidgetstack.cpp. References QMap< Key, T >::begin(), QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), and m_list. |
|
|
return the mode of the desktop. There are currently two modes. SmallScreen with a normal PDA resolution and BigScreen with resolutions greater than 330 for width and height. You can also force the mode this widget is in with forceMode() Note that NoForce will be never returned from here Definition at line 92 of file owidgetstack.cpp. References m_mode. Referenced by PMainWindow::polish(), PMainWindow::setupActions(), and PMainWindow::setupViewWindow(). |
|
|
OWidgetStack monitors the Desktop Widget for size changes if it recignizes a change size it'll send a signal and adjust its mode. After the signal was emitted. During the signal a call to mode() the old mode will be returned. Note that if a size change happens but no modeChange no signal will be emitted
|
|
|
This is an overloaded function and only differs in its parameters.
Definition at line 269 of file owidgetstack.cpp. References aboutToShow(), m_last, m_mode, m_stack, and SmallScreen. |
|
|
This method raises the widget wit the specefic id. Note that in BigScreen mode the widget is made visible but the other ( previous) visible widget(s) will not be made invisible. If you need this use hideWidget().
Definition at line 261 of file owidgetstack.cpp. References widget(). Referenced by StackExample::closeEvent(), hideWidget(), PMainWindow::raiseIconView(), PMainWindow::setupViewWindow(), PMainWindow::slotConfig(), PMainWindow::slotDisplay(), and PMainWindow::slotShowInfo(). |
|
|
Remove the widget from the stack it'll be reparented to 0 and ownership is dropped. You need to delete it. If the removed widget was the mainwindow consider to call setMainWindow.
Definition at line 176 of file owidgetstack.cpp. References m_list, m_mode, m_mWidget, m_stack, QMap< Key, T >::remove(), and SmallScreen. Referenced by PMainWindow::initT(). |
|
|
Definition at line 328 of file owidgetstack.cpp. References m_mode, m_mWidget, m_stack, and SmallScreen. |
|
|
this is an overloaded member and only differs in the type of arguments.
Definition at line 375 of file owidgetstack.cpp. References setMainWindow(), and widget(). |
|
|
setMainWindow gives the OWidgetStack a hint which window should always stay inside the stack. Normally the first added widget is considered to be the mainwindow but you can change this with this function. If in BigScreen mode the current mainwindow will be reparented and hidden. The position will be taken by the new one. If the old MainWindow was hidden the new window will also be hidden. If the window was visible the new mainwindow will be made visible too and the old one hidden. If there was no mainwindow it will be hidden as well.
Definition at line 353 of file owidgetstack.cpp. References BigScreen, m_mode, and m_mWidget. Referenced by setMainWindow(). |
|
|
Definition at line 383 of file owidgetstack.cpp. References aboutToShow(), QMap< Key, T >::begin(), QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), m_list, m_mode, m_mWidget, m_stack, and SmallScreen. Referenced by eventFilter(), forceMode(), and OWidgetStack(). |
|
|
Definition at line 417 of file owidgetstack.cpp. References QMap< Key, T >::begin(), BigScreen, QMap< Key, T >::end(), QMap< Key, T >::isEmpty(), m_list, m_mode, and m_stack. Referenced by eventFilter(), and forceMode(). |
|
|
This function returns the currently visible widget. In BigScreen mode the mainwindow is returned Definition at line 245 of file owidgetstack.cpp. References m_mode, m_mWidget, m_stack, and SmallScreen. Referenced by StackExample::closeEvent(), PMainWindow::closeEvent(), and PMainWindow::slotConfig(). |
|
|
This function tries to find the widget with the id. You supplied a possible id in addWIdget. Note that not QWidget::winId() is used.
Definition at line 217 of file owidgetstack.cpp. References m_list. Referenced by raiseWidget(), and setMainWindow(). |
|
|
Definition at line 126 of file owidgetstack.h. |
|
|
Definition at line 124 of file owidgetstack.h. Referenced by eventFilter(), forceMode(), and OWidgetStack(). |
|
|
Definition at line 121 of file owidgetstack.h. Referenced by hideWidget(), OWidgetStack(), and raiseWidget(). |
|
|
Definition at line 118 of file owidgetstack.h. Referenced by addWidget(), id(), removeWidget(), switchStack(), switchTop(), widget(), and ~OWidgetStack(). |
|
|
Definition at line 123 of file owidgetstack.h. Referenced by addWidget(), forceMode(), hideWidget(), mode(), raiseWidget(), removeWidget(), resizeEvent(), setMainWindow(), switchStack(), switchTop(), visibleWidget(), and ~OWidgetStack(). |
|
|
Definition at line 120 of file owidgetstack.h. Referenced by addWidget(), hideWidget(), OWidgetStack(), removeWidget(), resizeEvent(), setMainWindow(), switchStack(), and visibleWidget(). |
|
|
Definition at line 119 of file owidgetstack.h. Referenced by addWidget(), OWidgetStack(), raiseWidget(), removeWidget(), resizeEvent(), switchStack(), switchTop(), and visibleWidget(). |
1.4.2