|
rock_widget_collection
0.1
|
#include <MultiViewWidget.h>
Inherits QWidget.
Public Slots | |
| void | updateView () |
| void | addWidget (const QString &name, QWidget *widget, const QIcon &icon=QIcon(), bool useOnlyIcon=false, int position=0) |
| QWidget * | getWidget (const QString &name) |
| void | deleteWidget (const QString &name) |
| void | widgetClicked () |
| void | setThumbnailSize (int width=150, int height=150) |
| WidgetButton * | getButtonForWidget (QWidget *widget) |
| QList< WidgetButton * > | getAllWidgetButtons () |
| void | setDesignerMode (bool designerMode) |
Signals | |
| void | widgetButtonAdded (QWidget *widget) |
Public Member Functions | |
| MultiViewWidget (QWidget *parent) | |
| virtual | ~MultiViewWidget () |
| void | childEvent (QChildEvent *event) |
| bool | event (QEvent *event) |
| bool | isDesignerMode () |
| void | fixStatus () |
Protected Attributes | |
| QHash< QString, WidgetButton * > | widgets |
| QGridLayout | layout |
| QHBoxLayout * | top |
| QHBoxLayout * | bottom |
| QVBoxLayout * | left |
| QVBoxLayout * | mid |
| QVBoxLayout * | right |
| WidgetButton * | currentWidget |
| int | thumbnailWidth |
| int | thumbnailHeight |
| QWidget * | pseudoWidget |
| bool | initialized |
| int | currentWidgetIndex |
| bool | clicking |
| bool | designerMode |
| QTimer | timer |
Widget which displays other widgets. All added widgets will be displayed as thumbnails either left, right, on top or below one widget. Thumbnail Widgets can be clicked to show in the main potion of the screen. S one widget will be the "active" widget which takes most of the sapce within the widget all other widgets will be displayed as small widget in one of the positions as mentioned above.
If there are any changes to an added widget, the thumnail will blink in red. This only works if the added widget has a notifyUpdate(int) signal. The signal will automatically be taken into account via the qt meta object infrastructure. The currently selected widget will be displayed with a name and is colorized in green to indicate selection.
The size and orientation of the thumbnails can be configurede via the methods setThumbnailPosition(int) and setThumnailSize(int, int).
If the widget is too time consuming or can not be properly displayed when being small one can either only show the widgets name or alternatively an icon.
The widget will try to resize teh viewable center widget as large as it can. If this is not the desired behaviour setting a fixed or maximum size will work properly, so the widget will not stretch to more than the given sizes.
Definition at line 45 of file MultiViewWidget.h.
| MultiViewWidget::MultiViewWidget | ( | QWidget * | parent | ) |
Constructor
| parent | parentWidget will be given to QWidgets constructor |
Definition at line 24 of file MultiViewWidget.cc.
|
virtual |
|
slot |
Adds a widget and a thumbnail to the widget
| name | the name given to the widget, must be unique. |
| widget | teh widget to add |
| icon | an icon as alternative for text or the wisget itself |
| useOnlyIcon | if only the icon and or text shall be displayed as thumbnail and NOT the widget |
Definition at line 116 of file MultiViewWidget.cc.
| void MultiViewWidget::childEvent | ( | QChildEvent * | event | ) |
Handles the events when a widget is added to or removed from the widget. This will not do anything when used in standalone mode, but will be used heavily when used in the qt designer.
When adding a widget to or removing a widget from the MultiViewWidget from within QTDesigner the childEvent method will map them to the corresponding methods within the MultiViewWidget. Thus enabling the widget to perform within the qt designer as container with teh desired functionality.
Note the only thing which does not work is the thumbnail widgets. Widgets will not be displayed as thumbnails within the designer, as the designer needs ownership of those. In Designer's preview everything will act asexpected
Definition at line 271 of file MultiViewWidget.cc.
|
slot |
Removes the widget with the given name. This will DELETE the widget that was added with that name!!
| name | the anme of the widget to remove |
Definition at line 242 of file MultiViewWidget.cc.
| bool MultiViewWidget::event | ( | QEvent * | event | ) |
Definition at line 260 of file MultiViewWidget.cc.
| void MultiViewWidget::fixStatus | ( | ) |
Fix the Status (names and view Style of all Widgets, this cannot be done during adding because rubyqt says all widets are QWidget
Definition at line 224 of file MultiViewWidget.cc.
|
slot |
|
slot |
Returns the widget which is shown on the Button
| widget | the widget for which the button shall be returned |
Definition at line 102 of file MultiViewWidget.cc.
|
slot |
Return sthe widget for the given name
| name | the name of the widget to return given when added via addWidget |
Definition at line 237 of file MultiViewWidget.cc.
|
inline |
Returns whether designer mode is enabled
Definition at line 146 of file MultiViewWidget.h.
|
inlineslot |
Sets whether designer mode is enabled (no small widgets) NOTE: You should normally never have to call this manually
| designerMode | true if the designer is shown, false otherwise |
Definition at line 140 of file MultiViewWidget.h.
|
slot |
Sets the size of teh thumbnail widgets. Defaults the thumbnails to 150x150.
| width | teh width of the thumbnails, defaults to 150 |
| height | the height of the thumbnails defaults to 150 |
Definition at line 96 of file MultiViewWidget.cc.
|
slot |
Definition at line 55 of file MultiViewWidget.cc.
|
signal |
Emitted when a new widget is added
| widget | the widget which was added to the MultiWidget |
|
slot |
Called when a thumbnail was clicked
Definition at line 336 of file MultiViewWidget.cc.
|
protected |
Definition at line 176 of file MultiViewWidget.h.
|
protected |
if a widget was clicked and the widgetClicked method is currently processing
Definition at line 194 of file MultiViewWidget.h.
|
protected |
The widget currently displayed in the center part of the widget
Definition at line 180 of file MultiViewWidget.h.
|
protected |
The current index for use with qt designer. automatically gives numbers instead of names
Definition at line 192 of file MultiViewWidget.h.
|
protected |
Whether the designer mode is enabled
Definition at line 196 of file MultiViewWidget.h.
|
protected |
Whether the view is already initialized
Definition at line 190 of file MultiViewWidget.h.
|
protected |
Main layout
Definition at line 174 of file MultiViewWidget.h.
|
protected |
Definition at line 177 of file MultiViewWidget.h.
|
protected |
Definition at line 177 of file MultiViewWidget.h.
|
protected |
Widget for Layouting purposes
Definition at line 187 of file MultiViewWidget.h.
|
protected |
Definition at line 177 of file MultiViewWidget.h.
|
protected |
The height of thumbnails
Definition at line 185 of file MultiViewWidget.h.
|
protected |
The width of thumbnails
Definition at line 183 of file MultiViewWidget.h.
|
protected |
Workaround to fix Ruby initialization, the widgets are not recognized well
Definition at line 199 of file MultiViewWidget.h.
|
protected |
Definition at line 176 of file MultiViewWidget.h.
|
protected |
Adds the menu to the widget, currently its only use is to have a testing environmentAll thumbnails and widgets added
Definition at line 172 of file MultiViewWidget.h.
1.8.13