本文整理汇总了C++中QDockWidget::isHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::isHidden方法的具体用法?C++ QDockWidget::isHidden怎么用?C++ QDockWidget::isHidden使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::isHidden方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showTileScale
void QgsTileScaleWidget::showTileScale( QMainWindow *mainWindow )
{
QDockWidget *dock = mainWindow->findChild<QDockWidget *>( "theTileScaleDock" );
if ( dock )
{
dock->setVisible( dock->isHidden() );
return;
}
QgsMapCanvas *canvas = mainWindow->findChild<QgsMapCanvas *>( "theMapCanvas" );
QgsDebugMsg( QString( "canvas:%1 [%2]" ).arg(( ulong ) canvas, 0, 16 ).arg( canvas ? canvas->objectName() : "" ) );
if ( !canvas )
{
QgsDebugMsg( "map canvas theMapCanvas not found" );
return;
}
QgsTileScaleWidget *tws = new QgsTileScaleWidget( canvas );
tws->setObjectName( "theTileScaleWidget" );
QObject *legend = mainWindow->findChild<QObject*>( "theLayerTreeView" );
if ( legend )
{
connect( legend, SIGNAL( currentLayerChanged( QgsMapLayer* ) ),
tws, SLOT( layerChanged( QgsMapLayer* ) ) );
}
else
{
QgsDebugMsg( "legend not found" );
}
//create the dock widget
dock = new QDockWidget( tr( "Tile Scale Panel" ), mainWindow );
dock->setObjectName( "theTileScaleDock" );
dock->setAllowedAreas( Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea );
mainWindow->addDockWidget( Qt::RightDockWidgetArea, dock );
// add to the Panel submenu
QMenu *panelMenu = mainWindow->findChild<QMenu *>( "mPanelMenu" );
if ( panelMenu )
{
// add to the Panel submenu
panelMenu->addAction( dock->toggleViewAction() );
}
else
{
QgsDebugMsg( "panel menu not found" );
}
dock->setWidget( tws );
connect( dock, SIGNAL( visibilityChanged( bool ) ), tws, SLOT( scaleEnabled( bool ) ) );
QSettings settings;
dock->setVisible( settings.value( "/UI/tileScaleEnabled", false ).toBool() );
}
示例2: glRectF
void QStaticWidgetSwitchable3D::beforeOpen()
{
m_StaticImage = QPixmap(m_pWidget->size()/*, QImage::Format_RGB32*/);
if(!m_pWidget->isVisible())
{
m_pWidget->show();
m_pWidget->hide();
}
m_pWidget->render(&m_StaticImage);
m_pOwner->setFocus();
/*QGLWidget* qgl = NULL;
Q_FOREACH(qgl, m_QGLWidgetsToRender)
{
if(qgl->isVisible())
{
QWidget* parent = (QWidget*)m_pOwner;
QPoint screenQGLCoords = qgl->mapTo(m_pWidget, QPoint(0,0));
float w = float(qgl->width());
float h = float(qgl->height());
QRectF glRectF(0,0,w,h);
QPainter painter(&m_StaticImage);
painter.drawImage(glRectF, qgl->grabFrameBuffer(true));
}
}*/
if(m_pWidget->inherits("QMainWindow"))
{
QMainWindow* pMainWindow = (QMainWindow*)m_pWidget;
QList<QDockWidget*> docks = pMainWindow->findChildren<QDockWidget*>();
QDockWidget* dock = NULL;
Q_FOREACH(dock, docks)
{
if(dock->isFloating() && !dock->isHidden())
{
if(!m_FloatingVisibleDockWidgets.contains(dock))
{
m_FloatingVisibleDockWidgets.append(dock);
dock->setVisible(false);
}
}
}
}