class MyTestView

The MyTestView class provides the view widget for the document instance connected to it and is displayed as a MDI child window in the main view area of the MyTestApp class instance. More...

Definition#include <mytestview.h>
InheritsQWidget (unknown) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members

Private Members


Detailed Description

The MyTestView class provides the view widget for the document instance connected to it and is displayed as a MDI child window in the main view area of the MyTestApp class instance. The MyTestApp class also has an eventFilter() method that gets installed on every MyTestView instance to control events of the type QEvent::Close. The document connected to the view instance keeps a list of all view that represent the document contents as there can be more than one view. Views get created in MyTestApp::createClient() and automatically added to the list of views. The MyTestView class inherits QWidget as a base. Another possible inheritance besides specialized widgets could be QMainWindow so that you can easily set up the main area of your view by setting another view as main widget (QMainWindow::setMainWidget() ). NOTE: The close event always has to be empty (DON`T CALL QWidget::closeEvent(e) in closeEvent()) because the installed event filter can only manage a forward implementation. If the QCloseEvent is received by the MyTestView, the overwritten event handler has to do nothing as the eventFilter has set accept() or ignore() already. If QWidget::closeEvent() is called again, the default event handler will accept the close event and the window gets destroyed even if the installed eventFilter has set the event to be ignored.

friend MyTestDoc

MyTestDoc

[private]

 MyTestView (MyTestDoc* pDoc, QWidget* parent, const char *name, int wflags)

MyTestView

Constructor for the view

Parameters:
pDocyour document instance that the view represents. Create a document before calling the constructor or connect an already existing document to a new MDI child widget.

 ~MyTestView ()

~MyTestView

MyTestDocgetDocument ()

getDocument

[const]

void  update (MyTestView* pSender)

update

void  print (QPrinter *pPrinter)

print

void  closeEvent (QCloseEvent* e)

closeEvent

[protected virtual]

overwritten QWidget::closeEvent() to catch closing views. Does nothing, as the closeEvents for MyTestView's are processed by MyTestApp::eventFilter(), so this overwitten closeEvent is necessary and has to be empty. Don't overwrite this method !

MyTestDoc * doc

doc

[protected]