Remove unused code into GUI

This commit is contained in:
andrea
2022-07-11 15:10:25 +02:00
committed by Uwe
parent 86f9b4ec1f
commit 7886d3cbf4
47 changed files with 14 additions and 1592 deletions

View File

@@ -214,53 +214,13 @@ void DlgExpressionInput::setExpressionInputSize(int width, int height)
void DlgExpressionInput::mouseReleaseEvent(QMouseEvent* ev)
{
#if 0//defined(Q_OS_WIN)
if (QWidget::mouseGrabber() == this) {
QList<QWidget*> childs = this->findChildren<QWidget*>();
for (QList<QWidget*>::iterator it = childs.begin(); it != childs.end(); ++it) {
QPoint pos = (*it)->mapFromGlobal(ev->globalPos());
if ((*it)->rect().contains(pos)) {
// Create new mouse event with the correct local position
QMouseEvent me(ev->type(), pos, ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
QObject* obj = *it;
obj->event(&me);
if (me.isAccepted()) {
break;
}
}
}
}
#else
Q_UNUSED(ev);
#endif
}
void DlgExpressionInput::mousePressEvent(QMouseEvent* ev)
{
#if 0//defined(Q_OS_WIN)
bool handled = false;
if (QWidget::mouseGrabber() == this) {
QList<QWidget*> childs = this->findChildren<QWidget*>();
for (QList<QWidget*>::iterator it = childs.begin(); it != childs.end(); ++it) {
QPoint pos = (*it)->mapFromGlobal(ev->globalPos());
if ((*it)->rect().contains(pos)) {
// Create new mouse event with the correct local position
QMouseEvent me(ev->type(), pos, ev->globalPos(), ev->button(), ev->buttons(), ev->modifiers());
QObject* obj = *it;
obj->event(&me);
if (me.isAccepted()) {
handled = true;
break;
}
}
}
}
if (handled)
return;
#else
Q_UNUSED(ev);
#endif
// The 'FramelessWindowHint' is also set when the background is transparent.
if (windowFlags() & Qt::FramelessWindowHint) {
//we need to reject the dialog when clicked on the background. As the background is transparent
@@ -281,17 +241,6 @@ void DlgExpressionInput::show()
void DlgExpressionInput::showEvent(QShowEvent* ev)
{
QDialog::showEvent(ev);
#if 0//defined(Q_OS_WIN)
// This way we can fetch click events outside modal dialogs
QWidget* widget = QApplication::activeModalWidget();
if (widget) {
QList<QWidget*> childs = widget->findChildren<QWidget*>();
if (childs.contains(this)) {
this->grabMouse();
}
}
#endif
}
bool DlgExpressionInput::eventFilter(QObject *obj, QEvent *ev)
@@ -315,7 +264,6 @@ bool DlgExpressionInput::eventFilter(QObject *obj, QEvent *ev)
}
}
}
return false;
}