本文整理汇总了C++中QPtrList::prev方法的典型用法代码示例。如果您正苦于以下问题:C++ QPtrList::prev方法的具体用法?C++ QPtrList::prev怎么用?C++ QPtrList::prev使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPtrList
的用法示例。
在下文中一共展示了QPtrList::prev方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createContents
/*
* Create contents from list created by FileHandler
*/
void Settings::createContents(QPtrList <QString> &list)
{
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.prev();
break;
}
else
{
set(*s, *(list.next()));
}
}
}
示例2: selectedItems
void
QueueList::moveSelectedDown() // SLOT
{
QPtrList<QListViewItem> list = selectedItems();
for( QListViewItem *item = list.last(); item; item = list.prev() )
{
QListViewItem *after = item->nextSibling();
if( !after )
continue;
moveItem( item, 0, after );
}
ensureItemVisible( list.last() );
}
示例3: createJoystickContents
//
// Create joystick plugin contents... now what the heck is this
// doing here???
//
void App::createJoystickContents(QPtrList <QString> &list)
{
QString name;
QString fdName;
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.prev();
break;
}
else if (*s == QString("FDName"))
{
fdName = *(list.next());
}
else if (*s == QString("Name"))
{
name = *(list.next());
}
}
}
示例4: temp_stack_prev
void QtCalculator::temp_stack_prev(){
CALCAMNT *number;
if( temp_stack.current() == temp_stack.getFirst()){
KNotifyClient::beep();
return;
}
number = temp_stack.prev();
if(number == NULL){
KNotifyClient::beep();
return;
}
else{
// printf("Number: %Lg\n",*number);
last_input = RECALL;
DISPLAY_AMOUNT = *number;
UpdateDisplay();
}
}
示例5: createContents
void VCFrame::createContents(QPtrList <QString> &list)
{
QRect rect(30, 30, 30, 30);
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.prev();
break;
}
else if (*s == QString("ID"))
{
setID(list.next()->toInt());
}
else if (*s == QString("ButtonBehaviour"))
{
setButtonBehaviour(static_cast<ButtonBehaviour>
(list.next()->toInt()));
}
else if (*s == QString("Parent"))
{
if (m_bottomFrame == false)
{
VCFrame* parent =
_app->virtualConsole()->getFrame(list.next()->toInt());
if (parent != NULL)
{
reparent((QWidget*) parent, 0, QPoint(0, 0), true);
}
}
else
{
list.next();
}
}
else if (*s == QString("Textcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteForegroundColor(qc);
}
else if (*s == QString("Backgroundcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Color"))
{
// Backwards compatibility for frame background color
QString t = *(list.next());
int i = t.find(QString(","));
int r = t.left(i).toInt();
int j = t.find(QString(","), i + 1);
int g = t.mid(i+1, j-i-1).toInt();
int b = t.mid(j+1).toInt();
QColor qc(r, g, b);
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Pixmap"))
{
QString t;
t = *(list.next());
QPixmap pm(t);
if (pm.isNull() == false)
{
setIconText(t);
setPaletteBackgroundPixmap(pm);
}
}
else if (*s == QString("Font"))
{
QFont f = font();
QString q = *(list.next());
f.fromString(q);
setFont(f);
}
else if (*s == QString("X"))
{
rect.setX(list.next()->toInt());
}
else if (*s == QString("Y"))
{
rect.setY(list.next()->toInt());
}
else if (*s == QString("Width"))
{
rect.setWidth(list.next()->toInt());
}
else if (*s == QString("Height"))
{
rect.setHeight(list.next()->toInt());
}
else
{
// Unknown keyword, ignore
*list.next();
//.........这里部分代码省略.........
示例6: createContents
//
// Create this slider's contents from list
//
void VCDockSlider::createContents(QPtrList <QString> &list)
{
QRect rect(0, 0, 60, 200);
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.prev();
break;
}
else if (*s == QString("Name"))
{
setCaption(*(list.next()));
}
else if (*s == QString("Parent"))
{
VCFrame* parent =
_app->virtualConsole()->getFrame(list.next()->toInt());
if (parent != NULL)
{
reparent((QFrame*)parent, 0, QPoint(0, 0), true);
}
}
else if (*s == QString("X"))
{
rect.setX(list.next()->toInt());
}
else if (*s == QString("Y"))
{
rect.setY(list.next()->toInt());
}
else if (*s == QString("Width"))
{
rect.setWidth(list.next()->toInt());
}
else if (*s == QString("Height"))
{
rect.setHeight(list.next()->toInt());
}
else if (*s == QString("Textcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteForegroundColor(qc);
}
else if (*s == QString("Backgroundcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Color"))
{
// Backwards compatibility for slider background color
QString t = *(list.next());
int i = t.find(QString(","));
int r = t.left(i).toInt();
int j = t.find(QString(","), i + 1);
int g = t.mid(i+1, j-i-1).toInt();
int b = t.mid(j+1).toInt();
QColor qc(r, g, b);
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Pixmap"))
{
QString t;
t = *(list.next());
QPixmap pm(t);
if (pm.isNull() == false)
{
setIconText(t);
unsetPalette();
setPaletteBackgroundPixmap(pm);
m_valueLabel->setBackgroundOrigin(ParentOrigin);
m_slider->setBackgroundOrigin(ParentOrigin);
}
}
else if (*s == QString("Frame"))
{
if (*(list.next()) == Settings::trueValue())
{
setFrameStyle(KFrameStyle);
}
else
{
setFrameStyle(NoFrame);
}
}
else if (*s == QString("Font"))
{
QFont f = font();
QString q = *(list.next());
f.fromString(q);
setFont(f);
//.........这里部分代码省略.........
示例7: createContents
void VirtualConsole::createContents(QPtrList <QString> &list)
{
QString t;
VCFrame::ResetID();
if (m_drawArea != NULL)
{
delete m_drawArea;
m_drawArea = NULL;
}
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.next();
if (*s == QString("Virtual Console"))
{
createVirtualConsole(list);
}
else if (*s == QString("Frame"))
{
list.prev();
createWidget(list);
}
else if (*s == QString("Button"))
{
list.prev();
createWidget(list);
}
else if (*s == QString("Label"))
{
list.prev();
createWidget(list);
}
else if (*s == QString("Slider"))
{
list.prev();
createWidget(list);
}
else
{
// Unknown keyword, skip
list.next();
}
}
else
{
list.next();
}
}
// Virtual console sometimes loses its parent (or vice versa)
// when loading a new document... try to handle it with this.
reparent((QWidget*) _app->workspace(), 0, pos(), isVisible());
// Check if VC should be open
QString config;
_app->settings()->get(KEY_VIRTUAL_CONSOLE_OPEN, config);
if (config == Settings::trueValue())
{
_app->slotViewVirtualConsole();
}
else
{
hide();
_app->slotVirtualConsoleClosed();
}
}
示例8: createContents
void VCButton::createContents(QPtrList <QString> &list)
{
QRect rect(30, 30, 30, 30);
for (QString* s = list.next(); s != NULL; s = list.next())
{
if (*s == QString("Entry"))
{
s = list.prev();
break;
}
else if (*s == QString("Name"))
{
setCaption(*(list.next()));
}
else if (*s == QString("Parent"))
{
VCFrame* parent =
_app->virtualConsole()->getFrame(list.next()->toInt());
if (parent != NULL)
{
reparent((QWidget*)parent, 0, QPoint(0, 0), true);
}
// each Button should set
if (parent->buttonBehaviour() == VCFrame::Exclusive)
{
setExclusive(true);
}
else
{
setExclusive(false);
}
}
else if (*s == QString("X"))
{
rect.setX(list.next()->toInt());
}
else if (*s == QString("Y"))
{
rect.setY(list.next()->toInt());
}
else if (*s == QString("Width"))
{
rect.setWidth(list.next()->toInt());
}
else if (*s == QString("Height"))
{
rect.setHeight(list.next()->toInt());
}
else if (*s == QString("Textcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteForegroundColor(qc);
}
else if (*s == QString("Backgroundcolor"))
{
QColor qc;
qc.setRgb(list.next()->toUInt());
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Color"))
{
// Backwards compatibility for button background color
QString t = *(list.next());
int i = t.find(QString(","));
int r = t.left(i).toInt();
int j = t.find(QString(","), i + 1);
int g = t.mid(i+1, j-i-1).toInt();
int b = t.mid(j+1).toInt();
QColor qc(r, g, b);
setPaletteBackgroundColor(qc);
}
else if (*s == QString("Pixmap"))
{
QString t;
t = *(list.next());
QPixmap pm(t);
if (pm.isNull() == false)
{
setIconText(t);
setPaletteBackgroundPixmap(pm);
}
}
else if (*s == QString("Font"))
{
QFont f = font();
QString q = *(list.next());
f.fromString(q);
setFont(f);
}
else if (*s == QString("Function"))
{
attachFunction(list.next()->toInt());
}
else if (*s == QString("BindKey"))
{
assert(m_keyBind);
//.........这里部分代码省略.........
示例9: replaceVariable
void VariablesListView::replaceVariable(DebuggerVariable* oldvar, DebuggerVariable* newvar)
{
KListViewItem * item;
// Remove children that doesen't exist anymore
QPtrList<DebuggerVariable> oldlist = oldvar->values();
for(DebuggerVariable* oldchild = oldlist.last(); oldchild; oldchild = oldlist.prev())
{
bool found = false;
QPtrList<DebuggerVariable> newlist = newvar->values();
for(DebuggerVariable* newchild = newlist.last(); newchild; newchild = newlist.prev())
{
if(newchild->name() == oldchild->name())
{
found = true;
break;
}
}
if(!found)
oldvar->deleteChild(oldchild);
}
// Update and add children
QPtrList<DebuggerVariable> newlist = newvar->values();
for(DebuggerVariable* newchild = newlist.last(); newchild; newchild = newlist.prev())
{
bool found = false;
QPtrList<DebuggerVariable> oldlist = oldvar->values();
for(DebuggerVariable* oldchild = oldlist.last(); oldchild; oldchild = oldlist.prev())
{
if(newchild->name() == oldchild->name())
{
found = true;
replaceVariable( oldchild, newchild);
break;
}
}
if(!found)
{
DebuggerVariable* child = new DebuggerVariable();
item = new KListViewItem(oldvar->item());
child->setItem(item);
replaceVariable( child, newchild);
oldvar->append(child);
}
}
item = oldvar->item();
if(oldvar->value() != newvar->value())
item->setPixmap(VariablesListViewColumns::Status, SmallIcon("ok"));
else
item->setPixmap(VariablesListViewColumns::Status, KPixmap());
oldvar->copy(newvar, false);
item->setText(VariablesListViewColumns::Name, oldvar->name());
item->setText(VariablesListViewColumns::Type, oldvar->typeName());
item->setText(VariablesListViewColumns::Size, oldvar->sizeName());
item->setText(VariablesListViewColumns::Value, (newvar->isScalar() ? oldvar->value() : QString()));
}