Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
return false;
}
- QMouseEvent *e = (QMouseEvent*)ee;
+ QMouseEvent *e = static_cast<QMouseEvent*>(ee);
switch (e->type()) {
case QEvent::MouseButtonPress: {
if (w->isMaximized())
}
} break;
case QEvent::KeyPress:
- keyPressEvent((QKeyEvent*)e);
+ keyPressEvent(static_cast<QKeyEvent*>(ee));
break;
case QEvent::ShortcutOverride:
if (buttonDown) {
- ((QKeyEvent*)ee)->accept();
+ static_cast<QKeyEvent*>(ee)->accept();
return true;
}
break;
case Qt::Key_Space:
case Qt::Key_Return:
case Qt::Key_Enter:
- case Qt::Key_Escape:
+ case Qt::Key_Escape: {
moveResizeMode = false;
widget->releaseMouse();
widget->releaseKeyboard();
buttonDown = false;
break;
+ }
default:
return;
}
public:
enum Action {
- Move = 0x01,
- Resize = 0x02,
- Any = Move|Resize
+ Move = 0x01,
+ Resize = 0x02,
+ Any = Move | Resize
};
explicit QWidgetResizeHandler(QWidget *parent, QWidget *cw = 0);
int fw;
int extrahei;
int range;
- uint buttonDown :1;
- uint moveResizeMode :1;
- uint activeForResize :1;
- uint sizeprotect :1;
- uint movingEnabled :1;
- uint activeForMove :1;
+ bool buttonDown;
+ bool moveResizeMode;
+ bool activeForResize;
+ bool sizeprotect;
+ bool movingEnabled;
+ bool activeForMove;
void setMouseCursor(MousePosition m);
bool isMove() const {