本文整理汇总了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);
}
}
}
}
示例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;
}
示例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));
}
示例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 );
}
示例5: getRoutes
// -------------------------------------------------------------------------
QObjectList JsLayer::getRoutes()
{
QObjectList objList;
JsRoutePtrListIterator i(m_routes);
while( i.hasNext() )
{
objList.append( i.next().get()->getObject() );
}
return objList;
}
示例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);
}
示例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);
}
}
示例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;
}
示例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);
}
示例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 );
}
示例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());
}
示例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);
}
}
}
示例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()) );
}
示例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);
}
示例15: getList
QObjectList Snippets::getList()
{
QObjectList result;
foreach(GVA::ChromeSnippet *snippet, m_snippetMap) {
result.append(snippet);
}