本文整理汇总了C++中QWidget::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidget::hide方法的具体用法?C++ QWidget::hide怎么用?C++ QWidget::hide使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWidget
的用法示例。
在下文中一共展示了QWidget::hide方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayVideo
void GalleryUtil::PlayVideo(const QString &filename)
{
// HACK begin - remove when everything is using mythui
vector<QWidget *> widgetList;
if (GetMythMainWindow()->currentWidget())
{
QWidget *widget = GetMythMainWindow()->currentWidget();
while (widget)
{
widgetList.push_back(widget);
GetMythMainWindow()->detach(widget);
widget->hide();
widget = GetMythMainWindow()->currentWidget();
}
GetMythMainWindow()->GetPaintWindow()->raise();
GetMythMainWindow()->GetPaintWindow()->setFocus();
//GetMythMainWindow()->ShowPainterWindow();
}
// HACK end
GetMythMainWindow()->HandleMedia("Internal", filename);
// HACK begin - remove when everything is using mythui
vector<QWidget*>::reverse_iterator it;
for (it = widgetList.rbegin(); it != widgetList.rend(); ++it)
{
GetMythMainWindow()->attach(*it);
(*it)->show();
}
//GetMythMainWindow()->HidePainterWindow();
// HACK end
}
示例2: updateLegend
void PlotMarkerLegend::updateLegend(QwtLegend* legend) const
{
if ( legend == NULL )
return;
if ( legend && testItemAttribute( QwtPlotItem::Legend ) && symbol() && symbol()->style() != QwtSymbol::NoSymbol )
{
QWidget *lgdItem = legend->find( this );
if ( lgdItem == NULL )
{
lgdItem = legendItem();
if ( lgdItem )
legend->insert( this, lgdItem );
}
LegendItem *l = qobject_cast<LegendItem *>( lgdItem );
if ( l )
l->setIdentifierSize( symbol()->boundingSize() );
}
QWidget *lgdItem = legend->find( this );
if ( testItemAttribute( QwtPlotItem::Legend ) )
{
LegendItem *label = qobject_cast<LegendItem *>( lgdItem );
if ( label )
{
// paint the identifier
const QSize sz = label->identifierSize();
QPixmap identifier( sz.width(), sz.height() );
identifier.fill( Qt::transparent );
QPainter painter( &identifier );
painter.setRenderHint( QPainter::Antialiasing, testRenderHint( QwtPlotItem::RenderAntialiased ) );
drawLegendIdentifier( &painter, QRect( 0, 0, sz.width(), sz.height() ) );
painter.end();
const bool doUpdate = label->updatesEnabled();
if ( doUpdate )
label->setUpdatesEnabled( false );
label->setText( title() );
label->setIdentifier( identifier );
label->setItemMode( legend->itemMode() );
if ( doUpdate )
label->setUpdatesEnabled( true );
label->update();
}
}
else
{
if ( lgdItem )
{
lgdItem->hide();
lgdItem->deleteLater();
}
}
}
示例3: eventFilter
bool DockPlugin::eventFilter(QObject *o, QEvent *e)
{
if (o == m_popup)
{
if (e->type() == QEvent::Hide)
{
m_popup->removeEventFilter(this);
m_popup = NULL;
}
}else{
switch (e->type())
{
case QEvent::Close:
if (!m_bQuit)
{
QWidget *main = static_cast<QWidget*>(o);
setValue("ShowMain", false);
//setShowMain(false);
main->hide();
e->ignore();
return true;
}
break;
case QEvent::WindowDeactivate:
m_inactiveTime = QDateTime::currentDateTime();
break;
case QEvent::WindowActivate:
m_inactiveTime = QDateTime();
break;
default:
break;
}
}
return QObject::eventFilter(o, e);
}
示例4: setIndexWidget
void ItemDelegate::setIndexWidget(const QModelIndex &index, ItemWidget *w)
{
reset(&m_cache[index.row()], w);
if (w == NULL)
return;
QWidget *ww = w->widget();
if (!m_antialiasing) {
QFont f = ww->font();
f.setStyleStrategy(QFont::NoAntialias);
ww->setFont(f);
foreach (QWidget *child, ww->findChildren<QWidget *>("item_child"))
child->setFont(f);
}
// Try to get proper size by showing item momentarily.
ww->show();
w->updateSize(m_maxSize, m_idealWidth);
ww->hide();
ww->installEventFilter(this);
w->setCurrent(m_view->currentIndex() == index);
emit rowSizeChanged();
}
示例5: setCurrentIndex
/*!
\property QStackedLayout::currentIndex
\brief the index position of the widget that is visible
The current index is -1 if there is no current widget.
\sa currentWidget(), indexOf()
*/
void QStackedLayout::setCurrentIndex(int index)
{
Q_D(QStackedLayout);
QWidget *prev = currentWidget();
QWidget *next = widget(index);
if (!next || next == prev)
return;
bool reenableUpdates = false;
QWidget *parent = parentWidget();
if (parent && parent->updatesEnabled()) {
reenableUpdates = true;
parent->setUpdatesEnabled(false);
}
QPointer<QWidget> fw = parent ? parent->window()->focusWidget() : 0;
const bool focusWasOnOldPage = fw && (prev && prev->isAncestorOf(fw));
if (prev) {
prev->clearFocus();
if (d->stackingMode == StackOne)
prev->hide();
}
d->index = index;
next->raise();
next->show();
// try to move focus onto the incoming widget if focus
// was somewhere on the outgoing widget.
if (parent) {
if (focusWasOnOldPage) {
// look for the best focus widget we can find
if (QWidget *nfw = next->focusWidget())
nfw->setFocus();
else {
// second best: first child widget in the focus chain
if (QWidget *i = fw) {
while ((i = i->nextInFocusChain()) != fw) {
if (((i->focusPolicy() & Qt::TabFocus) == Qt::TabFocus)
&& !i->focusProxy() && i->isVisibleTo(next) && i->isEnabled()
&& next->isAncestorOf(i)) {
i->setFocus();
break;
}
}
// third best: incoming widget
if (i == fw )
next->setFocus();
}
}
}
}
if (reenableUpdates)
parent->setUpdatesEnabled(true);
emit currentChanged(index);
}
示例6: setGeometry
void StatusBarLayout::setGeometry( const QRect& _rect )
{
QLayout::setGeometry( _rect );
if( mIsDirty )
updateLayoutStructs();
QRect rect( 0, 0, _rect.width(), _rect.height() );
const int margin = 0;//this->margin();
const int spacing = this->spacing();
int availableWidth = rect.size().width() - 2*margin;
const int availableHeight = rect.size().height() - 2*margin;
int usedWidth = 0;
int visibleCount = 0;
int i;
for( i = 0; i<mWidgetList.count(); ++i )
{
QWidgetItem* item = mWidgetList.at( i );
QWidget* widget = item->widget();
// TODO: is there really no way to get to the geometry data if a widget is hidden?
if( widget->isHidden() )
widget->show();
const int itemWidth = item->sizeHint().width();
const int itemSpacing = ( visibleCount == 0 ) ? 0 : spacing;
const int newUsedWidth = usedWidth + itemSpacing + itemWidth;
// kDebug()<<widget<<<<availableWidth<<usedWidth<<itemWidth<<itemSpacing<<newUsedWidth;
const bool isTooWide = ( newUsedWidth > availableWidth );
if( isTooWide )
break;
const QPoint pos( margin + usedWidth, margin );
const QSize size( itemWidth, availableHeight );
QRect r( pos, size );
r = QStyle::visualRect( parentWidget()->layoutDirection(), rect, r );
item->setGeometry( r );
usedWidth = newUsedWidth;
++visibleCount;
}
// hide the rest if needed
for( ; i<mWidgetList.count(); ++i )
{
QWidgetItem* item = mWidgetList.at( i );
QWidget* widget = item->widget();
if( ! widget->isHidden() )
widget->hide();
}
}
示例7: toogleVisibility
void VideoWidget::toogleVisibility()
{
QWidget* widget = dynamic_cast<QWidget*>(this);
if(widget->isVisible())
widget->hide();
else
widget->show();
}
示例8: closeEvent
void PlayerDemo::closeEvent(QCloseEvent *event)
{
// Close window, stop player, and quit
QWidget *pWin = QApplication::activeWindow();
pWin->hide();
player->Stop();
QApplication::quit();
}
示例9: hideEditor
void VstPlugin::hideEditor()
{
QWidget * w = pluginWidget();
if( w )
{
w->hide();
}
}
示例10:
void pa_db::dock_widget::hideSpecies()
{
QWidget *spw = qobject_cast<QWidget *>( lblSpeciesList->parent() );
spw->hide();
//speciesList()->hide();
//lblSpeciesList->hide();
}
示例11: QFormLayout
QWidget * medVtkViewItkDataImageNavigator::buildToolBoxWidget()
{
QWidget *toolBoxWidget = new QWidget;
QFormLayout *layout = new QFormLayout(toolBoxWidget);
foreach(medAbstractParameterL *parameter, d->parameters)
layout->addRow(parameter->getLabel(), parameter->getWidget());
toolBoxWidget->hide();
return toolBoxWidget;
}
示例12: hideView
void Dialog::hideView()
{
QWidget * w = asQWidget();
if (!w->isVisible())
return;
clearParams();
disconnect();
w->hide();
}
示例13: e
void *DockPlugin::processEvent(Event *e)
{
if (e->type() == EventInit)
init();
if (e->type() == EventRaiseWindow){
if ((e->param() == getMainWindow()) && !getShowMain())
return e->param();
}
if (e->type() == EventCommandCreate){
CommandDef *def = (CommandDef*)(e->param());
if (def->menu_id == MenuMain){
CommandDef d = *def;
if (def->flags & COMMAND_IMPORTANT){
if (d.menu_grp == 0)
d.menu_grp = 0x1001;
}else{
d.menu_grp = 0;
}
d.menu_id = DockMenu;
d.bar_id = 0;
Event e(EventCommandCreate, &d);
e.process();
}
}
if (e->type() == EventCheckState){
CommandDef *def = (CommandDef*)(e->param());
if (def->id == CmdToggle){
def->flags &= ~COMMAND_CHECKED;
def->text = isMainShow() ?
I18N_NOOP("Hide main window") :
I18N_NOOP("Show main window");
return e->param();
}
}
if (e->type() == EventCommandExec){
CommandDef *def = (CommandDef*)(e->param());
if (def->id == CmdToggle){
QWidget *main = getMainWindow();
if (isMainShow()){
setShowMain(false);
main->hide();
}else{
setShowMain(true);
raiseWindow(main);
}
return e->param();
}
if (def->id == CmdCustomize){
Event eCustomize(EventMenuCustomize, (void*)DockMenu);
eCustomize.process();
return e->param();
}
if (def->id == CmdQuit)
bQuit = true;
}
return NULL;
}
示例14: close
void StackedUtilityPanelController::close(DesignDocumentController* designDocumentController)
{
QWidget* page = stackedPageWidget(designDocumentController);
if (m_stackedWidget->children().contains(page)) {
page->hide();
m_stackedWidget->removeWidget(page);
}
}
示例15: Show
void Window::Show(bool show)
{
QWidget *w = PWindow(wid);
if (show)
w->show();
else
w->hide();
}