当前位置: 首页>>代码示例>>C++>>正文


C++ QWidgetList::count方法代码示例

本文整理汇总了C++中QWidgetList::count方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidgetList::count方法的具体用法?C++ QWidgetList::count怎么用?C++ QWidgetList::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWidgetList的用法示例。


在下文中一共展示了QWidgetList::count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DllCanUnloadNow

STDAPI DllCanUnloadNow()
{
    if (GetCurrentThreadId() != qAxThreadId)
        return S_FALSE;
    if (qAxLockCount())
        return S_FALSE;
    if (!qax_ownQApp)
        return S_OK;
    
    // check if qApp still runs widgets (in other DLLs)
    QWidgetList widgets = qApp->allWidgets();
    int count = widgets.count();
    for (int w = 0; w < widgets.count(); ++w) {
        // remove all Qt generated widgets
        QWidget *widget = widgets.at(w);
        if (widget->windowType() == Qt::Desktop || widget->objectName() == QLatin1String("Qt internal tablet widget"))
            count--;
    }
    if (count)
        return S_FALSE;
    
    // no widgets left - destroy qApp
    if (qax_hhook)
        UnhookWindowsHookEx(qax_hhook);
    
    delete qApp;
    qax_ownQApp = false;
    
    // never allow unloading - safety net for Internet Explorer
    return S_FALSE;
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例2: while

extern "C" void qtns_shutdown()
{
    if (clients.count() > 0) {
        QMap<QtNPInstance *, QX11EmbedWidget *>::iterator it = clients.begin();
        while (it != clients.end()) {
            delete it.value();
            ++it;
        }
        clients.clear();
    }

    if (!ownsqapp)
        return;

    // check if qApp still runs widgets (in other DLLs)
    QWidgetList widgets = qApp->allWidgets();
    int count = widgets.count();
    for (int w = 0; w < widgets.count(); ++w) {
        // ignore all Qt generated widgets
        QWidget *widget = widgets.at(w);
        if (widget->windowFlags() & Qt::Desktop)
            count--;
    }
    if (count) // qApp still used
        return;

    delete qApp;
    ownsqapp = false;
}
开发者ID:PhobosK,项目名称:plexydesk,代码行数:29,代码来源:qtbrowserplugin_x11.cpp

示例3: pickBorderColor

void pieDialog::pickBorderColor()
{
QColor c = QColorDialog::getColor(boxBorderColor->color(), this);
if ( !c.isValid() || c == boxBorderColor->color() )
	return;

boxBorderColor->setColor ( c ) ;

if (boxAll->isChecked())
	{
	QWidgetList* allPlots = mPlot->graphPtrs();
	for (int i=0; i<(int)allPlots->count();i++)
		{
		Graph* g=(Graph*)allPlots->at(i);
		if (g)
			g->drawBorder(boxBorderWidth->value(), c);
		}
	}
else
	{
	Graph* g = (Graph*)mPlot->activeGraph();
	if (g)
		g->drawBorder(boxBorderWidth->value(), c);
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:25,代码来源:pieDialog.cpp

示例4: windowsMenuAboutToShow

//**********************************************************************
void TulipApp::windowsMenuAboutToShow() {
  windowsMenu->clear();

  if(tabWidget->currentIndex()==-1)
    return;

  QWorkspace *currentWorkspace=controllerToWorkspace[tabIndexToController[tabWidget->currentIndex()]];
  QAction* cascadeAction = windowsMenu->addAction("&Cascade", this, SLOT(cascade() ) );
  QAction* tileAction = windowsMenu->addAction("&Tile", currentWorkspace, SLOT(tile() ) );
  QAction* closeallAction = windowsMenu->addAction("Close All", this, SLOT(closeAll()));

  if ( currentWorkspace->windowList().isEmpty() ) {
    cascadeAction->setEnabled(false);
    tileAction->setEnabled(false);
    closeallAction->setEnabled(false);
  }
  else {
    windowsMenu->addSeparator();
    QWidgetList windows = currentWorkspace->windowList();

    for ( int i = 0; i < int(windows.count()); ++i ) {
      QAction* action = windowsMenu->addAction(windows.at(i)->windowTitle());
      action->setChecked(currentWorkspace->activeWindow() == windows.at(i));
      action->setData(QVariant(i));
    }
  }
}
开发者ID:kdbanman,项目名称:browseRDF,代码行数:28,代码来源:TulipApp.cpp

示例5: updatePlot

void pieDialog::updatePlot()
{
if (generalDialog->currentPage()==(QWidget *)pieOptions)
	{
	QPen pen=QPen(boxLineColor->color(),boxLineWidth->value(), style());
	emit updatePie(pen, pattern(), boxRay->value(), boxFirstColor->currentItem());	
	}
	
if (generalDialog->currentPage()==(QWidget*)frame)
	{
	if (!boxAll->isChecked())
		return;
	
	QColor c = boxBackgroundColor->color();
	QWidgetList* allPlots = mPlot->graphPtrs();
	for (int i=0; i<(int)allPlots->count();i++)
		{
		Graph* g=(Graph*)allPlots->at(i);
		if (g)
			{
			g->drawBorder(boxBorderWidth->value(), boxBorderColor->color());
			g->changeMargin(boxMargin->value());
			g->setBackgroundColor(c);
			}
		}
	if (c == QColor(white) && mPlot->hasOverlapingLayers())
		mPlot->updateTransparency();
	}
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:29,代码来源:pieDialog.cpp

示例6: onWindowsMenuAboutToShow

void DiffAnalystWindow::onWindowsMenuAboutToShow()
{
	m_pWindowsMenu->clear ();

	int cascadeId = m_pWindowsMenu->insertItem ("&Cascade", this, SLOT (onCascade ()));
	int tileId    = m_pWindowsMenu->insertItem ("&Tile", this, SLOT (onTile ()));
	int close_all_id = m_pWindowsMenu->insertItem ("Close Al&l", this, SLOT (onCloseAllWindows ()));
	if (m_pWs->windowList ().isEmpty ())
	{
		m_pWindowsMenu->setItemEnabled (cascadeId, FALSE);
		m_pWindowsMenu->setItemEnabled (tileId, FALSE);
		m_pWindowsMenu->setItemEnabled (close_all_id, FALSE);
	}

	m_pWindowsMenu->insertSeparator ();

	QWidgetList windows = m_pWs->windowList ();

	for (int i = 0; i < int (windows.count ()); ++i)
	{
		int id = m_pWindowsMenu->insertItem (windows.at (i)->caption (),
				this,
				SLOT (onWindowsMenuActivated (int)));

		m_pWindowsMenu->setItemParameter (id, i);
		m_pWindowsMenu->setItemChecked (id,
		m_pWs->activeWindow () == windows.at (i));
	}
}
开发者ID:concocon,项目名称:CodeAnalyst-3_4_18_0413-Public,代码行数:29,代码来源:DiffAnalystWindow.cpp

示例7: pickBackgroundColor

void pieDialog::pickBackgroundColor()
{
QColor c = QColorDialog::getColor(boxBackgroundColor->color(), this);
if ( !c.isValid() || c == boxBackgroundColor->color() )
	return;

boxBackgroundColor->setColor ( c ) ;

if (boxAll->isChecked())
	{
	QWidgetList* allPlots = mPlot->graphPtrs();
	for (int i=0; i<(int)allPlots->count();i++)
		{
		Graph* g=(Graph*)allPlots->at(i);
		if (g)
			g->setBackgroundColor(c);
		}
	}
else
	{
	Graph* g = (Graph*)mPlot->activeGraph();
	if (g)
		g->setBackgroundColor(c);
	}

if (c == QColor(white) && mPlot->hasOverlapingLayers())
	mPlot->updateTransparency();
}
开发者ID:BackupTheBerlios,项目名称:qtiplot-svn,代码行数:28,代码来源:pieDialog.cpp

示例8: sPrepareWindowMenu

void ReportWriterWindow::sPrepareWindowMenu()
{
  windowMenu->clear();

  int intCascadeid = windowMenu->insertItem(tr("&Cascade"), ws, SLOT(cascade()));
  int intTileid = windowMenu->insertItem(tr("&Tile"), ws, SLOT(tile()));

  windowMenu->insertSeparator();

  int cnt = 0;
  QWidgetList windows = ws->windowList();
  for (unsigned int intCursor = 0; intCursor < windows.count(); intCursor++)
  {
    if(windows.at(intCursor)->isVisible())
    {
      int intMenuid = windowMenu->insertItem(windows.at(intCursor)->caption(), windows.at(intCursor), SLOT(setFocus()));
      windowMenu->setItemChecked(intMenuid, (ws->activeWindow() == windows.at(intCursor)));
      cnt++;
    }
  }

  if (cnt < 1)
  {
    windowMenu->setItemEnabled(intCascadeid, FALSE);
    windowMenu->setItemEnabled(intTileid, FALSE);
  }
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:27,代码来源:reportwriterwindow.cpp

示例9: closeEvent

 void closeEvent(QCloseEvent *evt){
     QWidgetList windows = ws->windowList();
     for (int i = 0; i < int(windows.count()); ++i) {
         GLWidget *window = (GLWidget *)windows.at(i);
         window->stopRendering();
     }
     QMainWindow::closeEvent(evt);
 }
开发者ID:aewallin,项目名称:sandbox,代码行数:8,代码来源:appwindow.hpp

示例10: while

QWidget*
tomahawkWindow()
{
    QWidgetList widgetList = qApp->topLevelWidgets();
    int i = 0;
    while( i < widgetList.count() && widgetList.at( i )->objectName() != "TH_Main_Window" )
        i++;

    if ( i == widgetList.count() )
    {
        qDebug() << Q_FUNC_INFO << "could not find main Tomahawk mainwindow";
        Q_ASSERT( false );
        return 0;
    }

    QWidget *widget = widgetList.at( i );
    return widget;
}
开发者ID:demelziraptor,项目名称:tomahawk,代码行数:18,代码来源:TomahawkUtilsGui.cpp

示例11: sendEventToAll

void ossimQtMainWindowWorkspace::sendEventToAll(QEvent* evt)
{
  QWidgetList widgetList = windowList();
  
  for(int i = 0; i < (int)widgetList.count(); ++i)
    {
      QApplication::sendEvent(widgetList.at(i), evt);
    }
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:9,代码来源:ossimQtMainWindowWorkspace.cpp

示例12: minimizeAll

void ossimQtMainWindowWorkspace::minimizeAll()
{
    QWidgetList widgetList = windowList();
    
    for(int i = 0; i < (int)widgetList.count(); ++i)
    {
	widgetList.at(i)->showMinimized();
    }
}
开发者ID:star-labs,项目名称:star_ossim,代码行数:9,代码来源:ossimQtMainWindowWorkspace.cpp

示例13:

    static QWidget *parentWidget()
    {
        QWidgetList widgets = QApplication::topLevelWidgets();

        if (widgets.count())
            return widgets.at(0);
        else
            return 0;
    }
开发者ID:ActionLuzifer,项目名称:razor-qt,代码行数:9,代码来源:powermanager.cpp

示例14: role

/*! \reimp */
QAccessible::Role QAccessibleWidget::role(int child) const
{
    if (!child)
        return d->role;

    QWidgetList childList = childWidgets(widget());
    if (childList.count() > 0 && child <= childList.count()) {
        QWidget *targetWidget = childList.at(child - 1);
        QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(targetWidget);
        if (iface) {
            QAccessible::Role role = iface->role(0);
            delete iface;
            return role;
        }
    }

    return NoRole;
}
开发者ID:Arise,项目名称:Open-DPI-Detector,代码行数:19,代码来源:qaccessiblewidget.cpp

示例15: onCloseAllWindows

void DiffAnalystWindow::onCloseAllWindows()
{
        // Close all open windows
        QWidgetList windows = m_pWs->windowList ();

        for (int i = 0; i < int (windows.count ()); ++i)
        {
                windows.at (i)->close ();
        }
}
开发者ID:concocon,项目名称:CodeAnalyst-3_4_18_0413-Public,代码行数:10,代码来源:DiffAnalystWindow.cpp


注:本文中的QWidgetList::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。