本文整理汇总了C++中QWidgetList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ QWidgetList::append方法的具体用法?C++ QWidgetList::append怎么用?C++ QWidgetList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QWidgetList
的用法示例。
在下文中一共展示了QWidgetList::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accessibleChildren
QWidgetList QAccessibleAbstractScrollArea::accessibleChildren() const
{
QWidgetList children;
// Viewport.
QWidget * viewport = abstractScrollArea()->viewport();
if (viewport)
children.append(viewport);
// Horizontal scrollBar container.
QScrollBar *horizontalScrollBar = abstractScrollArea()->horizontalScrollBar();
if (horizontalScrollBar && horizontalScrollBar->isVisible()) {
children.append(horizontalScrollBar->parentWidget());
}
// Vertical scrollBar container.
QScrollBar *verticalScrollBar = abstractScrollArea()->verticalScrollBar();
if (verticalScrollBar && verticalScrollBar->isVisible()) {
children.append(verticalScrollBar->parentWidget());
}
// CornerWidget.
QWidget *cornerWidget = abstractScrollArea()->cornerWidget();
if (cornerWidget && cornerWidget->isVisible())
children.append(cornerWidget);
return children;
}
示例2: widgets
/*! \internal
Retuns a list of scroll bar widgets for the given position. The scroll bar
itself is not returned.
*/
QWidgetList QAbstractScrollAreaScrollBarContainer::widgets(LogicalPosition position)
{
QWidgetList list;
const int scrollBarIndex = scrollBarLayoutIndex();
if (position == LogicalLeft) {
for (int i = 0; i < scrollBarIndex; ++i)
list.append(layout->itemAt(i)->widget());
} else if (position == LogicalRight) {
const int layoutItemCount = layout->count();
for (int i = scrollBarIndex + 1; i < layoutItemCount; ++i)
list.append(layout->itemAt(i)->widget());
}
return list;
}
示例3: slotTriggered
void RemoveStackPageAction::slotTriggered()
{
if ( !KexiUtils::objectIsA(m_receiver, "QStackedWidget")
&& /* compat */ !KexiUtils::objectIsA(m_receiver, "QWidgetStack"))
{
return;
}
QStackedWidget *stack = qobject_cast<QStackedWidget*>(m_receiver);
QWidget *page = stack->currentWidget();
QWidgetList list;
list.append(page);
KFormDesigner::Command *com = new KFormDesigner::DeleteWidgetCommand(*m_container->form(), list);
// raise prev/next widget
int index = stack->indexOf(page);
if (index > 0) {
index--;
}
else if (index < (stack->count()-1)) {
index++;
}
else {
index = -1;
}
if (index >= 0) {
stack->setCurrentIndex(index);
}
stack->removeWidget(page);
m_container->form()->addCommand(com);
}
示例4: undo
void InsertPageCommand::undo()
{
QWidget *page = m_form->objectTree()->lookup(m_name)->widget();
QWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget();
QWidgetList list;
list.append(page);
KFormDesigner::Command *com = new KFormDesigner::DeleteWidgetCommand(*m_form, list);
QByteArray classname = parent->metaObject()->className();
if (classname == "KFDTabWidget") {
TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent);
tab->removeTab(tab->indexOf(page));
} else if (classname == "QStackedWidget" || /* compat */ classname == "QWidgetStack") {
QStackedWidget *stack = dynamic_cast<QStackedWidget*>(parent);
int index = stack->indexOf(page);
if (index > 0)
index--;
else if (index < (stack->count()-1))
index++;
else
index = -1;
if (index >= 0)
stack->setCurrentIndex(index);
stack->removeWidget(page);
}
com->execute();
delete com;
}
示例5: 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
}
}
示例6: widgets
QWidgetList RolloutBox::widgets() const {
QWidgetList W;
QList<QWidget*> L = findChildren<QWidget*>();
for (int i = 0; i < L.size(); ++i) {
if ((L[i] != m_toolButton) && (L[i] != m_checkBox)) W.append(L[i]);
}
return W;
}
示例7: getAllChildren
static void getAllChildren(QWidget* widget, QWidgetList& list)
{
list.append(widget);
QList<QWidget*> widgets = widget->findChildren<QWidget*>();
foreach (QWidget* w, widgets)
::getAllChildren(w, list);
}
示例8: pageList
QWidgetList OrderDialog::pageList() const
{
QWidgetList rc;
const int count = m_ui->pageList->count();
for (int i=0; i < count; ++i) {
const int oldIndex = m_ui->pageList->item(i)->data(Qt::UserRole).toInt();
rc.append(m_orderMap.value(oldIndex));
}
return rc;
}
示例9: topLevelWidgets
// all toplevel widgets except popups and the desktop
static QWidgetList topLevelWidgets()
{
QWidgetList list;
const QWidgetList tlw(QApplication::topLevelWidgets());
for (int i = 0; i < tlw.count(); ++i) {
QWidget *w = tlw.at(i);
if (!(w->windowType() == Qt::Popup) && !(w->windowType() == Qt::Desktop))
list.append(w);
}
return list;
}
示例10: raise
void QWidget::raise()
{
QWidget *p = parentWidget();
if ( p && p->childObjects && p->childObjects->findRef(this) >= 0 )
p->childObjects->append( p->childObjects->take() );
if ( isTopLevel() ) {
#ifdef QT_NO_WINDOWGROUPHINT
if ( !testWFlags( WStyle_Tool ) )
setActiveWindow();
qwsDisplay()->setAltitude( winId(), 0 );
#else
QWidget* act=0;
if ( !testWFlags( WStyle_Tool ) )
act=this;
qwsDisplay()->setAltitude( winId(), 0 );
if ( childObjects ) {
QObjectListIt it(*childObjects);
QObject* o;
QWidgetList toraise;
QWidget* w;
while ((o=it.current())) {
if ( o->isWidgetType() ) {
w = (QWidget*)o;
if ( w->isTopLevel() )
toraise.append(w);
}
++it;
}
QWidgetListIt wit(toraise);
while ((w=wit.current())) {
if ( w->isVisible() ) {
bool wastool = w->testWFlags( WStyle_Tool );
w->setWFlags( WStyle_Tool ); // avoid setActiveWindow flicker
w->raise();
if ( !wastool ) {
w->clearWFlags( WStyle_Tool );
act = w;
}
}
++wit;
}
}
if ( act )
act->setActiveWindow();
#endif // QT_NO_WINDOWGROUPHINT
} else if ( p ) {
p->setChildrenAllocatedDirty( geometry(), this );
paint_heirarchy( this, TRUE );
}
}
示例11: getAllPanels
QWidgetList* KKbdAccessExtensions::getAllPanels()
{
QWidgetList* allWidgets = kapp->allWidgets();
QWidgetList* allPanels = new QWidgetList;
QWidget* widget = allWidgets->first();
while (widget) {
if (widget->isVisible()) {
if (::qt_cast<QSplitter*>( widget )) {
// Only size QSplitters with at least two handles (there is always one hidden).
if (dynamic_cast<QSplitter *>(widget)->sizes().count() >= 2)
allPanels->append(widget);
} else if (::qt_cast<QDockWindow*>( widget )) {
if (dynamic_cast<QDockWindow *>(widget)->isResizeEnabled()) {
// kdDebug() << "KKbdAccessExtensions::getAllPanels: QDockWindow = " << widget->name() << endl;
allPanels->append(widget);
}
}
}
widget = allWidgets->next();
}
delete allWidgets;
return allPanels;
}
示例12: open_dialog
void open_dialog(QWidget * w)
{
NonModalDialogs.append(w);
}
示例13: formsPreferencias
/*!
\fn Caja::formsPreferencias()
*/
QWidgetList Caja::formsPreferencias()
{
QWidgetList lista;
lista.append( new FormPrefCaja() );
return lista;
}
示例14: setup
void Layout::setup()
{
startPoint = QPoint( 32767, 32767 );
QValueList<QWidgetList> lists;
QWidget *lastParent = 0;
QWidgetList *lastList = 0;
QWidget *w = 0;
// Go through all widgets of the list we got. As we can only
// layout widgets which have the same parent, we first do some
// sorting which means create a list for each parent containing
// its child here. After that we keep working on the list of
// childs which has the most entries.
// Widgets which are already laid out are thrown away here too
for ( w = widgets.first(); w; w = widgets.next() ) {
if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout )
continue;
if ( lastParent != w->parentWidget() ) {
lastList = 0;
lastParent = w->parentWidget();
QValueList<QWidgetList>::Iterator it = lists.begin();
for ( ; it != lists.end(); ++it ) {
if ( ( *it ).first()->parentWidget() == w->parentWidget() )
lastList = &( *it );
}
if ( !lastList ) {
QWidgetList l;
l.setAutoDelete( FALSE );
lists.append( l );
lastList = &lists.last();
}
}
lastList->append( w );
}
// So, now find the list with the most entries
lastList = 0;
QValueList<QWidgetList>::Iterator it = lists.begin();
for ( ; it != lists.end(); ++it ) {
if ( !lastList || ( *it ).count() > lastList->count() )
lastList = &( *it );
}
// If we found no list (because no widget did fit at all) or the
// best list has only one entry and we do not layout a container,
// we leave here.
if ( !lastList || ( lastList->count() < 2 &&
( !layoutBase ||
( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) &&
layoutBase != formWindow->mainContainer() ) )
) ) {
widgets.clear();
startPoint = QPoint( 0, 0 );
return;
}
// Now we have a new and clean widget list, which makes sense
// to layout
widgets = *lastList;
// Also use the only correct parent later, so store it
parent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() );
// Now calculate the position where the layout-meta-widget should
// be placed and connect to widgetDestroyed() signals of the
// widgets to get informed if one gets deleted to be able to
// handle that and do not crash in this case
for ( w = widgets.first(); w; w = widgets.next() ) {
connect( w, SIGNAL( destroyed() ),
this, SLOT( widgetDestroyed() ) );
startPoint = QPoint( QMIN( startPoint.x(), w->x() ),
QMIN( startPoint.y(), w->y() ) );
geometries.insert( w, QRect( w->pos(), w->size() ) );
// Change the Z-order, as saving/loading uses the Z-order for
// writing/creating widgets and this has to be the same as in
// the layout. Else saving + loading will give different results
w->raise();
}
}
示例15: formsPreferencias
/*!
\fn DigiFauno::formsPreferencias()
Devuleve la lista de formularios de configuración para el programa
@return QWidgetList con los formularios
*/
QWidgetList DigiFauno::formsPreferencias()
{
QWidgetList lista;
lista.append( new FormPrefOpciones() );
return lista;
}