All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
QGpGuiTools::SizeGrip Class Reference

Adds a size grip in the left/right bottom corner of a widget. More...

#include <SizeGrip.h>

List of all members.

Public Member Functions

virtual bool eventFilter (QObject *, QEvent *e)
bool isEnabled () const
void resizeEvent ()
void setEnabled (bool enabled)
 SizeGrip (QWidget *parent)
 ~SizeGrip ()

Detailed Description

Adds a size grip in the left/right bottom corner of a widget.


Constructor & Destructor Documentation

QGpGuiTools::SizeGrip::SizeGrip ( QWidget *  parent)

Description of constructor still missing

References setEnabled(), and TRACE.

    : QObject(parent)
  {
    TRACE;
    parent->installEventFilter(this);
    _grip=0;
    setEnabled(true); // Enabled by default
  }

Description of destructor still missing

References TRACE.

  {
    TRACE;
    delete _grip;
  }

Member Function Documentation

bool QGpGuiTools::SizeGrip::eventFilter ( QObject *  ,
QEvent *  e 
) [virtual]

References resizeEvent(), and TRACE.

  {
    TRACE;
    if(e->type()==QEvent::Resize) {
      resizeEvent();
    }
    return false;
  }
bool QGpGuiTools::SizeGrip::isEnabled ( ) const [inline]
{return _grip;}

Call this function in resizeEvent(QResizeEvent *) from parent widget.

References TRACE.

Referenced by eventFilter(), and setEnabled().

  {
    TRACE;
    if(_grip) {
      if(QApplication::isRightToLeft()) {
        _grip->move(static_cast<QWidget *>(parent())->rect().bottomLeft()-_grip->rect().bottomLeft());
      } else {
        _grip->move(static_cast<QWidget *>(parent())->rect().bottomRight()-_grip->rect().bottomRight());
      }
      _grip->raise();
    }
  }
void QGpGuiTools::SizeGrip::setEnabled ( bool  enabled)

References resizeEvent(), and TRACE.

Referenced by SizeGrip().

  {
    TRACE;
    if(enabled) {
      if(!_grip) {
        _grip=new QSizeGrip(static_cast<QWidget *>(parent()));
        _grip->resize(_grip->sizeHint());
        resizeEvent();
      }
    } else {
      delete _grip;
      _grip=0;
    }
  }

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines