Hi all,
I have a custom Line editor who act as SliderLineEdit (like a spinbox horizontal without button).
All works fine but on the double click event I change ReadOnly to false to allow to edit value by hand and here comes the problem.
The problem is the text cursor is not visible until I use an arrow key (left or right) or I put a value by key.
Here the code of the double click event :
void CDoubleSliderLineEdit
::mouseDoubleClickEvent( QMouseEvent* event
) {
// Check if we are in read-only mode.
if( isReadOnly() )
{
// Change states.
setReadOnly( false );
m_SliderMode = false;
// Restore override cursor.
}
else
{
// Base class.
}
}
void CDoubleSliderLineEdit::mouseDoubleClickEvent( QMouseEvent* event )
{
// Check if we are in read-only mode.
if( isReadOnly() )
{
// Change states.
setReadOnly( false );
m_SliderMode = false;
// Restore override cursor.
QApplication::restoreOverrideCursor();
}
else
{
// Base class.
QLineEdit::mouseDoubleClickEvent( event );
}
}
To copy to clipboard, switch view to plain text mode
I have to add m_SliderMode = false;, without it it's blocked like one mouse pressed but never released.
Thanks for the help
Bookmarks