Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ZScrollView Class Reference

ZScrollView is similar to QScrollView, but has a few additional behaviors:. More...

#include <ZScrollView.h>

Inheritance diagram for ZScrollView::

QScrollView List of all members.

Public Slots

virtual void show ()
 Reimplement. More...

virtual void hide ()
 Reimplement. More...

virtual void doLayout (QWidget *widget, QSize size, QPoint cursorPos, int enlarge)
 Layout the children in the ZScrollView. More...

void enableClipper (bool clipper)
 ZScrollView's enableClipper. More...


Signals

void vScrollBarStateChanged (int show)
 Emitted when the vertical scrollbar of the ZScrollView is shown/hidden. More...


Public Methods

 ZScrollView (QWidget *parent=0, const char *name=0, WFlags f=0)
 Constructor of ZScrollView. More...

virtual ~ZScrollView ()
 Destructor of ZScrollView. More...

virtual void addChild (QWidget *child, int x=0, int y=0)
 Reimplement. More...

virtual void addChild (QWidget *child, int x, int y, bool autoAdjustWidth)
 ZScrollView's addChild. More...

virtual void moveChild (QWidget *child, int x, int y, bool autoAdjustWidth=false)
 ZScrollView's moveChild. More...

void updateContentSize ()
 Update Content Size correctly by the all children's frame geometry. More...

void setFlushEvents (bool flush=true)
 Set a flag for flush events in doLayout(), it is to call sendPostedEvents() which reduces screen flash. More...

bool getFlushEvents () const
 Get the flush event flag. More...

void setAutoLayout (bool doLayout=true)
 Set the flag to do layout automatically, usually doing layout is caused by the ZMultiLineEdit's text change. More...

bool getAutoLayout () const
 Get the DoLayout flag. More...


Protected Methods

virtual bool eventFilter (QObject *obj, QEvent *event)
 Reimplement. More...

virtual bool event (QEvent *event)
 Reimplement. More...

virtual void keyPressEvent (QKeyEvent *event)
 Reimplement. More...


Detailed Description

ZScrollView is similar to QScrollView, but has a few additional behaviors:.

1. Adjusts the children's geometry automatically when the size of ZMultiLineEdit child is changed because of text set.

2. Changes the geometry of the text-entry area when the keyboard is shown/ hidden.

 ZScrollView* sv = new ZScrollView( this, "sv" );
 sv->enableClipper(true);
 UTIL_MulitLineEdit *ml1, *ml2;

 //add a 6 lines ZMultiLineEdit
 ml1 = new ZMultiLineEdit(sv->viewport(),true,6);
 sv->addChild(ml1,0,0);

 //set indent
 ml1->setIndent(20);
 ml2 = new ZMultiLineEdit(sv->viewport());
 
 //need to change the widget width when ZScrollView's scrollbar is shown/hidden
 sv->addChild(ml2,0,30,true);

See also:
ZMultiLineEdit

Note:
for the class, has change the scrollview's resize policy to Manual setResizePolicy(Manual), and turn off the horizon scroll bar setHScrollBarMode(QScrollView::AlwaysOff).


Constructor & Destructor Documentation

ZScrollView::ZScrollView ( QWidget * parent = 0,
const char * name = 0,
WFlags f = 0 )
 

Constructor of ZScrollView.

ZScrollView::~ZScrollView ( ) [virtual]
 

Destructor of ZScrollView.


Member Function Documentation

void ZScrollView::addChild ( QWidget * child,
int x,
int y,
bool autoAdjustWidth ) [virtual]
 

ZScrollView's addChild.

Parameters:
autoAdjustWidth   if true when vertical scrollbar appears/disappear, the widget's width will be adjusted, it is width() -(+) verticalScrollBar->width()

void ZScrollView::addChild ( QWidget * child,
int x = 0,
int y = 0 ) [virtual]
 

Reimplement.

void ZScrollView::doLayout ( QWidget * widget,
QSize size,
QPoint cursorPos,
int enlarge ) [virtual, slot]
 

Layout the children in the ZScrollView.

Parameters:
widget   the widget whose geometry changed.
size   the size(height and width) changed. Now only supports height
cursorPos   the cursor's position.
enlarge   if true the size of widget is enlarged

void ZScrollView::enableClipper ( bool clipper ) [slot]
 

ZScrollView's enableClipper.

bool ZScrollView::event ( QEvent * event ) [protected, virtual]
 

Reimplement.

bool ZScrollView::eventFilter ( QObject * obj,
QEvent * event ) [protected, virtual]
 

Reimplement.

bool ZScrollView::getAutoLayout ( ) const
 

Get the DoLayout flag.

See also:
setDoLayout()

bool ZScrollView::getFlushEvents ( ) const
 

Get the flush event flag.

See also:
setFlushEvents()

void ZScrollView::hide ( ) [virtual, slot]
 

Reimplement.

void ZScrollView::keyPressEvent ( QKeyEvent * event ) [protected, virtual]
 

Reimplement.

void ZScrollView::moveChild ( QWidget * child,
int x,
int y,
bool autoAdjustWidth = false ) [virtual]
 

ZScrollView's moveChild.

Parameters:
autoAdjustWidth   if true when vertical scrollbar appears/disappear, the widget's width will be adjusted, it is width() -(+) verticalScrollBar->width()

void ZScrollView::setAutoLayout ( bool doLayout = true )
 

Set the flag to do layout automatically, usually doing layout is caused by the ZMultiLineEdit's text change.

Parameters:
doLayout   if true, do layout automatically, or need to do layout by yourself The default is to do layout automatically.

See also:
doLayout()

void ZScrollView::setFlushEvents ( bool flush = true )
 

Set a flag for flush events in doLayout(), it is to call sendPostedEvents() which reduces screen flash.

By default, the flag is on.

If the application needs to assure the sequence of the events during the period, please turn off the flag.

Parameters:
flush   if true need to flush the events during doLayout

See also:
doLayout()

void ZScrollView::show ( ) [virtual, slot]
 

Reimplement.

void ZScrollView::updateContentSize ( )
 

Update Content Size correctly by the all children's frame geometry.

void ZScrollView::vScrollBarStateChanged ( int show ) [signal]
 

Emitted when the vertical scrollbar of the ZScrollView is shown/hidden.

Parameters:
show   if true, the vertical scrollbar is shown


The documentation for this class was generated from the following file:
Generated at Wed Mar 3 13:23:10 2004 by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001