I tried that code but doesn't works I have the dialog closed when enter pressed :
bool CColorPickerDialog
::event( QEvent* event
) {
if( event
->type
() == QEvent::KeyPress ) {
if( m_HexEdit->hasFocus() )
return true;
}
}
bool CColorPickerDialog::event( QEvent* event )
{
if( event->type() == QEvent::KeyPress )
{
if( m_HexEdit->hasFocus() )
return true;
}
return QDialog::event( event );
}
To copy to clipboard, switch view to plain text mode
That only works if I don't clear focus of the QLineEdit but I do :
void CColorPickerDialog::HexEditingFinished()
{
m_RadialColorPickerWidget
->SetColor
( QColor( QString( "#%1" ).
arg( m_HexEdit
->text
() ) ) );
m_HexEdit->clearFocus();
}
void CColorPickerDialog::HexEditingFinished()
{
m_RadialColorPickerWidget->SetColor( QColor( QString( "#%1" ).arg( m_HexEdit->text() ) ) );
m_HexEdit->clearFocus();
}
To copy to clipboard, switch view to plain text mode
Having the bypass of default button working and lost focus of widged when clicking on QDialog still a mystery.
The problem is since that closes the color picker widget I don't have any preview of the value I wrote on the hex line edit.
Bookmarks