Re: mouseMoveEvent show/hide
What have you actually tried?
If you actually hide() the widget then it is not there to receive and process mouse events; so you you cannot use the mouse events of the widget itself to show() it. You could use the mouse events of the widget containing the disappearing widget to make it reappear.
Re: mouseMoveEvent show/hide
I thought it would be simple like this
Code:
{
if(ui->actions->rect().contains(mme->pos())){
ui->actions->setVisible(true);
}
else{
ui->actions->setVisible(false);
}
}
}
i am not using mouse event of widget with buttons but from parent widget. The first problem was one overlay floating widget and one stretch widget. solved with
Code:
Q_UNUSED(re);
ui->actions->move(width() - ui->actions->width() - 20, 20 );
ui->textEdit->resize(this->size());
}
in form constructor i have
Code:
ui->setupUi(this);
setMouseTracking(true);
ui->textEdit->move(0,0);
ui->actions->setVisible(false);
resizeEvent(NULL);
but, of course, there is QTextEdit that takes mouse events. It doesnt feel right to reimplement QTextEdit (it is not realy text editing function what am i reimplementing), but it takes away mouse events i intended from form.
So i thought that i just made a blunder, and that i am doing it wrong. Maybe someone here acomplished same thing.
Or, Is there a way for parent widget tho know the mouse position if the mouse is over the widget itself and/or its children widgets?