KMdiChildView Class Reference
Base class for all your special view windows. More...
#include <kmdichildview.h>

Public Slots | |
virtual void | attach () |
virtual void | detach () |
virtual void | minimize () |
virtual void | maximize () |
virtual void | restore () |
virtual void | youAreAttached (KMdiChildFrm *lpC) |
virtual void | youAreDetached () |
virtual void | slot_clickedInWindowMenu () |
virtual void | slot_clickedInDockMenu () |
virtual void | show () |
virtual void | hide () |
virtual void | raise () |
virtual void | showMinimized () |
virtual void | showMaximized () |
virtual void | showNormal () |
Signals | |
void | attachWindow (KMdiChildView *, bool) |
void | detachWindow (KMdiChildView *, bool) |
void | focusInEventOccurs (KMdiChildView *) |
void | gotFocus (KMdiChildView *) |
void | activated (KMdiChildView *) |
void | lostFocus (KMdiChildView *) |
void | deactivated (KMdiChildView *) |
void | childWindowCloseRequest (KMdiChildView *) |
void | windowCaptionChanged (const QString &) |
void | tabCaptionChanged (const QString &) |
void | mdiParentNowMaximized (bool) |
void | clickedInWindowMenu (int) |
void | clickedInDockMenu (int) |
void | isMaximizedNow () |
void | isMinimizedNow () |
void | isRestoredNow () |
void | isAttachedNow () |
void | isDetachedNow () |
void | iconUpdated (QWidget *, QPixmap) |
void | captionUpdated (QWidget *, const QString &) |
Public Member Functions | |
KMdiChildView (const QString &caption, QWidget *parentWidget=0L, const char *name=0L, WFlags f=0) | |
KMdiChildView (QWidget *parentWidget=0L, const char *name=0L, WFlags f=0) | |
~KMdiChildView () | |
void | activate () |
void | setFirstFocusableChildWidget (QWidget *) |
void | setLastFocusableChildWidget (QWidget *) |
QWidget * | focusedChildWidget () |
bool | isAttached () const |
const QString & | caption () const |
const QString & | tabCaption () const |
virtual void | setCaption (const QString &szCaption) |
virtual void | setTabCaption (const QString &caption) |
virtual void | setMDICaption (const QString &caption) |
KMdiChildFrm * | mdiParent () const |
bool | isMinimized () const |
bool | isMaximized () const |
QRect | internalGeometry () const |
void | setInternalGeometry (const QRect &newGeomety) |
QRect | externalGeometry () const |
void | setExternalGeometry (const QRect &newGeomety) |
virtual QPixmap * | myIconPtr () |
virtual void | minimize (bool bAnimate) |
virtual void | maximize (bool bAnimate) |
QRect | restoreGeometry () |
void | setRestoreGeometry (const QRect &newRestGeo) |
void | removeEventFilterForAllChildren () |
void | setWindowMenuID (int id) |
virtual void | setMinimumSize (int minw, int minh) |
virtual void | setMaximumSize (int maxw, int maxh) |
bool | isToolView () const |
void | updateTimeStamp () |
const QDateTime & | getTimeStamp () const |
Protected Slots | |
void | slot_childDestroyed () |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *e) |
virtual bool | eventFilter (QObject *obj, QEvent *e) |
virtual void | focusInEvent (QFocusEvent *e) |
virtual void | focusOutEvent (QFocusEvent *e) |
virtual void | resizeEvent (QResizeEvent *e) |
void | trackIconAndCaptionChanges (QWidget *view) |
Protected Attributes | |
QString | m_szCaption |
QString | m_sTabCaption |
QWidget * | m_focusedChildWidget |
QWidget * | m_firstFocusableChildWidget |
QWidget * | m_lastFocusableChildWidget |
int | m_windowMenuID |
bool | m_stateChanged |
QDateTime | m_time |
Friends | |
class | KMdiMainFrm |
class | KMdiChildFrm |
Detailed Description
Base class for all your special view windows.
Base class for all MDI view widgets. KMdi stores additional information in this class to handle the attach/detach mechanism and such things.
All such windows 'lives' attached to a KMdiChildFrm widget managed by KMdiChildArea, or detached (managed by the window manager.) So remember that the KMdiChildView::parent pointer may change, and may be 0L, too.
There are 2 possibilities for you to put your widgets under MDI control:
Either you inherit all the views from KMdiChildView:
class MyMdiWidget : public KMdiChildView { .... }; ... MyMdiWidget w; mainframe->addWindow(w, flags);
or you wrap them by a KMdiChildView somehow like this:
void DocViewMan::addKMdiFrame(QWidget* pNewView, bool bShow, const QPixmap& icon) { // cover it by a KMdi childview and add that MDI system KMdiChildView* pMDICover = new KMdiChildView( pNewView->caption()); pMDICover->setIcon(icon); m_MDICoverList.append( pMDICover); QBoxLayout* pLayout = new QHBoxLayout( pMDICover, 0, -1, "layout"); pNewView->reparent( pMDICover, QPoint(0,0)); pLayout->addWidget( pNewView); pMDICover->setName( pNewView->name()); // captions QString shortName = pNewView->caption(); int length = shortName.length(); shortName = shortName.right(length - (shortName.findRev('/') +1)); pMDICover->setTabCaption( shortName); pMDICover->setCaption(pNewView->caption()); // fake a viewActivated to update the currentEditView/currentBrowserView pointers _before_ adding to MDI control slot_viewActivated( pMDICover); // take it under MDI mainframe control (note: this triggers also a setFocus()) int flags; if (bShow) { flags = KMdi::StandardAdd; } else { flags = KMdi::Hide; } // set the accelerators for Toplevel MDI mode (each toplevel window needs its own accels connect( m_pParent, SIGNAL(childViewIsDetachedNow(QWidget*)), this, SLOT(initKeyAccel(QWidget*)) ); m_pParent->addWindow( pMDICover, flags); // correct the default settings of KMdi ('cause we haven't a tab order for subwidget focuses) pMDICover->setFirstFocusableChildWidget(0L); pMDICover->setLastFocusableChildWidget(0L); }
Definition at line 108 of file kmdichildview.h.
Constructor & Destructor Documentation
KMdiChildView::KMdiChildView | ( | const QString & | caption, | |
QWidget * | parentWidget = 0L , |
|||
const char * | name = 0L , |
|||
WFlags | f = 0 | |||
) |
Constructor.
Definition at line 47 of file kmdichildview.cpp.
KMdiChildView::KMdiChildView | ( | QWidget * | parentWidget = 0L , |
|
const char * | name = 0L , |
|||
WFlags | f = 0 | |||
) |
Constructor sets "Unnamed" as default caption.
Definition at line 76 of file kmdichildview.cpp.
KMdiChildView::~KMdiChildView | ( | ) |
Destructor.
Definition at line 100 of file kmdichildview.cpp.
Member Function Documentation
void KMdiChildView::activate | ( | ) |
This method does the same as focusInEvent().
That's why it is a replacement for the setFocus() call. It makes sense if you for instance want to focus (I mean raise and activate) this view although the real focus is in another toplevel widget. focusInEvent() will never get called in that case and your setFocus() call for this widget would fail without any effect. Use this method with caution, it always raises the view and pushes the taskbar button. Also when the focus is still on another MDI view in the same toplevel window where this is located!
Definition at line 420 of file kmdichildview.cpp.
void KMdiChildView::activated | ( | KMdiChildView * | ) | [signal] |
Is sent when this MDI child was set to the activate view of all MDI views (after actually changing the focus).
void KMdiChildView::attach | ( | ) | [virtual, slot] |
Attaches this window to the Mdi manager.
It calls the KMdiMainFrm attachWindow function , so if you have a pointer to this KMdiMainFrm you'll be faster calling that function.
Definition at line 294 of file kmdichildview.cpp.
void KMdiChildView::attachWindow | ( | KMdiChildView * | , | |
bool | ||||
) | [signal] |
Internally used by KMdiChildView::attach to send it as command to the mainframe.
const QString& KMdiChildView::caption | ( | ) | const [inline] |
Returns the caption of the child window (different from the caption on the button in the taskbar).
Definition at line 232 of file kmdichildview.h.
void KMdiChildView::childWindowCloseRequest | ( | KMdiChildView * | ) | [signal] |
Internally used to send information to the mainframe that this MDI child view wants to be closed.
void KMdiChildView::clickedInDockMenu | ( | int | ) | [signal] |
Is automatically emitted when slot_clickedInDockMenu is called.
void KMdiChildView::clickedInWindowMenu | ( | int | ) | [signal] |
Is automatically emitted when slot_clickedInWindowMenu is called.
void KMdiChildView::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
Ignores the event and calls KMdiMainFrm::childWindowCloseRequest instead.
This is because the mainframe has control over the views. Therefore the MDI view has to request the mainframe for a close.
Reimplemented from QWidget.
Definition at line 387 of file kmdichildview.cpp.
void KMdiChildView::deactivated | ( | KMdiChildView * | ) | [signal] |
Is sent when this MDI child view was deactivated (after actually changing the focus).
void KMdiChildView::detach | ( | ) | [virtual, slot] |
Detaches this window from the Mdi manager.
It calls the KMdiMainFrm detachWindow function , so if you have a pointer to this KMdiMainFrm you'll be faster calling that function.
Definition at line 301 of file kmdichildview.cpp.
void KMdiChildView::detachWindow | ( | KMdiChildView * | , | |
bool | ||||
) | [signal] |
Internally used by KMdiChildView::detach to send it as command to the mainframe.
It only catches QEvent::KeyPress events there.
If a Qt::Key_Tab is pressed, the internal MDI focus handling is called. That means if the last focusable child widget of this is called, it will jump to the first focusable child widget of this. See KMdiChildView::setFirstFocusableChildWidget and KMdiChildView::lastFirstFocusableChildWidget
Definition at line 522 of file kmdichildview.cpp.
QRect KMdiChildView::externalGeometry | ( | ) | const |
Returns the frame geometry of this window or of the parent if there is any.
..
Definition at line 183 of file kmdichildview.cpp.
QWidget * KMdiChildView::focusedChildWidget | ( | ) |
Returns the current focused child widget of this widget.
Definition at line 662 of file kmdichildview.cpp.
void KMdiChildView::focusInEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
If attached, the childframe will be activated and the MDI taskbar button will be pressed.
Additionally, the memorized old focused child widget of this is focused again. Sends the focusInEventOccurs signal before changing the focus and the gotFocus signal after changing the focus.
Reimplemented from QWidget.
Definition at line 402 of file kmdichildview.cpp.
void KMdiChildView::focusInEventOccurs | ( | KMdiChildView * | ) | [signal] |
Is sent when this MDI child view is going to receive focus (before actually changing the focus).
Internally used to send information to the mainframe that this MDI child view is focused. See KMdiChildView::focusInEvent
void KMdiChildView::focusOutEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
Send the lostFocus signal.
Reimplemented from QWidget.
Definition at line 460 of file kmdichildview.cpp.
const QDateTime& KMdiChildView::getTimeStamp | ( | ) | const [inline] |
Recall a previously remembered time, i.e.
the value of m_time
Definition at line 368 of file kmdichildview.h.
void KMdiChildView::gotFocus | ( | KMdiChildView * | ) | [signal] |
Is sent when this MDI child has received the focus (after actually changing the focus).
void KMdiChildView::hide | ( | ) | [virtual, slot] |
Calls QWidget::hide() or it's parent widget hide() if attached.
Reimplemented from QWidget.
Definition at line 756 of file kmdichildview.cpp.
QRect KMdiChildView::internalGeometry | ( | ) | const |
Returns the geometry of this MDI child window as QWidget::geometry() does.
Definition at line 113 of file kmdichildview.cpp.
bool KMdiChildView::isAttached | ( | ) | const [inline] |
Returns true if the MDI view is a child window within the MDI mainframe widget or false if the MDI view is in toplevel mode.
Definition at line 227 of file kmdichildview.h.
void KMdiChildView::isAttachedNow | ( | ) | [signal] |
Signals this has been attached.
void KMdiChildView::isDetachedNow | ( | ) | [signal] |
Signals this has been detached.
bool KMdiChildView::isMaximized | ( | ) | const |
Tells if the window is minimized when attached to the Mdi manager, otherwise returns false.
Definition at line 318 of file kmdichildview.cpp.
void KMdiChildView::isMaximizedNow | ( | ) | [signal] |
Signals this has been maximized.
bool KMdiChildView::isMinimized | ( | ) | const |
Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating'.
Definition at line 308 of file kmdichildview.cpp.
void KMdiChildView::isMinimizedNow | ( | ) | [signal] |
Signals this has been minimized.
void KMdiChildView::isRestoredNow | ( | ) | [signal] |
Signals this has been restored (normalized).
bool KMdiChildView::isToolView | ( | ) | const [inline] |
Returns if this is added as MDI tool-view.
Definition at line 354 of file kmdichildview.h.
void KMdiChildView::lostFocus | ( | KMdiChildView * | ) | [signal] |
Is sent when this MDI child view has lost the focus (after actually changing the focus).
void KMdiChildView::maximize | ( | ) | [virtual, slot] |
Maximizes the MDI view.
If attached, this widget will fill the whole MDI view area widget. The system buttons move to the main menubar (if set by KMdiMainFrm::setMenuForSDIModeSysButtons ). If detached, it will use the minimize of the underlying system ( QWidget::showMaximized ).
Definition at line 269 of file kmdichildview.cpp.
void KMdiChildView::maximize | ( | bool | bAnimate | ) | [virtual] |
Maximizes this window when it is attached to the Mdi manager.
Otherwise has no effect
Definition at line 248 of file kmdichildview.cpp.
KMdiChildFrm * KMdiChildView::mdiParent | ( | ) | const [inline] |
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached).
Definition at line 604 of file kmdichildview.h.
void KMdiChildView::mdiParentNowMaximized | ( | bool | ) | [signal] |
Internally used to send information to the mainframe that this MDI view is maximized now.
Usually, the mainframe switches system buttons.
void KMdiChildView::minimize | ( | ) | [virtual, slot] |
Mimimizes the MDI view.
If attached, the covering childframe widget is minimized (only a mini widget showing the caption bar and the system buttons will remain visible). If detached, it will use the minimize of the underlying system ( QWidget::showMinimized ).
Definition at line 241 of file kmdichildview.cpp.
void KMdiChildView::minimize | ( | bool | bAnimate | ) | [virtual] |
Minimizes this window when it is attached to the Mdi manager.
Otherwise has no effect
Definition at line 221 of file kmdichildview.cpp.
QPixmap * KMdiChildView::myIconPtr | ( | ) | [virtual] |
You should override this function in the derived class.
Definition at line 395 of file kmdichildview.cpp.
void KMdiChildView::raise | ( | ) | [virtual, slot] |
Calls QWidget::raise() or it's parent widget raise() if attached.
Reimplemented from QWidget.
Definition at line 766 of file kmdichildview.cpp.
void KMdiChildView::removeEventFilterForAllChildren | ( | ) |
Switches interposing in event loop of all current child widgets off.
Definition at line 648 of file kmdichildview.cpp.
void KMdiChildView::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Internally used for the minimize/maximize/restore mechanism when in attach mode.
Reimplemented from QWidget.
Definition at line 468 of file kmdichildview.cpp.
void KMdiChildView::restore | ( | ) | [virtual, slot] |
Restores this window to its normal size.
Also known as 'normalize'.
Definition at line 328 of file kmdichildview.cpp.
QRect KMdiChildView::restoreGeometry | ( | ) |
Returns the geometry that will be restored by calling restore().
Definition at line 276 of file kmdichildview.cpp.
void KMdiChildView::setCaption | ( | const QString & | szCaption | ) | [virtual] |
Sets the window caption string.
.. Calls updateButton on the taskbar button if it has been set.
Reimplemented from QWidget.
Definition at line 373 of file kmdichildview.cpp.
void KMdiChildView::setExternalGeometry | ( | const QRect & | newGeomety | ) |
Sets the geometry of the frame of this MDI child window.
The top left position of the argument is the position of the top left point of the frame in its parent coordinates and the arguments width and height is the width and height of the widget frame. Please note: This differs from the behavior of QWidget::setGeometry()!
Definition at line 190 of file kmdichildview.cpp.
void KMdiChildView::setFirstFocusableChildWidget | ( | QWidget * | firstFocusableChildWidget | ) |
Memorizes the first focusable child widget of this widget.
Definition at line 667 of file kmdichildview.cpp.
void KMdiChildView::setInternalGeometry | ( | const QRect & | newGeomety | ) |
Sets the geometry of the client area of this MDI child window.
The top left position of the argument is the position of the top left point of the client area in its parent coordinates and the arguments width and height is the width and height of the client area. Please note: This differs from the behavior of QWidget::setGeometry()!
Definition at line 136 of file kmdichildview.cpp.
void KMdiChildView::setLastFocusableChildWidget | ( | QWidget * | lastFocusableChildWidget | ) |
Memorizes the last focusable child widget of this widget.
Definition at line 672 of file kmdichildview.cpp.
void KMdiChildView::setMaximumSize | ( | int | maxw, | |
int | maxh | |||
) | [virtual] |
Sets the maximum size of the widget to w by h pixels.
It extends it base clase method in a way that the maximum size of its childframe (if there is one) will be set, additionally.
Reimplemented from QWidget.
Definition at line 727 of file kmdichildview.cpp.
void KMdiChildView::setMDICaption | ( | const QString & | caption | ) | [virtual] |
Sets the caption of both the window and the button on the taskbar.
Definition at line 684 of file kmdichildview.cpp.
void KMdiChildView::setMinimumSize | ( | int | minw, | |
int | minh | |||
) | [virtual] |
Sets the minimum size of the widget to w by h pixels.
It extends it base clase method in a way that the minimum size of its childframe (if there is one) will be set, additionally.
Reimplemented from QWidget.
Definition at line 715 of file kmdichildview.cpp.
void KMdiChildView::setRestoreGeometry | ( | const QRect & | newRestGeo | ) |
Sets the geometry that will be restored by calling restore().
Definition at line 286 of file kmdichildview.cpp.
void KMdiChildView::setTabCaption | ( | const QString & | caption | ) | [virtual] |
Sets the caption of the button referring to this window.
Set a new value of the task bar button caption.
Definition at line 678 of file kmdichildview.cpp.
void KMdiChildView::setWindowMenuID | ( | int | id | ) |
Internally used for setting an ID for the 'Window' menu entry.
sets an ID
Definition at line 691 of file kmdichildview.cpp.
void KMdiChildView::show | ( | ) | [virtual, slot] |
Calls QWidget::show but also for it's parent widget if attached.
Reimplemented from QWidget.
Definition at line 746 of file kmdichildview.cpp.
void KMdiChildView::showMaximized | ( | ) | [virtual, slot] |
Overridden from its base class method.
Emits a signal KMdiChildView::isMaximizedNow , additionally. Note that this method is not used by an external windows manager call on system maximizing.
Reimplemented from QWidget.
Definition at line 262 of file kmdichildview.cpp.
void KMdiChildView::showMinimized | ( | ) | [virtual, slot] |
Overridden from its base class method.
Emits a signal KMdiChildView::isMinimizedNow , additionally. Note that this method is not used by an external windows manager call on system minimizing.
Reimplemented from QWidget.
Definition at line 234 of file kmdichildview.cpp.
void KMdiChildView::showNormal | ( | ) | [virtual, slot] |
Overridden from its base class method.
Emits a signal KMdiChildView::isRestoredNow , additionally. Note that this method is not used by an external windows manager call on system normalizing.
Reimplemented from QWidget.
Definition at line 342 of file kmdichildview.cpp.
void KMdiChildView::slot_clickedInDockMenu | ( | ) | [virtual, slot] |
Called if someone click on the "Dock/Undock..." menu item for this child frame window.
called if someone click on the "Dock/Undock..." menu item for this child frame window
Definition at line 708 of file kmdichildview.cpp.
void KMdiChildView::slot_clickedInWindowMenu | ( | ) | [virtual, slot] |
Called if someone click on the "Window" menu item for this child frame window.
called if someone click on the "Window" menu item for this child frame window
Definition at line 699 of file kmdichildview.cpp.
const QString& KMdiChildView::tabCaption | ( | ) | const [inline] |
Returns the caption of the button on the taskbar.
Definition at line 237 of file kmdichildview.h.
void KMdiChildView::tabCaptionChanged | ( | const QString & | ) | [signal] |
Emitted when the window caption is changed via KMdiChildView::setTabCaption or KMdiChildView::setMDICaption.
void KMdiChildView::updateTimeStamp | ( | ) | [inline] |
Remember the current time.
Definition at line 359 of file kmdichildview.h.
void KMdiChildView::windowCaptionChanged | ( | const QString & | ) | [signal] |
Emitted when the window caption is changed via KMdiChildView::setCaption or KMdiChildView::setMDICaption.
void KMdiChildView::youAreAttached | ( | KMdiChildFrm * | lpC | ) | [virtual, slot] |
Internally called, if KMdiMainFrm::attach is called.
Actually, only the caption of the covering childframe is set.
Definition at line 350 of file kmdichildview.cpp.
void KMdiChildView::youAreDetached | ( | ) | [virtual, slot] |
Internally called, if KMdiMainFrm::detach is called.
Some things for going toplevel will be done here.
Definition at line 358 of file kmdichildview.cpp.
Member Data Documentation
QWidget* KMdiChildView::m_firstFocusableChildWidget [protected] |
See KMdiChildView::setFirstFocusableChildWidget.
Definition at line 134 of file kmdichildview.h.
QWidget* KMdiChildView::m_focusedChildWidget [protected] |
See KMdiChildView::focusedChildWidget.
Definition at line 129 of file kmdichildview.h.
QWidget* KMdiChildView::m_lastFocusableChildWidget [protected] |
See KMdiChildView::setLastFocusableChildWidget.
Definition at line 139 of file kmdichildview.h.
QString KMdiChildView::m_sTabCaption [protected] |
See KMdiChildView::tabCaption.
Definition at line 124 of file kmdichildview.h.
bool KMdiChildView::m_stateChanged [protected] |
Holds a temporary information about if the MDI view state has changed but is not processed yet (pending state).
For example it could be that a 'maximize' is pending, if this variable is true.
Definition at line 150 of file kmdichildview.h.
QString KMdiChildView::m_szCaption [protected] |
Definition at line 119 of file kmdichildview.h.
QDateTime KMdiChildView::m_time [protected] |
Holds the time when this view was activated (not only displayed) for the last time.
Definition at line 155 of file kmdichildview.h.
int KMdiChildView::m_windowMenuID [protected] |
Every child view window has an temporary ID in the Window menu of the main frame.
Definition at line 144 of file kmdichildview.h.
The documentation for this class was generated from the following files: