Hi all,
I have a class inherited from QDockWidget to set a custom titlebar in the constructor (to avoid to set each time).
All works good but when I have the QMainWindow loading I have flickering each time a dock is added.
If I use just a QDockWidget, not my custom class with titlebar, I don't see the flickering at all.
Here the code of the custom dock widget, CTitlebarWidget uses parent() to access the dock.
CDockWidget
::CDockWidget( const QString
& Title,
QWidget* Parent
) :{
m_Titlebar = new CTitlebarWidget( this );
setTitleBarWidget( m_Titlebar );
}
bool CDockWidget
::event( QEvent* event
) {
switch( event->type() )
{
case QEvent::WindowTitleChange : {
m_Titlebar->SetTitle( windowTitle() );
return true;
}
case QEvent::NonClientAreaMouseButtonDblClick : {
if( isMaximized() )
showNormal();
else
showMaximized();
return true;
}
}
}
CDockWidget::CDockWidget( const QString& Title, QWidget* Parent ) :
QDockWidget( Title, Parent )
{
m_Titlebar = new CTitlebarWidget( this );
setTitleBarWidget( m_Titlebar );
}
bool CDockWidget::event( QEvent* event )
{
switch( event->type() )
{
case QEvent::WindowTitleChange :
{
m_Titlebar->SetTitle( windowTitle() );
return true;
}
case QEvent::NonClientAreaMouseButtonDblClick :
{
if( isMaximized() )
showNormal();
else
showMaximized();
return true;
}
}
return QDockWidget::event( event );
}
To copy to clipboard, switch view to plain text mode
Why flickering is visible ? There are visible only on loading.
That's like if dock is floating for a little time.
Thanks for the help
Bookmarks