All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Adds a size grip in the left/right bottom corner of a widget. More...
#include <SizeGrip.h>
Public Member Functions | |
| virtual bool | eventFilter (QObject *, QEvent *e) |
| bool | isEnabled () const |
| void | resizeEvent () |
| void | setEnabled (bool enabled) |
| SizeGrip (QWidget *parent) | |
| ~SizeGrip () | |
Adds a size grip in the left/right bottom corner of a widget.
| 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
}
| 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;}
| void QGpGuiTools::SizeGrip::resizeEvent | ( | ) |
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;
}
}