Hi all. I have a problem with hiding/showing QDockWidget.
So, I have a QDockWidget
DiskInfoWidget
->setFeatures
( QDockWidget::NoDockWidgetFeatures );
DiskInfoWidget->setContextMenuPolicy ( Qt::PreventContextMenu );
addDockWidget ( Qt::TopDockWidgetArea, DiskInfoWidget );
DiskInfoWidget->hide();
QDockWidget *DiskInfoWidget = new QDockWidget ( tr ( "Disk Information" ), this );
DiskInfoWidget->setFeatures ( QDockWidget::NoDockWidgetFeatures );
DiskInfoWidget->setContextMenuPolicy ( Qt::PreventContextMenu );
addDockWidget ( Qt::TopDockWidgetArea, DiskInfoWidget );
DiskInfoWidget->hide();
To copy to clipboard, switch view to plain text mode
a QAction to control it
DiskInfoAction
= new QAction ( QIcon ( ":/toolbar/information" ), tr
( "Disk Information" ),
this );
DiskInfoAction->setCheckable ( true );
DiskInfoAction->connect ( DiskInfoAction, SIGNAL ( triggered ( bool ) ), this, SLOT ( showDiskInfoWidget ( bool ) ) );
DiskInfoAction = new QAction ( QIcon ( ":/toolbar/information" ), tr ( "Disk Information" ), this );
DiskInfoAction->setCheckable ( true );
DiskInfoAction->connect ( DiskInfoAction, SIGNAL ( triggered ( bool ) ), this, SLOT ( showDiskInfoWidget ( bool ) ) );
To copy to clipboard, switch view to plain text mode
and here is a slot for triggered()
void cwFMWindow::showDiskInfoWidget ( bool checked )
{
DiskInfoWidget->setVisible ( checked );
}
void cwFMWindow::showDiskInfoWidget ( bool checked )
{
DiskInfoWidget->setVisible ( checked );
}
To copy to clipboard, switch view to plain text mode
And all this code does absolutely nothing. I can't guess why... It seems that I miss some stupid reason.
Thanks for help
Bookmarks