本文整理汇总了C++中QWidgetList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidgetList::at方法的具体用法?C++ QWidgetList::at怎么用?C++ QWidgetList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWidgetList
的用法示例。
在下文中一共展示了QWidgetList::at方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
}
示例2: 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));
}
}
}
示例3: changeOrder
void QStackedWidgetEventFilter::changeOrder()
{
QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(stackedWidget());
if (!fw)
return;
const QWidgetList oldPages = qdesigner_internal::OrderDialog::pagesOfContainer(fw->core(), stackedWidget());
const int pageCount = oldPages.size();
if (pageCount < 2)
return;
qdesigner_internal::OrderDialog dlg(fw);
dlg.setPageList(oldPages);
if (dlg.exec() == QDialog::Rejected)
return;
const QWidgetList newPages = dlg.pageList();
if (newPages == oldPages)
return;
fw->beginCommand(tr("Change Page Order"));
for(int i=0; i < pageCount; ++i) {
if (newPages.at(i) == stackedWidget()->widget(i))
continue;
qdesigner_internal::MoveStackedWidgetCommand *cmd = new qdesigner_internal::MoveStackedWidgetCommand(fw);
cmd->init(stackedWidget(), newPages.at(i), i);
fw->commandHistory()->push(cmd);
}
fw->endCommand();
}
示例4: 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);
}
}
示例5: openDateWidget
void processByWeatherWidget::openDateWidget(QModelIndex index){
QWidgetList widgets = qApp->allWidgets();
MainWindow *mainwidget;
for(int i = 0; i < widgets.count(); i++){
if(dynamic_cast<MainWindow*>(widgets.at(i)) != NULL){
//qDebug() << "eureka";
mainwidget = static_cast<MainWindow*>(widgets.at(i));
QDateTime *param = new QDateTime(QDateTime::fromString(index.data().toString(), "yyyy-MM-dd hh:mm:ss"));
weatherDisplayWidget *form = new weatherDisplayWidget(param);
mainwidget->showForm(form);
};
};
}
示例6: restoreAll
void ossimQtMainWindowWorkspace::restoreAll()
{
QWidgetList widgetList = windowList();
for(int i = 0; i < (int)widgetList.count(); ++i)
{
if((!widgetList.at(i)->isShown())||
(widgetList.at(i)->isMinimized()))
{
widgetList.at(i)->showNormal();
}
}
}
示例7: 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;
}
示例8: 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();
}
示例9: 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);
}
}
示例10: raise_sys
void QWidgetPrivate::raise_sys()
{
Q_Q(QWidget);
//@@@ transaction
if (q->isWindow()) {
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
QWidget::qwsDisplay()->setAltitude(q->internalWinId(),
QWSChangeAltitudeCommand::Raise);
// XXX: subsurfaces?
#ifdef QT_NO_WINDOWGROUPHINT
#else
QObjectList childObjects = q->children();
if (!childObjects.isEmpty()) {
QWidgetList toraise;
for (int i = 0; i < childObjects.size(); ++i) {
QObject *obj = childObjects.at(i);
if (obj->isWidgetType()) {
QWidget* w = static_cast<QWidget*>(obj);
if (w->isWindow())
toraise.append(w);
}
}
for (int i = 0; i < toraise.size(); ++i) {
QWidget *w = toraise.at(i);
if (w->isVisible())
w->raise();
}
}
#endif // QT_NO_WINDOWGROUPHINT
}
}
示例11: childAt
/*! \reimp */
int QAccessibleWidget::childAt(int x, int y) const
{
QWidget *w = widget();
if (!w->isVisible())
return -1;
QPoint gp = w->mapToGlobal(QPoint(0, 0));
if (!QRect(gp.x(), gp.y(), w->width(), w->height()).contains(x, y))
return -1;
QWidgetList list = childWidgets(w);
int ccount = childCount();
// a complex child
if (list.size() < ccount) {
for (int i = 1; i <= ccount; ++i) {
if (rect(i).contains(x, y))
return i;
}
return 0;
}
QPoint rp = w->mapFromGlobal(QPoint(x, y));
for (int i = 0; i<list.size(); ++i) {
QWidget *child = list.at(i);
if (!child->isWindow() && !child->isHidden() && child->geometry().contains(rp)) {
return i + 1;
}
}
return 0;
}
示例12: 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();
}
}
示例13: 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;
}
示例14: onAboutToShow
void WindowMenu::onAboutToShow()
{
QWidget* win = QApplication::activeWindow();
pMinimize_->setEnabled(win);
pZoom_->setEnabled(win && win->maximumSize() != win->minimumSize());
pBringAllToFront_->setEnabled(win);
for (int i = windows_.size() - 1; i >= 0; i--)
{
QAction* pAction = windows_[i];
removeAction(pAction);
windows_.removeAt(i);
pAction->deleteLater();
}
QWidgetList topLevels = QApplication::topLevelWidgets();
for (int i = 0; i < topLevels.size(); i++)
{
QWidget* pWindow = topLevels.at(i);
if (!pWindow->isVisible())
continue;
QAction* pAction = new QAction(pWindow->windowTitle(), pWindow);
pAction->setData(QVariant::fromValue(pWindow));
pAction->setCheckable(true);
if (pWindow->isActiveWindow())
pAction->setChecked(true);
insertAction(pWindowPlaceholder_, pAction);
connect(pAction, SIGNAL(triggered()),
this, SLOT(showWindow()));
windows_.append(pAction);
}
}
示例15: 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);
}