Oleg
4th January 2008, 19:51
Hi all. I have a problem with hiding/showing QDockWidget.
So, I have a QDockWidget
QDockWidget *DiskInfoWidget = new QDockWidget ( tr ( "Disk Information" ), this );
DiskInfoWidget->setFeatures ( QDockWidget::NoDockWidgetFeatures );
DiskInfoWidget->setContextMenuPolicy ( Qt::PreventContextMenu );
addDockWidget ( Qt::TopDockWidgetArea, DiskInfoWidget );
DiskInfoWidget->hide();
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 ) ) );
and here is a slot for triggered()
void cwFMWindow::showDiskInfoWidget ( bool checked )
{
DiskInfoWidget->setVisible ( checked );
}
And all this code does absolutely nothing. I can't guess why... It seems that I miss some stupid reason.
Thanks for help :)
So, I have a QDockWidget
QDockWidget *DiskInfoWidget = new QDockWidget ( tr ( "Disk Information" ), this );
DiskInfoWidget->setFeatures ( QDockWidget::NoDockWidgetFeatures );
DiskInfoWidget->setContextMenuPolicy ( Qt::PreventContextMenu );
addDockWidget ( Qt::TopDockWidgetArea, DiskInfoWidget );
DiskInfoWidget->hide();
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 ) ) );
and here is a slot for triggered()
void cwFMWindow::showDiskInfoWidget ( bool checked )
{
DiskInfoWidget->setVisible ( checked );
}
And all this code does absolutely nothing. I can't guess why... It seems that I miss some stupid reason.
Thanks for help :)