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

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
|
Constructor.
Definition at line 47 of file kmdichildview.cpp. References m_sTabCaption, m_szCaption, and updateTimeStamp(). |
|
Constructor sets "Unnamed" as default caption.
Definition at line 76 of file kmdichildview.cpp. References m_sTabCaption, m_szCaption, and updateTimeStamp(). |
|
Destructor.
Definition at line 99 of file kmdichildview.cpp. |
Member Function Documentation
|
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 419 of file kmdichildview.cpp. References activated(), focusInEventOccurs(), m_firstFocusableChildWidget, and m_focusedChildWidget. Referenced by KMdiMainFrm::activateView(), KMdiMainFrm::closeWindow(), eventFilter(), KMdiChildFrm::eventFilter(), focusInEvent(), KMdiChildArea::focusTopChild(), KMdiMainFrm::removeWindowFromMdi(), KMdiChildArea::tileAllInternal(), and KMdiChildArea::tileAnodine(). |
|
Memorizes the first focusable child widget of this widget.
Definition at line 666 of file kmdichildview.cpp. References m_firstFocusableChildWidget. |
|
Memorizes the last focusable child widget of this widget.
Definition at line 671 of file kmdichildview.cpp. References m_lastFocusableChildWidget. |
|
Returns the current focused child widget of this widget.
Definition at line 661 of file kmdichildview.cpp. References m_focusedChildWidget. |
|
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. Referenced by KMdiMainFrm::detachWindow(), KMdiMainFrm::dockMenuItemActivated(), KMdiMainFrm::eventFilter(), eventFilter(), KMdiMainFrm::fillWindowMenu(), KMdiMainFrm::setFrameDecorOfAttachedViews(), KMdiMainFrm::switchToChildframeMode(), and KMdiMainFrm::windowMenuItemActivated(). |
|
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. Referenced by eventFilter(), KMdiMainFrm::fillWindowMenu(), and KMdiTaskBarButton::KMdiTaskBarButton(). |
|
Returns the caption of the button on the taskbar.
Definition at line 237 of file kmdichildview.h. Referenced by KMdiTaskBar::addWinButton(). |
|
Sets the window caption string. .. Calls updateButton on the taskbar button if it has been set. Definition at line 372 of file kmdichildview.cpp. References m_szCaption, mdiParent(), and windowCaptionChanged(). Referenced by KMdiMainFrm::createWrapper(), KMdiMainFrm::detachWindow(), setMDICaption(), and youAreDetached(). |
|
Sets the caption of the button referring to this window.
Definition at line 677 of file kmdichildview.cpp. References m_sTabCaption, and tabCaptionChanged(). Referenced by KMdiMainFrm::createWrapper(), setMDICaption(), and youAreDetached(). |
|
Sets the caption of both the window and the button on the taskbar.
Definition at line 683 of file kmdichildview.cpp. References setCaption(), and setTabCaption(). |
|
Returns the KMdiChildFrm parent widget (or 0 if the window is not attached).
Definition at line 604 of file kmdichildview.h. Referenced by KMdiMainFrm::detachWindow(), externalGeometry(), hide(), internalGeometry(), isMaximized(), isMinimized(), maximize(), minimize(), raise(), restore(), restoreGeometry(), setCaption(), setExternalGeometry(), KMdiMainFrm::setFrameDecorOfAttachedViews(), setInternalGeometry(), setMaximumSize(), setMinimumSize(), setRestoreGeometry(), and show(). |
|
Tells if the window is minimized when attached to the Mdi manager, or if it is VISIBLE when 'floating'.
Definition at line 307 of file kmdichildview.cpp. References mdiParent(). Referenced by KMdiMainFrm::dockMenuItemActivated(), KMdiMainFrm::fillWindowMenu(), minimize(), resizeEvent(), restore(), and KMdiMainFrm::windowMenuItemActivated(). |
|
Tells if the window is minimized when attached to the Mdi manager, otherwise returns false.
Definition at line 317 of file kmdichildview.cpp. References mdiParent(). Referenced by maximize(), resizeEvent(), restore(), and KMdiChildFrm::setState(). |
|
Returns the geometry of this MDI child window as QWidget::geometry() does.
Definition at line 112 of file kmdichildview.cpp. References externalGeometry(), and mdiParent(). Referenced by setExternalGeometry(), and setInternalGeometry(). |
|
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 135 of file kmdichildview.cpp. References externalGeometry(), internalGeometry(), and mdiParent(). |
|
Returns the frame geometry of this window or of the parent if there is any. .. Definition at line 182 of file kmdichildview.cpp. References mdiParent(). Referenced by internalGeometry(), setExternalGeometry(), and setInternalGeometry(). |
|
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 189 of file kmdichildview.cpp. References externalGeometry(), internalGeometry(), and mdiParent(). |
|
You should override this function in the derived class.
Definition at line 394 of file kmdichildview.cpp. Referenced by youAreDetached(). |
|
Minimizes this window when it is attached to the Mdi manager. Otherwise has no effect Definition at line 220 of file kmdichildview.cpp. References isMinimized(), mdiParent(), and showMinimized(). Referenced by KMdiMainFrm::dockMenuItemActivated(), and KMdiMainFrm::windowMenuItemActivated(). |
|
Maximizes this window when it is attached to the Mdi manager. Otherwise has no effect Definition at line 247 of file kmdichildview.cpp. References isMaximized(), mdiParent(), mdiParentNowMaximized(), and showMaximized(). |
|
Returns the geometry that will be restored by calling restore().
Definition at line 275 of file kmdichildview.cpp. References mdiParent(). |
|
Sets the geometry that will be restored by calling restore().
Definition at line 285 of file kmdichildview.cpp. References mdiParent(). |
|
Switches interposing in event loop of all current child widgets off.
Definition at line 647 of file kmdichildview.cpp. |
|
Internally used for setting an ID for the 'Window' menu entry.
Definition at line 690 of file kmdichildview.cpp. References m_windowMenuID. Referenced by KMdiMainFrm::fillWindowMenu(). |
|
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. Definition at line 714 of file kmdichildview.cpp. References mdiParent(). Referenced by KMdiChildFrm::setClient(), and KMdiChildFrm::setState(). |
|
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. Definition at line 726 of file kmdichildview.cpp. References mdiParent(). Referenced by KMdiChildFrm::setClient(), and KMdiChildFrm::setState(). |
|
Returns if this is added as MDI tool-view.
Definition at line 354 of file kmdichildview.h. Referenced by KMdiMainFrm::fillWindowMenu(), KMdiMainFrm::setFrameDecorOfAttachedViews(), and KMdiMainFrm::switchToChildframeMode(). |
|
Remember the current time.
Definition at line 359 of file kmdichildview.h. Referenced by KMdiChildFrm::eventFilter(), KMdiChildView(), and slot_clickedInWindowMenu(). |
|
Recall a previously remembered time, i.e. the value of m_time Definition at line 368 of file kmdichildview.h. Referenced by KMdiMainFrm::fillWindowMenu(). |
|
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 293 of file kmdichildview.cpp. References attachWindow(). |
|
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 300 of file kmdichildview.cpp. References detachWindow(). Referenced by KMdiChildFrm::undockPressed(). |
|
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 240 of file kmdichildview.cpp. |
|
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 268 of file kmdichildview.cpp. |
|
Restores this window to its normal size. Also known as 'normalize'. Definition at line 327 of file kmdichildview.cpp. References isMaximized(), isMinimized(), mdiParent(), mdiParentNowMaximized(), and showNormal(). Referenced by KMdiMainFrm::setEnableMaximizedChildFrmMode(). |
|
Internally called, if KMdiMainFrm::attach is called. Actually, only the caption of the covering childframe is set. Definition at line 349 of file kmdichildview.cpp. References isAttachedNow(), m_szCaption, and KMdiChildFrm::setCaption(). |
|
Internally called, if KMdiMainFrm::detach is called. Some things for going toplevel will be done here. Definition at line 357 of file kmdichildview.cpp. References isDetachedNow(), m_sTabCaption, m_szCaption, myIconPtr(), setCaption(), and setTabCaption(). Referenced by KMdiMainFrm::detachWindow(). |
|
Called if someone click on the "Window" menu item for this child frame window.
Definition at line 698 of file kmdichildview.cpp. References clickedInWindowMenu(), m_windowMenuID, and updateTimeStamp(). |
|
Called if someone click on the "Dock/Undock. .." menu item for this child frame window Definition at line 707 of file kmdichildview.cpp. References clickedInDockMenu(), and m_windowMenuID. |
|
Calls QWidget::show but also for it's parent widget if attached.
Definition at line 745 of file kmdichildview.cpp. References mdiParent(). Referenced by KMdiMainFrm::switchToChildframeMode(). |
|
Calls QWidget::hide() or it's parent widget hide() if attached.
Definition at line 755 of file kmdichildview.cpp. References mdiParent(). |
|
Calls QWidget::raise() or it's parent widget raise() if attached.
Definition at line 765 of file kmdichildview.cpp. References mdiParent(). |
|
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. Definition at line 233 of file kmdichildview.cpp. References isMinimizedNow(). Referenced by minimize(). |
|
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. Definition at line 261 of file kmdichildview.cpp. References isMaximizedNow(). Referenced by maximize(). |
|
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. Definition at line 341 of file kmdichildview.cpp. References isRestoredNow(). Referenced by restore(). |
|
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. Definition at line 386 of file kmdichildview.cpp. References childWindowCloseRequest(). |
|
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 521 of file kmdichildview.cpp. References activate(), caption(), isAttached(), m_firstFocusableChildWidget, m_focusedChildWidget, and m_lastFocusableChildWidget. |
|
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. Definition at line 401 of file kmdichildview.cpp. References activate(), and gotFocus(). |
|
Send the lostFocus signal.
Definition at line 459 of file kmdichildview.cpp. References lostFocus(). |
|
Internally used for the minimize/maximize/restore mechanism when in attach mode.
Definition at line 467 of file kmdichildview.cpp. References isMaximized(), isMaximizedNow(), isMinimized(), isMinimizedNow(), isRestoredNow(), and m_stateChanged. |
|
Internally used by KMdiChildView::attach to send it as command to the mainframe.
Referenced by attach(). |
|
Internally used by KMdiChildView::detach to send it as command to the mainframe.
Referenced by detach(). |
|
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 Referenced by activate(). |
|
Is sent when this MDI child has received the focus (after actually changing the focus). See KMdiChildView::focusInEvent Referenced by focusInEvent(). |
|
Is sent when this MDI child was set to the activate view of all MDI views (after actually changing the focus). Referenced by activate(). |
|
Is sent when this MDI child view has lost the focus (after actually changing the focus). See KMdiChildView::focusOutEvent Referenced by focusOutEvent(). |
|
Is sent when this MDI child view was deactivated (after actually changing the focus). |
|
Internally used to send information to the mainframe that this MDI child view wants to be closed. See KMdiChildView::closeEvent and KMdiMainFrm::closeWindow Referenced by closeEvent(). |
|
Emitted when the window caption is changed via KMdiChildView::setCaption or KMdiChildView::setMDICaption.
Referenced by setCaption(). |
|
Emitted when the window caption is changed via KMdiChildView::setTabCaption or KMdiChildView::setMDICaption.
Referenced by setTabCaption(). |
|
Internally used to send information to the mainframe that this MDI view is maximized now. Usually, the mainframe switches system buttons. Referenced by maximize(), and restore(). |
|
Is automatically emitted when slot_clickedInWindowMenu is called.
Referenced by slot_clickedInWindowMenu(). |
|
Is automatically emitted when slot_clickedInDockMenu is called.
Referenced by slot_clickedInDockMenu(). |
|
Signals this has been maximized.
Referenced by resizeEvent(), and showMaximized(). |
|
Signals this has been minimized.
Referenced by resizeEvent(), and showMinimized(). |
|
Signals this has been restored (normalized).
Referenced by resizeEvent(), and showNormal(). |
|
Signals this has been attached.
Referenced by youAreAttached(). |
|
Signals this has been detached.
Referenced by youAreDetached(). |
Member Data Documentation
|
Definition at line 119 of file kmdichildview.h. Referenced by KMdiChildView(), setCaption(), youAreAttached(), and youAreDetached(). |
|
See KMdiChildView::tabCaption.
Definition at line 124 of file kmdichildview.h. Referenced by KMdiChildView(), setTabCaption(), and youAreDetached(). |
|
See KMdiChildView::focusedChildWidget.
Definition at line 129 of file kmdichildview.h. Referenced by activate(), eventFilter(), and focusedChildWidget(). |
|
See KMdiChildView::setFirstFocusableChildWidget.
Definition at line 134 of file kmdichildview.h. Referenced by activate(), eventFilter(), and setFirstFocusableChildWidget(). |
|
See KMdiChildView::setLastFocusableChildWidget.
Definition at line 139 of file kmdichildview.h. Referenced by eventFilter(), and setLastFocusableChildWidget(). |
|
Every child view window has an temporary ID in the Window menu of the main frame.
Definition at line 144 of file kmdichildview.h. Referenced by setWindowMenuID(), slot_clickedInDockMenu(), and slot_clickedInWindowMenu(). |
|
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. Referenced by resizeEvent(), and KMdiChildFrm::setState(). |
|
Holds the time when this view was activated (not only displayed) for the last time.
Definition at line 155 of file kmdichildview.h. |
The documentation for this class was generated from the following files: