#include <msgedit.h>
Inheritance diagram for PageCurl:


Definition at line 123 of file msgedit.h.
Signals | |
| void | prevPage () |
| void | nextPage () |
Public Member Functions | |
| PageCurl (QWidget *parent=0) | |
Protected Member Functions | |
| bool | event (QEvent *e) |
| void | mouseReleaseEvent (QMouseEvent *e) |
| PageCurl::PageCurl | ( | QWidget * | parent = 0 |
) | [inline] |
Definition at line 127 of file msgedit.h.
References QWidget::backgroundRole(), QPixmap::hasAlphaChannel(), QPixmap::mask(), TrWindow::pageCurl(), QWidget::palette(), QPalette::setBrush(), QWidget::setFixedSize(), QWidget::setMask(), QWidget::setPalette(), and QPixmap::size().
00128 : QWidget(parent) 00129 { 00130 QPixmap px = TrWindow::pageCurl(); 00131 if ( px.hasAlphaChannel() ) { 00132 setMask( px.mask() ); 00133 } 00134 QPalette pal = palette(); 00135 pal.setBrush(backgroundRole(), px); 00136 setPalette(pal); 00137 setFixedSize( px.size() ); 00138 }
Here is the call graph for this function:

| bool PageCurl::event | ( | QEvent * | e | ) | [inline, protected, virtual] |
This is the main event handler; it handles event event. You can reimplement this function in a subclass, but we recommend using one of the specialized event handlers instead.
Key press and release events are treated differently from other events. event() checks for Tab and Shift+Tab and tries to move the focus appropriately. If there is no widget to move the focus to (or the key press is not Tab or Shift+Tab), event() calls keyPressEvent().
Mouse and tablet event handling is also slightly special: only when the widget is enabled, event() will call the specialized handlers such as mousePressEvent(); otherwise it will discard the event.
This function returns true if the event was recognized, otherwise it returns false. If the recognized event was accepted (see QEvent::accepted), any further processing such as event propagation to the parent widget stops.
Reimplemented from QWidget.
Definition at line 141 of file msgedit.h.
References QWidget::event(), QWidget::height(), QString::isEmpty(), QWidget::pos(), QToolTip::showText(), QEvent::ToolTip, QWidget::toolTip(), QEvent::type(), and QWidget::width().
00142 { 00143 if (e->type() == QEvent::ToolTip && toolTip().isEmpty()) { 00144 QRect r(34, 0, width()-34, 19); 00145 00146 QPoint pt = static_cast<QHelpEvent*>(e)->pos(); 00147 00148 if (r.contains(pt)) { 00149 QToolTip::showText(static_cast<QHelpEvent*>(e)->globalPos(), 00150 tr("Next unfinished phrase"), this); 00151 } 00152 00153 r.setSize(QSize(width()-34, height()-20)); 00154 r.setX(0); 00155 r.setY(20); 00156 00157 if (r.contains(pt)) { 00158 QToolTip::showText(static_cast<QHelpEvent*>(e)->globalPos(), 00159 tr("Previous unfinished phrase"), this); 00160 } 00161 } 00162 00163 return QWidget::event(e); 00164 }
Here is the call graph for this function:

| void PageCurl::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [inline, protected, virtual] |
This event handler, for event event, can be reimplemented in a subclass to receive mouse release events for the widget.
Reimplemented from QWidget.
Definition at line 165 of file msgedit.h.
References emit, nextPage(), QMouseEvent::pos(), prevPage(), QPoint::x(), QWidget::x(), QPoint::y(), and QWidget::y().
00166 { 00167 int x = e->pos().x()-10; 00168 int y = e->pos().y(); 00169 00170 if (y < x) 00171 emit nextPage(); 00172 else 00173 emit prevPage(); 00174 }
Here is the call graph for this function:

| void PageCurl::prevPage | ( | ) | [signal] |
Referenced by mouseReleaseEvent().
| void PageCurl::nextPage | ( | ) | [signal] |
Referenced by mouseReleaseEvent().
1.5.1