Commit 4ba5682d authored by Kurt Hindenburg's avatar Kurt Hindenburg

Use qobject_cast instead static_cast; use static_cast instead c casts

parent 5bc0b561
......@@ -3458,7 +3458,7 @@ bool AutoScrollHandler::eventFilter(QObject* watched, QEvent* event)
switch (event->type()) {
case QEvent::MouseMove: {
QMouseEvent* mouseEvent = (QMouseEvent*)event;
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
bool mouseInWidget = widget()->rect().contains(mouseEvent->pos());
if (mouseInWidget) {
if (_timerId)
......@@ -3473,7 +3473,7 @@ bool AutoScrollHandler::eventFilter(QObject* watched, QEvent* event)
break;
}
case QEvent::MouseButtonRelease: {
QMouseEvent* mouseEvent = (QMouseEvent*)event;
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
if (_timerId && (mouseEvent->buttons() & ~Qt::LeftButton)) {
killTimer(_timerId);
_timerId = 0;
......
......@@ -177,5 +177,5 @@ QString TerminalDisplayAccessible::text(int startOffset, int endOffset) const
TerminalDisplay* TerminalDisplayAccessible::display() const
{
return static_cast<TerminalDisplay*>(widget());
return qobject_cast<TerminalDisplay*>(widget());
}
......@@ -151,7 +151,7 @@ void ViewContainer::addView(QWidget* view , ViewProperties* item, int index)
}
void ViewContainer::viewDestroyed(QObject* object)
{
QWidget* widget = static_cast<QWidget*>(object);
QWidget* widget = qobject_cast<QWidget*>(object);
forgetView(widget);
}
......
......@@ -136,7 +136,7 @@ void ViewContainerTabBar::dropEvent(QDropEvent* event)
const int index = dropIndex(event->pos());
bool success = false;
ViewContainerTabBar* sourceContainerTabBar = static_cast<ViewContainerTabBar*>(event->source());
ViewContainerTabBar* sourceContainerTabBar = qobject_cast<ViewContainerTabBar*>(event->source());
// check if the moved tab is the last of source view.
if (sourceContainerTabBar->count() == 1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment