本文整理汇总了C++中QObjectList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ QObjectList::end方法的具体用法?C++ QObjectList::end怎么用?C++ QObjectList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QObjectList
的用法示例。
在下文中一共展示了QObjectList::end方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertMenu
void MenuItemMgr::insertMenu( QMenu* menu , QWidgetAction* item )
{
Q_ASSERT( menu!= NULL ) ;
QAction* action = NULL ;
QObjectList::iterator it ;
QActionGroup* pActionGroup = myMainWindow->getActionGroup() ;
Q_ASSERT( pActionGroup!= NULL ) ;
QObjectList menuitems = item->children() ;
for( it = menuitems.begin() ; it != menuitems.end() ; it++ )
{
QWidgetAction *wa = (QWidgetAction*)*it ;
if( wa->children().isEmpty() )
{
//action = menu->addAction( wa->icon() , wa->text() ) ;
menu->addAction(wa);
registerAction( wa ) ;
pActionGroup->addAction( wa ) ;
}
else
insertMenu( menu , wa ) ;
}
}
示例2: loadPlugins
void LteMainWindow::loadPlugins()
{
QObjectList objList = QPluginLoader::staticInstances();
for(QObjectList::iterator it = objList.begin(); it != objList.end(); ++it)
{
populateMenus(*it);
}
pluginsDir = QDir(qApp->applicationDirPath());
pluginsDir.cd("plugins");
QStringList fileList = pluginsDir.entryList(QDir::Files);
for(QStringList::iterator it = fileList.begin(); it != fileList.end(); ++it)
{
QPluginLoader loader(pluginsDir.absoluteFilePath(*it));
QObject *plugin = loader.instance();
if(plugin)
{
populateMenus(plugin);
pluginFileNames += *it;
}
}
lteMenu->setEnabled(!lteMenu->actions().isEmpty());
miscMenu->setEnabled(!miscMenu->actions().isEmpty());
}
示例3: updateRibbonMenu
bool MenuItemMgr::updateRibbonMenu( Qtitan::RibbonBar* ribonBar)
{
QObjectList::iterator it , git ;
Q_ASSERT( myMainWindow!= NULL ) ;
Q_ASSERT( myMenuItems!= NULL ) ;
QObjectList pages = myMenuItems->children() ;
for( it = pages.begin() ; it != pages.end() ; it++ )
{
QWidgetAction *wa = (QWidgetAction*)*it ;
if( wa != NULL )
{
Qtitan::RibbonPage* page = ribonBar->addPage( wa->text() );
if( page != NULL )
{
insertMenu( page , wa ) ;
}
}// if
}// for
connect( myMainWindow->getActionGroup() , SIGNAL( triggered( QAction* ) ), myMainWindow, SLOT( onMenuAction( QAction*) ) );
return true ;
}
示例4: quoteMeHelper
QString quoteMeHelper(const QObjectList &children)
{
QStringList res;
for (QObjectList::const_iterator it = children.begin(); it != children.end(); ++it) {
const AbstractPartWidget *w = dynamic_cast<const AbstractPartWidget *>(*it);
if (w)
res += w->quoteMe();
}
return res.join("\n");
}
示例5: dumpall
void dumpall( const QObjectList& olist )
{
for (QObjectList::ConstIterator it = olist.begin(); it != olist.end(); ++it)
{
qDebug( "---------------------------------------" );
qDebug( "Pointer: %p", *it );
(*it)->dumpObjectInfo();
dumpall( (*it)->children() );
}
}
示例6: closeDialogs
void closeDialogs(QWidget *w)
{
// close qmessagebox?
QList<QDialog*> dialogs;
QObjectList list = w->children();
for(QObjectList::Iterator it = list.begin() ; it != list.end(); ++it) {
if((*it)->inherits("QDialog"))
dialogs.append((QDialog *)(*it));
}
for(QList<QDialog*>::Iterator w = dialogs.begin(); w != dialogs.end(); ++w) {
(*w)->close();
}
}
示例7: nextCheckState
void ExpanderButton::nextCheckState()
{
_expanded = !_expanded;
setIcon(_expanded ? _expandedIcon : _contractedIcon);
QObjectList siblings = this->parentWidget()->children();
for (QObjectList::Iterator itr = siblings.begin(); itr != siblings.end(); itr++) {
QWidget* w = dynamic_cast<QWidget*>(*itr);
if (w != NULL && w != this)
w->setVisible(_expanded);
}
}
示例8: showForm
void MainWindow::showForm(Analysis *analysis)
{
closeCurrentOptionsWidget();
_currentOptionsWidget = loadForm(analysis);
if (_currentOptionsWidget != NULL)
{
//sizing of options widget and panel to fit buttons and conform to largest size for consistency
QObjectList siblings = _currentOptionsWidget->children();
for (QObjectList::Iterator itr = siblings.begin(); itr != siblings.end(); itr++) {
QWidget* w = dynamic_cast<QWidget*>(*itr);
if (w != NULL && w->objectName() == "topWidget") {
w->setContentsMargins(0, 0, _buttonPanel->width(), 0);
break;
}
}
int requiredSize = _currentOptionsWidget->sizeHint().width();
int currentOptionSpace = ui->panelMid->minimumWidth() - _scrollbarWidth;
if (requiredSize > currentOptionSpace) {
ui->panelMid->setMinimumWidth(requiredSize + _scrollbarWidth);
_buttonPanel->move(ui->panelMid->width() - _buttonPanel->width() - _scrollbarWidth, 0);
}
_currentOptionsWidget->setMinimumWidth(ui->panelMid->minimumWidth() - _scrollbarWidth);
//#########################
Options *options = analysis->options();
DataSet *dataSet = _package->dataSet;
_currentOptionsWidget->bindTo(options, dataSet);
connect(_currentOptionsWidget, SIGNAL(illegalChanged()), this, SLOT(illegalOptionStateChanged()));
illegalOptionStateChanged();
_currentOptionsWidget->show();
ui->optionsContentAreaLayout->addWidget(_currentOptionsWidget,0, 0, Qt::AlignRight | Qt::AlignTop);
if (ui->panelMid->isVisible() == false)
showOptionsPanel();
_runButton->setVisible(_currentAnalysis->isAutorun() == false);
_runButton->setEnabled(_currentAnalysis->status() == Analysis::InitedAndWaiting);
_buttonPanel->raise();
_buttonPanel->show();
QString helpPage = QString("analyses/") + tq(analysis->name()).toLower();
requestHelpPage(helpPage);
}
}
示例9: minimumSizeHint
QSize ExpanderButton::minimumSizeHint() const {
QSize sizeHint = QPushButton::minimumSizeHint();
int width = sizeHint.width();
QObjectList siblings = this->parentWidget()->children();
for (QObjectList::Iterator itr = siblings.begin(); itr != siblings.end(); itr++) {
QWidget* w = dynamic_cast<QWidget*>(*itr);
if (w != NULL && w != this && w->minimumSizeHint().width() > width)
width = w->minimumSizeHint().width();
}
sizeHint.setWidth(width);
return sizeHint;
}
示例10: take
bool Task::take(const QDomElement &x)
{
const QObjectList p = children();
// pass along the xml
Task *t;
for(QObjectList::ConstIterator it = p.begin(); it != p.end(); ++it) {
QObject *obj = *it;
if(!obj->inherits("XMPP::Task"))
continue;
t = static_cast<Task*>(obj);
if(t->take(x))
return true;
}
return false;
}
示例11: predLabel
IPCamSetting::IPCamSetting(QWidget *parent) :
QGroupBox(parent),
ui(new Ui::IPCamSetting)
{
ui->setupUi(this);
QObjectList objList = this->children();
QObjectList::iterator objIter = objList.begin(), objEnd = objList.end();
QObjectList::iterator lineEditIter = objList.begin();
IsInherit predLabel("QLabel"), predLineEdit("QLineEdit");
while ((objIter = std::find_if(objIter, objEnd, predLabel)) != objEnd) {
lineEditIter = std::find_if(lineEditIter, objEnd, predLineEdit);
if (lineEditIter != objEnd) {
m_mapLabelToLineEdit.insert(dynamic_cast<QLabel*>(*objIter)->text(),
dynamic_cast<QLineEdit*>(*lineEditIter));
++lineEditIter;
}
++objIter;
}
}
示例12: getWidgetBrothers
///
///Return a QStringList with the Widget's brothers names
///
QStringList * getWidgetBrothers(const QWidget * w)
{
//FIXME check if this method returns empty-name children
QStringList * brothers = new QStringList();
assert(w->parent());
QObjectList oblist = w->parent()->children();
QString objectName = getWidgetPath((QObject *)w);
QObjectList::iterator it;
for(it = oblist.begin();
it != oblist.end();
it++)
{
assert((QObject *)*it);
QString childName = getWidgetPath((QObject *)*it);
if ((childName!="") && (objectName != childName))
brothers->push_back(childName);
}
return brothers;
}
示例13: connectChilds_
void PTEDialog::connectChilds_(QObject* o)
{
QPushButton* w = dynamic_cast<QPushButton*>(o);
if (w != 0)
{
String s = ascii(w->text());
if (s.size() > 2) return;
Position an = PTE[s].getAtomicNumber();
w->setToolTip(atomProperties_(an));
connect(w, SIGNAL(released()), this, SLOT(elementClicked_()));
return;
}
// iterate over all buttons in the button group
QObjectList ol = o->children();
QObjectList::iterator it = ol.begin();
for (; it != ol.end(); it++)
{
connectChilds_(*it);
}
}