void K3bDataFileView::checkForNewItems() { hideEditor(); // add items that are not there yet for( QPtrListIterator<K3bDataItem> it( m_currentDir->children() ); it.current(); ++it ) { if( !m_itemMap.contains( it.current() ) ) { slotItemAdded( it.current() ); } } // now check if some of the items have been moved out of the currently showing dir. for( QListViewItemIterator it( this ); it.current(); ++it ) { K3bDataViewItem* dataViewItem = dynamic_cast<K3bDataViewItem*>( it.current() ); if( dataViewItem && dataViewItem->dataItem()->parent() != currentDir() ) delete dataViewItem; } }
LinearProgressWidget::LinearProgressWidget(WizardProgress *progress, QWidget *parent) : QWidget(parent), m_dotsItemWidget(0), m_disableUpdatesCount(0) { m_indicatorPixmap = QIcon::fromTheme(QLatin1String("go-next"), QIcon(QLatin1String(":/utils/images/arrow.png"))).pixmap(16); m_wizardProgress = progress; m_mainLayout = new QVBoxLayout(this); m_itemWidgetLayout = new QVBoxLayout(); QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Ignored, QSizePolicy::Expanding); m_mainLayout->addLayout(m_itemWidgetLayout); m_mainLayout->addSpacerItem(spacer); m_dotsItemWidget = new ProgressItemWidget(m_indicatorPixmap, tr("..."), this); m_dotsItemWidget->setVisible(false); m_dotsItemWidget->setEnabled(false); connect(m_wizardProgress, SIGNAL(itemAdded(WizardProgressItem*)), this, SLOT(slotItemAdded(WizardProgressItem*))); connect(m_wizardProgress, SIGNAL(itemRemoved(WizardProgressItem*)), this, SLOT(slotItemRemoved(WizardProgressItem*))); connect(m_wizardProgress, SIGNAL(itemChanged(WizardProgressItem*)), this, SLOT(slotItemChanged(WizardProgressItem*))); connect(m_wizardProgress, SIGNAL(nextItemsChanged(WizardProgressItem*,QList<WizardProgressItem*>)), this, SLOT(slotNextItemsChanged(WizardProgressItem*,QList<WizardProgressItem*>))); connect(m_wizardProgress, SIGNAL(nextShownItemChanged(WizardProgressItem*,WizardProgressItem*)), this, SLOT(slotNextShownItemChanged(WizardProgressItem*,WizardProgressItem*))); connect(m_wizardProgress, SIGNAL(startItemChanged(WizardProgressItem*)), this, SLOT(slotStartItemChanged(WizardProgressItem*))); connect(m_wizardProgress, SIGNAL(currentItemChanged(WizardProgressItem*)), this, SLOT(slotCurrentItemChanged(WizardProgressItem*))); QList<WizardProgressItem *> items = m_wizardProgress->items(); for (int i = 0; i < items.count(); i++) slotItemAdded(items.at(i)); recreateLayout(); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); }
CFrmUserList::CFrmUserList(QWidget *parent) : QFrame(parent), m_UserList(this), ui(new Ui::CFrmUserList) { ui->setupUi(this); InitMenu(); m_pModel = new QStandardItemModel(this); if(m_pModel) { //增加头,只有增加了这个后,下面才会显示内容 m_pModel->setHorizontalHeaderLabels(QStringList() << tr("User name or group")<< tr("Information")); } m_UserList.setModel(m_pModel); m_UserList.show(); InsertGroup(tr("My friends")); bool check = connect(&m_UserList, SIGNAL(clicked(QModelIndex)), SLOT(clicked(QModelIndex))); Q_ASSERT(check); check = connect(&m_UserList, SIGNAL(doubleClicked(QModelIndex)), SLOT(doubleClicked(QModelIndex))); Q_ASSERT(check); check = connect(&m_UserList, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotCustomContextMenuRequested(QPoint))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigMenuInitOperator(QMenu*)), SLOT(slotAddToMainMenu(QMenu*))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigRefresh()), SLOT(slotRefresh())); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetMainWindow(), SIGNAL(sigMenuRemoveOperator(QMenu*)), SLOT(slotDeleteFromMainMenu(QMenu*))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetXmppClient(), SIGNAL(presenceReceived(const QXmppPresence)), SLOT(slotChangedPresence(QXmppPresence))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->rosterManager(), SIGNAL(rosterReceived()), SLOT(slotRosterReceived())); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->rosterManager(), SIGNAL(subscriptionReceived(QString)), SLOT(slotSubscriptionReceived(QString))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->rosterManager(), SIGNAL(itemAdded(QString)), SLOT(slotItemAdded(QString))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->rosterManager(), SIGNAL(itemChanged(QString)), SLOT(slotItemChanged(QString))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->rosterManager(), SIGNAL(itemRemoved(QString)), SLOT(slotItemRemoved(QString))); Q_ASSERT(check); check = connect(&CGlobal::Instance()->GetXmppClient()->vCardManager(), SIGNAL(vCardReceived(QXmppVCardIq)), SLOT(slotvCardReceived(QXmppVCardIq))); Q_ASSERT(check); check = connect(CGlobal::Instance()->GetXmppClient(), SIGNAL(messageReceived(QXmppMessage)), SLOT(slotClientMessageReceived(QXmppMessage))); Q_ASSERT(check); }