本文整理汇总了C++中QDictIterator::current方法的典型用法代码示例。如果您正苦于以下问题:C++ QDictIterator::current方法的具体用法?C++ QDictIterator::current怎么用?C++ QDictIterator::current使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDictIterator
的用法示例。
在下文中一共展示了QDictIterator::current方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qDebug
/** return the maximum resolution in the list of images */
float
GeoImageList::maxResolution()
{
if (!minMaxResUptodate_) {
minRes_ = -1;
maxRes_ = 500;
qDebug("GeoImageList::maxResolution");
QDictIterator < GeoImage > it = QDictIterator < GeoImage > (*this);
for (; it.current(); ++it) {
GeoImage *img = it.current();
qDebug("%s: xres: %f yres: %f",
(img->filename()).latin1(),
img->resolutionX(), img->resolutionY());
float res = it.current()->resolutionX();
if (res > minRes_)
minRes_ = res;
if (res < maxRes_)
maxRes_ = res;
res = it.current()->resolutionY();
if (res > minRes_)
minRes_ = res;
if (res < maxRes_)
maxRes_ = res;
}
minMaxResUptodate_ = true;
}
return maxRes_;
}
示例2: slotName
//=====================================
// slotName
//-------------------------------------
void SCCMonitorDualModel::slotName ( QListBoxItem* item ) {
//=====================================
// check manipulator access
//-------------------------------------
if (! mSaxDesktop ) {
return;
}
//=====================================
// include frequencies
//-------------------------------------
mCDBMonitorData = mSaxDesktop->getCDBMonitorData (
mVendorList->selectedItem()->text(),item->text()
);
mHSpinMin -> setValue ( 30 );
mHSpinMax -> setValue ( 50 );
mVSpinMin -> setValue ( 50 );
mVSpinMax -> setValue ( 60 );
QDictIterator<QString> it (mCDBMonitorData);
for (; it.current(); ++it) {
QString key = it.currentKey();
QString val = *it.current();
if (key == "VertRefresh") {
QStringList tokens = QStringList::split ( "-", val );
mVSpinMin -> setValue ( tokens.first().toInt() );
mVSpinMax -> setValue ( tokens.last().toInt() );
}
if (key == "HorizSync") {
QStringList tokens = QStringList::split ( "-", val );
mHSpinMin -> setValue ( tokens.first().toInt() );
mHSpinMax -> setValue ( tokens.last().toInt() );
}
}
}
示例3: validateLayout
//=====================================
// XKeyboard::Layout/Model check
//-------------------------------------
void XKeyboard::validateLayout ( void ) {
// log(L_INFO,"XKeyboard::validateLayout() called\n");
// ...
// this function check if the currently used combination
// of layout and model is valid according to the Keyboard.map
// if not we will provide a warning
// ---
QString XkbModel;
QString XkbLayout;
QDictIterator<char> itModel (mModelHash);
for (; itModel.current(); ++itModel) {
if (QString::fromLocal8Bit(itModel.current()) == mType->currentText()) {
XkbModel = itModel.currentKey();
}
}
// 2) primary XKB layout
QDictIterator<char> itLayout (mLayoutHash);
for (; itLayout.current(); ++itLayout) {
if (QString::fromLocal8Bit(itLayout.current()) == mLayout->currentText()) {
XkbLayout = itLayout.currentKey();
}
}
QString isValid = qx ( VALIDATELAYOUT,STDOUT,2,"%s %s",
XkbModel.ascii(),XkbLayout.ascii()
);
if (! isValid.toInt()) {
setMessage ("noValidLayout");
}
}
示例4: resetPage
//=====================================
// XAccessX reset and switch to Intro
//-------------------------------------
void XAccessX::resetPage (int reload) {
// ...
// this function is called if the xaccess dialog is finished or canceled
// AccessX is an X11 extension which need a seperate configuration file
// which is outside of the normal configuration create via ISaX. Therefore
// we don`t need to serialize any data here
// ---
if (reload == PAGE_RELOAD) {
if (mEnable -> isChecked()) {
QFile* mHandle = new QFile (
"/usr/X11R6/lib/X11/xkb/X0-config.keyboard"
);
if (! mHandle -> open(IO_WriteOnly)) {
log (L_ERROR,
"XAccessX::open failed on: %s -> %s\n",
mHandle->name().ascii(),strerror(errno)
);
}
QString* speed = new QString();
speed -> sprintf (
"%d",mLCD -> intValue()
);
QDict<char> data;
data.insert ("MouseKeysMaxSpeed=" ,
speed->ascii()
);
data.insert ("MouseKeysDelay=" , "40");
data.insert ("MouseKeysInterval=" , "10" );
data.insert ("MouseKeysTimeToMax=", "1000" );
data.insert ("MouseKeysCurve=" , "0" );
data.insert ("Controls+=","MouseKeysAccel");
#if 0
data.insert ("Controls+=",
"MouseKeysAccel + AccessxKeys"
);
data.insert ("Feedback+=",
"SlowKeysPress + SlowKeysAccept + StickyKeys + LatchToLock"
);
#endif
QDictIterator<char> it (data);
for (; it.current(); ++it) {
QString line;
line.sprintf ("%s %s\n",
it.currentKey().ascii(),it.current()
);
mHandle -> writeBlock (
line.ascii(),line.length()
);
}
mHandle -> close();
}
}
if (reload == PAGE_RELOAD) {
slotApply();
}
mStatus -> clear();
slotIntro (mIndex);
XTemplate::resetPage ();
mStack -> raiseWidget (Intro);
}
示例5: isValid
bool RKComponent::isValid () {
RK_TRACE (PLUGIN);
for (QDictIterator<RKComponentBase> it (child_map); it.current (); ++it) {
if (!(it.current ()->isSatisfied ())) return false;
}
return true;
}
示例6: splitImport
//====================================
// splitImport...
//------------------------------------
void SaXImportProfile::splitImport (void) {
// .../
//! Split the data from the profile into the appropriate
//! ISAX sections. If the section does not exist a new one
//! will be created. Each section can be obtained using the
//! getImport() method. For the profile to take effect it is
//! normally needed to merge this SaXImport objects into the
//! basic imports which are the base for the configuration
//! export: For example
//! \code
//! SaXImport* profile = this->getImport (SAX_CARD);
//! baseImport->merge (profile->getTablePointerDATA());
//! \endcode
// ----
for (int n=0;n < getCount();n++) {
QDict<QString>* table = getTablePointer ( n );
QDictIterator<QString> it (*table);
for (; it.current(); ++it) {
QStringList tokens = QStringList::split ( ":", *it.current() );
QString section = tokens.last();
tokens.pop_back();
QString value = tokens.join(":");
if (section == "Layout") {
if (! mLayout) {
mLayout = new SaXImport (SAX_LAYOUT);
}
mLayout -> addID (n);
mLayout -> setItem (it.currentKey(),value);
}
if (section == "Desktop") {
if (! mDesktop) {
mDesktop = new SaXImport (SAX_DESKTOP);
}
mDesktop -> addID (n);
mDesktop -> setItem (it.currentKey(),value);
}
if (section == "Card") {
if (! mCard) {
mCard = new SaXImport (SAX_CARD);
}
mCard -> addID (n);
mCard -> setItem (it.currentKey(),value);
}
if (section == "Mouse") {
if (! mPointers) {
mPointers = new SaXImport (SAX_POINTERS);
}
mPointers -> addID (n);
mPointers -> setItem (it.currentKey(),value);
}
}
}
}
示例7: updateVariants
//=====================================
// XKeyboard::update all variant lists
//-------------------------------------
void XKeyboard::updateVariants ( void ) {
// log(L_INFO,"XKeyboard::updateVariants() called\n");
// ...
// this function will update the variant lists for the
// primary variant combobox and the additional variant
// combobox. Currently set variants will be resetted
// after the list update
// ---
// 1) Additional Variants...
// ---
mAddVariant -> clear();
QListViewItem* item = mAddView -> selectedItem();
if (item) {
QStringList list = mRules.getVariants (item->text (2));
if (! list.empty()) {
mAddVariant -> insertStringList ( list );
} else {
mAddVariant -> insertItem ("basic");
}
mAddVariant->setCurrentText ("basic");
if ((item->text(3)) && (! item->text(3).isEmpty())) {
mAddVariant -> setCurrentText (item->text(3));
}
}
// 2) Primary Variant...
// ---
int curItem = mVariant -> currentItem();
QString curText = mVariant -> currentText();
mVariant -> clear();
QDictIterator<char> it (mRules.getLayouts());
bool emptyVariantList = true;
for (; it.current(); ++it) {
if (QString::fromLocal8Bit (it.current()) == mLayout->currentText()) {
QStringList list = mRules.getVariants (it.currentKey());
if (! list.empty()) {
mVariant -> insertStringList ( list );
emptyVariantList = false;
} else {
mVariant -> insertItem ("basic");
}
break;
}
}
mVariant->setCurrentText ("basic");
if (! emptyVariantList) {
if (mVariant->text (curItem) == curText) {
mVariant->setCurrentItem (curItem);
}
}
}
示例8: fetchPropertyValuesRecursive
void RKComponentBase::fetchPropertyValuesRecursive (QMap<QString, QString> *list, bool include_top_level, const QString &prefix) {
RK_TRACE (PLUGIN);
for (QDictIterator<RKComponentBase> it (child_map); it.current (); ++it) {
if (it.currentKey () != "#noid#") {
if (it.current ()->isProperty ()) {
if (include_top_level) {
list->insert (prefix + it.currentKey (), it.current ()->value ());
}
} else {
it.current ()->fetchPropertyValuesRecursive (list, true, prefix + it.currentKey () + '.');
}
}
}
}
示例9: removeFromParent
void RKComponent::removeFromParent () {
RK_TRACE (PLUGIN);
if (!parentComponent ()) return;
for (QDictIterator<RKComponentBase> it (parentComponent ()->child_map); it.current (); ++it) {
if (it.current () == this) {
QString key = it.currentKey ();
// unfortunately, several items might hvae the same key, and there seems to be no way to selectively remove the current item only.
// however, this function should only ever be called in cases of emergency and to prevent crashes. So we make extra sure to remove the child,
// even if we remove a little more than necessary along the way.
while (parentComponent ()->child_map.remove (key));
return;
}
}
RK_ASSERT (false);
}
示例10: merge
//====================================
// merge data into object...
//------------------------------------
void SaXStorage::merge (QList< QDict<QString> > data) {
// .../
//! merge the data records from the list (data) into
//! the corresponding data records of the object. If
//! a record does not exist it will be created
// ----
for (unsigned int n=0;n<data.count();n++) {
QDict<QString>* table = data.at(n);
QDictIterator<QString> it (*table);
if (! table) {
continue;
}
addID (n);
setID (n);
for (; it.current(); ++it) {
setItem (it.currentKey(),*it.current());
}
}
}
示例11: updateEnablednessRecursive
void RKComponent::updateEnablednessRecursive () {
RK_TRACE (PLUGIN);
bool enabled;
if (enabledness_property->boolValue ()) {
enabled = ((!parentComponent ()) || (parentComponent ()->isEnabled ()));
} else {
enabled = false;
}
setEnabled (enabled); /* We do this, even if the state *seems* to be unchanged. This is needed, as isEnabled () also returns false, if the parent QWidget is not enabled. However, the parent QWidget may not always be the parent component. */
if (enabled != isEnabled ()) {
for (QDictIterator<RKComponentBase> it (child_map); it.current (); ++it) {
if (it.current ()->isComponent()) {
static_cast<RKComponent*> (it.current ())->updateEnablednessRecursive ();
}
}
}
}
示例12: updateEnablednessRecursive
void RKComponent::updateEnablednessRecursive () {
RK_TRACE (PLUGIN);
bool enabled;
if (enabledness_property->boolValue ()) {
enabled = ((!parentComponent ()) || (parentComponent ()->isEnabled ()));
} else {
enabled = false;
}
if (enabled != isEnabled ()) {
setEnabled (enabled);
for (QDictIterator<RKComponentBase> it (child_map); it.current (); ++it) {
if (it.current ()->isComponent()) {
static_cast<RKComponent*> (it.current ())->updateEnablednessRecursive ();
}
}
}
}
示例13: SaXProcess
//====================================
// getPenData
//------------------------------------
QDict<QString> SaXManipulateTablets::getPenData ( const QString& group ) {
// .../
//! return the pen data dictionary associated with the
//! given CDB group name.
// ----
mCDBTabletData.clear();
if ( ! mCDBPens ) {
mCDBPens = new SaXProcess ();
mCDBPens -> start (CDB_PENS);
}
QDict< QDict<QString> > CDBData = mCDBPens -> getTablePointerCDB ();
QDictIterator< QDict<QString> > it (CDBData);
for (; it.current(); ++it) {
if ( it.currentKey() == group ) {
mCDBTabletData = *it.current();
break;
}
}
return mCDBTabletData;
}
示例14: SaXProcess
//====================================
// getCardDrivers
//------------------------------------
QList<QString> SaXManipulateCard::getCardDrivers ( void ) {
// .../
//! retrieve a list of X11 card driver names. The items
//! if the list can be used to retrieve the coresponding
//! option list using the getCardOptions() method
// ----
mCDBCardDrivers.clear();
if ( ! mCDBCardModules ) {
mCDBCardModules = new SaXProcess ();
mCDBCardModules -> start (CDB_CARDMODULES);
}
QDict< QDict<QString> > CDBModules = mCDBCardModules->getTablePointerCDB();
QDictIterator< QDict<QString> > it (CDBModules);
for (; it.current(); ++it) {
mCDBCardDrivers.append (new QString(it.currentKey()));
}
return mCDBCardDrivers;
}
示例15: slotTopOk
//=====================================
// XMouse slotTopOk...
//-------------------------------------
void XMouse::slotTopOk (void) {
// log (L_INFO,"XMouse::slotTopOk() called\n");
// ...
// this function is called if you click onto the OK
// button in the setup toplevel window
// ---
mFrame -> enterEvent ( 0 );
bool newMouse = false;
switch (mState) {
case MOUSE_NEW:
if (mouseList->count() > 0) {
mWorkingIndex = *mIndexList.at(mouseList->count()-1);
mWorkingIndex+= 2;
} else {
mWorkingIndex = 1;
}
newMouse = true;
break;
case MOUSE_SETUP:
mWorkingIndex = *mIndexList.at(mSelected);
newMouse = false;
break;
}
// ...
// create the text pointer wrapper object and
// get the mFiles pointer wrapper from the Intro
// object which has read all the data files
// ---
XWrapPointer< QDict<char> > mText (mTextPtr);
QDict<XFile>* mFilePtr = mIntro->getFiles();
XWrapFile < QDict<XFile> > mFiles (mFilePtr);
// ...
// get the workingMouse pointer wrapper. If a new mouse
// should be added use addDevice to create a new object
// otherwhise get the device according to the selection
// made in mouseList and clear the contents
// ---
XWrapPointer<XData> workingMouse;
if (newMouse) {
while (mFiles["sys_INPUT"]->getDevice (mWorkingIndex)) {
mWorkingIndex+= 2;
}
workingMouse.init (
mFiles["sys_INPUT"]->addDevice (mWorkingIndex)
);
} else {
workingMouse.init (
mFiles["sys_INPUT"]->getDevice (mWorkingIndex)
);
}
// ...
// set the selection data from the CDB if the user requested
// a new mouse from the list. The data set here may be overwritten
// from the manual setup made after the vendor/name selection
// ---
// check first if the selection differs from
// the current settings
// ---
bool changeRequest = false;
QString* mouseName = new QString();
mouseName -> sprintf ("%s;%s",
mVendor->currentText().ascii(),mName->currentText().ascii()
);
if (! newMouse) {
if (*mouseName != QString(workingMouse["Name"])) {
changeRequest = true;
}
} else {
changeRequest = true;
}
QDict<char>* spec = NULL;
XDb* pCDB = mFiles["cdb_POINTER"]->cdbGetSpec (
mVendor->currentText(),mName->currentText()
);
if ((pCDB) && (changeRequest)) {
spec = pCDB -> getHash();
// ...
// clear the working mouse contents...
// ---
workingMouse.clear();
// ...
// set base items for the mouse...
// ---
QString* ident = new QString;
ident -> sprintf ("Mouse[%d]",mWorkingIndex);
workingMouse.setPair ("InputFashion","Mouse");
workingMouse.setPair ("Identifier",ident->ascii());
workingMouse.setPair ("Name", mouseName->ascii());
// ...
// set CDB data information...
// ---
QDictIterator<char> it (*spec);
for (; it.current(); ++it) {
QString* key = new QString (it.currentKey());
//.........这里部分代码省略.........