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


C++ QObjectList::append方法代码示例

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


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

示例1: adjustAppearanceToOS

// from: http://stackoverflow.com/questions/5298614/change-the-size-of-qt-dialogs-depending-on-the-platform
void MainWindow::adjustAppearanceToOS(QWidget *rootWidget)
{
    int fontSize = -1;
    #ifdef Q_OS_WIN
        fontSize = 8;
    #elif __APPLE__
        fontSize = 12;
    #elif __linux
        fontSize = 11;
    #endif

    if (rootWidget == NULL)
        return;

    QObject *child = NULL;
    QObjectList Containers;
    QObject *container  = NULL;
    QStringList DoNotAffect;

    // Make an exception list (Objects not to be affected)
    // DoNotAffect.append("widgetName");

    // Append root to containers
    Containers.append(rootWidget);

    while (!Containers.isEmpty())
    {
        container = Containers.takeFirst();
        if (container != NULL)
            for (int i = 0; i < container->children().size(); i++)
            {
                child = container->children()[i];
                if (!child->isWidgetType() || DoNotAffect.contains(child->objectName()))
                    continue;

                if (child->children().size() > 0)
                    Containers.append(child);

                // (if the object is not of the correct type, it will be NULL)
                QLabel *label = qobject_cast<QLabel *>(child);
                if (label != NULL)
                {
                    label->setText(label->text().replace(QRegExp("font-size:.*;"), ""));

                    QFont font = label->font();
                    font.setPointSize(fontSize);
                    label->setFont(font);
                }
            }
    }
}
开发者ID:changbiao,项目名称:XDBF-Manager,代码行数:52,代码来源:mainwindow.cpp

示例2: objectForFakeForm

QObjectList *Project::formList( bool resolveFakeObjects ) const
{
    QObjectList *l = new QObjectList;
    for ( QPtrListIterator<FormFile> forms(formfiles);   forms.current(); ++forms ) {
	FormFile* f = forms.current();
	if ( f->formWindow() ) {
	    if ( resolveFakeObjects && f->formWindow()->isFake() )
		l->append( objectForFakeForm( f->formWindow() ) );
	    else
		l->append( f->formWindow()->child( 0, "QWidget" ) );
	} else if ( f->isFake() ) {
	    l->append( objectForFakeFormFile( f ) );
	}
    }
    return l;
}
开发者ID:OS2World,项目名称:LIB-QT3_Toolkit_Vbox,代码行数:16,代码来源:project.cpp

示例3: createDetails

/*
 * Description : create the details of this widget.
 */
void IRStationDetailsView::createDetails()
{
    setObjectName(STATION_DETAILS_VIEW_OBJECT_NAME);
    QObjectList roots;
    roots.append(this);
    iLoader.setObjectTree(roots);
    iLoader.load(STATION_DETAILS_VIEW_LAYOUT_FILENAME);
    
    HbAction *exitAction = qobject_cast<HbAction *> (iLoader.findObject(EXIT_ACTION));
    connect(exitAction, SIGNAL(triggered()), iApplication, SIGNAL(quit())); 
    
    // Find the station information objects
    iScrollArea = qobject_cast<HbScrollArea *>(iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_SCROLL_AREA));
    HbScrollBar *scrollbar = iScrollArea->verticalScrollBar();
    scrollbar->setVisible(true);
    scrollbar->setInteractive(true);
    iScrollArea->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded);
    iContainer = qobject_cast<HbWidget *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_SCROLLAREA_CONTENTS));
    iStationName = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_STATION_NAME));
    iGenres = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_GENRE));
    iLanguage = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_LANGUAGE));
    iCountry = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_COUNTRY));
    iBitRate = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_BITE_RATE));
    iDescription = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_DESCRIPTION));    
    iNowPlayingUrl = qobject_cast<HbLabel *> (iLoader.findObject(STATION_DETAILS_VIEW_OBJECT_STATION_URL));
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:29,代码来源:irstationdetailsview.cpp

示例4: HbAction

BtCpUiDeviceDetailsView::BtCpUiDeviceDetailsView(QGraphicsItem *parent)
    :CpBaseSettingView( 0 , parent )
{
   
    mSoftKeyBackAction = new HbAction(Hb::BackNaviAction, this);
    BTUI_ASSERT_X(mSoftKeyBackAction, "BtCpUiDeviceDetailsView::BtCpUiDeviceDetailsView", "can't create back action");

    // Create view for the application.
    // Set the name for the view. The name should be same as the view's
    // name in docml.
    setObjectName("bt_device_details_view");

    mLoader = new HbDocumentLoader();
    // Pass the view to documentloader. Document loader uses this view
    // when docml is parsed, instead of creating new view.
    QObjectList objectList;
    objectList.append(this);
    mLoader->setObjectTree(objectList);

    // read view info from docml file
    bool ok = false;
    mLoader->load( BTUI_DEVICEDETAILSVIEW_DOCML, &ok );
    // Exit if the file format is invalid
    BTUI_ASSERT_X( ok, "bt-device-details-view", "Invalid docml file" );
    
    mLayout = new QGraphicsLinearLayout(Qt::Vertical, this);
    mGroupBox = new HbGroupBox();
    mLayout->addItem(mGroupBox);
    
    setLayout( mLayout );

}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:32,代码来源:btcpuidevicedetailsview.cpp

示例5: getRoutes

   // -------------------------------------------------------------------------
   QObjectList JsLayer::getRoutes()
   {
      QObjectList objList;

      JsRoutePtrListIterator i(m_routes);
      while( i.hasNext() )
      {
         objList.append( i.next().get()->getObject() );
      }

      return objList;
   }
开发者ID:dsheets4,项目名称:Trajic,代码行数:13,代码来源:JsLayer.cpp

示例6: objectFromName

QObject* ObjectNameMapper::objectFromName(const QString& path ) const
{
    Q_ASSERT(!path.isEmpty());
    QObject* obj = 0;
    QStringList names = path.split(delimiter, QString::KeepEmptyParts);
    Q_ASSERT(names.size()>1);
    QStringList::const_iterator iname = names.constBegin();
    ++iname; // omit allways empty first string before leading delimmiterdeli
    QObjectList olist;
    foreach (QWidget* w, QApplication::topLevelWidgets()) {
        olist.append(w);
    }
开发者ID:rst256,项目名称:martlet,代码行数:12,代码来源:ObjectNameMapper.cpp

示例7: foreach

QList<GTAbstractGUIAction*> GTCrazyUserMonitor::formGUIActions(QWidget* widget) const {
    QList<GTAbstractGUIAction*> actionList;
    SAFE_POINT(NULL != widget, "", actionList);

    QObjectList objectList = widget->findChildren<QObject*>();
    objectList.append(widget);

    foreach(QObject* o, objectList) {
        GTAbstractGUIAction* guiAction = GTRandomGUIActionFactory::create(o);
        if (NULL != guiAction) {
            actionList.append(guiAction);
        }
    }
开发者ID:m-angelov,项目名称:ugene,代码行数:13,代码来源:GUICrazyUserTest.cpp

示例8: suggestSimilar

QObjectList BookmarksController::suggestSimilar(QString suggest)
{
    QMap<QString, QString> bookmarksMap = m_bm->findBookmarks(suggest);
    QMap<QString, QString> historyMap = WRT::HistoryManager::getSingleton()->findHistory(suggest);
    // Now combine the result
    QObjectList suggestions;
    
    QMapIterator<QString,QString> bhi(historyMap); 
    while (bhi.hasNext()) { 
        bhi.next(); 
        suggestions.append(new Suggestion(bhi.key(), bhi.value())); 
    } 

    QMapIterator<QString,QString> bmi(bookmarksMap); 
    while (bmi.hasNext()) { 
        bmi.next(); 
        if (historyMap.contains(bmi.key())) 
            continue; 
        suggestions.append(new Suggestion(bmi.key(), bmi.value())); 
    }
    
    return suggestions;

}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:24,代码来源:bookmarkscontroller.cpp

示例9: do_cls

void MvcpThread::do_cls(mvcp a_mvcp, QObject* parent)
{
    QObjectList* result = new QObjectList;
    mvcp_dir dir = mvcp_dir_init(a_mvcp, parent->property("path").toString().toUtf8().constData());
    int n = mvcp_dir_count(dir);
    for (int i = 0; i < n; i++) {
        mvcp_dir_entry_t entry;
        mvcp_dir_get(dir, i, &entry);
        QObject* o = new QObject;
        o->setObjectName(QString::fromUtf8(entry.full));
        o->setProperty("name", QString::fromUtf8(entry.name));
        o->setProperty("dir", entry.dir);
        o->setProperty("size", entry.size);
        result->append(o);
    }
    mvcp_dir_close(dir);
    emit clsResult(parent, result);
}
开发者ID:AresDice,项目名称:shotcut,代码行数:18,代码来源:mvcpthread.cpp

示例10: loadDocml

/*!
   Loads widgets and objects from the docml file. 
 */
void WlanLoginView::loadDocml()
{
    OstTraceFunctionEntry0( WLANLOGINVIEW_LOADDOCML_ENTRY );

    setObjectName(QString("wlanLoginView"));
    QObjectList objectList;
    objectList.append(this);
    mDocLoader->setObjectTree(objectList);

    bool ok = false;
    
    mDocLoader->load(wlanLoginViewDocml, &ok);
    Q_ASSERT(ok);
     
    //Fetch pointer for progress bar
    mProgressBar = reinterpret_cast<HbProgressBar *>(
        mDocLoader->findObject("progressBar"));
    Q_ASSERT(mProgressBar);
    
    //Fetch pointer for scroll area content
    mScrollAreaContent = reinterpret_cast<HbWidget *>(
        mDocLoader->findObject("scrollAreaContent"));
    Q_ASSERT(mScrollAreaContent);
    
    //Fetch pointer for Web View
    mWebView = reinterpret_cast<WlanLoginWebView *>(
        mDocLoader->findObject("webView"));
    Q_ASSERT(mWebView);
    
	//Fetch pointer for cancel action
    mCancelAction = qobject_cast<HbAction*> (
        mDocLoader->findObject("cancelAction"));
    Q_ASSERT(mCancelAction != NULL);
 
	//Fetch pointer for next action
    mNextAction = qobject_cast<HbAction*> (
        mDocLoader->findObject("nextAction"));
    Q_ASSERT(mNextAction != NULL);
    
    OstTraceFunctionExit0( WLANLOGINVIEW_LOADDOCML_EXIT );
}
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:44,代码来源:wlanloginview.cpp

示例11: initialize

/*
 * Description: initializing.
 */
void IRNowPlayingView::initialize()
{
    LOG_METHOD;
    setObjectName(NOW_PLAYING_VIEW_OBJECT_NAME);
    QObjectList roots;
    roots.append(this);
    iLoader.setObjectTree(roots);

    // Load XML file
    iLoader.load(NOW_PLAYING_VIEW_LAYOUT_FILENAME);
    
    initMenu();
    initToolBar();
    initWidget();    
#ifdef SUBTITLE_STR_BY_LOCID
    setTitle(hbTrId("txt_irad_title_internet_radio"));
#else
    setTitle("Internet radio");      
#endif
    handleOrientationChanged(getViewManager()->orientation());
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:24,代码来源:irnowplayingview.cpp

示例12: populateMap

/*!
    \internal
*/
void QDeclarativeGeoMap::populateMap()
{
    QObjectList kids = children();
    QList<QQuickItem *> quickKids = childItems();
    for (int i=0; i < quickKids.count(); ++i)
        kids.append(quickKids.at(i));

    for (int i = 0; i < kids.size(); ++i) {
        // dispatch items appropriately
        QDeclarativeGeoMapItemView *mapView = qobject_cast<QDeclarativeGeoMapItemView *>(kids.at(i));
        if (mapView) {
            m_mapViews.append(mapView);
            setupMapView(mapView);
            continue;
        }
        QDeclarativeGeoMapItemBase *mapItem = qobject_cast<QDeclarativeGeoMapItemBase *>(kids.at(i));
        if (mapItem) {
            addMapItem(mapItem);
        }
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:24,代码来源:qdeclarativegeomap.cpp

示例13: initViewContents

void IRTermsConsView::initViewContents()
{               
    setObjectName(TERMS_CONS_VIEW_BASE_OBJECT_VIEW);
    QObjectList roots;
    roots.append(this);
    iLoader.setObjectTree(roots);
    iLoader.load(TERMS_CONS_VIEW_LAYOUT_FILENAME);        
    
	// load correct orientation
    connect( getViewManager(), SIGNAL( orientationChanged(Qt::Orientation) ),
             this, SLOT( handleOrientationChanged(Qt::Orientation) ) );
	handleOrientationChanged(getViewManager()->orientation());
	        
    HbPushButton *acceptButton = qobject_cast<HbPushButton *>(iLoader.findObject(TERMS_CONS_VIEW_ACCEPT_BTN));
    HbPushButton *declineButton = qobject_cast<HbPushButton *>(iLoader.findObject(TERMS_CONS_VIEW_DECLINE_BTN));
    
    connect( acceptButton, SIGNAL(released()),
             iApplication, SLOT(handleTermsConsAccepted()) );    
    connect( declineButton, SIGNAL(released()),
             iApplication, SIGNAL(quit()) );      
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:21,代码来源:irtermsconsview.cpp

示例14: removeObjectFromList

static void removeObjectFromList(const QQmlProperty &property, QObject *objectToBeRemoved, QQmlEngine * engine)
{
    QQmlListReference listReference(property.object(), property.name().toUtf8(), engine);

    if (!QmlPrivateGate::hasFullImplementedListInterface(listReference)) {
        qWarning() << "Property list interface not fully implemented for Class " << property.property().typeName() << " in property " << property.name() << "!";
        return;
    }

    int count = listReference.count();

    QObjectList objectList;

    for (int i = 0; i < count; i ++) {
        QObject *listItem = listReference.at(i);
        if (listItem && listItem != objectToBeRemoved)
            objectList.append(listItem);
    }

    listReference.clear();

    foreach (QObject *object, objectList)
        listReference.append(object);
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:24,代码来源:objectnodeinstance.cpp

示例15: getList

 QObjectList Snippets::getList()
 {
   QObjectList result;
   foreach(GVA::ChromeSnippet *snippet, m_snippetMap) {
     result.append(snippet);
   }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:6,代码来源:Snippets.cpp


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