本文整理汇总了C++中Q3ValueList类的典型用法代码示例。如果您正苦于以下问题:C++ Q3ValueList类的具体用法?C++ Q3ValueList怎么用?C++ Q3ValueList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Q3ValueList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: params
void UmlOperation::write_uml_params(FileOut & out)
{
const Q3ValueList<UmlParameter> p = params();
Q3ValueList<UmlParameter>::ConstIterator it;
for (it = p.begin(); it != p.end(); ++it) {
out.indent();
out << "<ownedParameter xmi:type=\"uml:Parameter\" name=\"" << (*it).name
<< "\" xmi:id=\"BOUML_op_param_"
<< ++param_id << "\" direction=\"";
if (_pk_prefix)
out << "pk_";
switch ((*it).dir) {
case InputOutputDirection:
out << "inout\">\n";
break;
case OutputDirection:
out << "out\">\n";
break;
default:
out << "in\">\n";
}
out.indent(+1);
UmlItem::write_type(out, (*it).type);
out.indent(-1);
out.indent();
out << "</ownedParameter>\n";
}
}
示例2: checkNeighbourLiberty
void StoneHandler::checkNeighbourLiberty(int x, int y, Q3ValueList<int> &libCounted, int &liberties, Matrix *m) //SL added eb 8
{
if (!x || !y)
return;
Stone *s;
// CHECK_PTR(m); // SL added eb 8
if (m==NULL) //added eb 8 -> we don't have a matrix passed here, so we check on the board
{
if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
!libCounted.contains(100*x + y) &&
((s = stones->find(Matrix::coordsToKey(x, y))) == NULL ||
!s->isVisible()))
{
libCounted.append(100*x + y);
liberties ++;
}
}
else
{
if (x <= boardHandler->board->getBoardSize() && y <= boardHandler->board->getBoardSize() && x >= 0 && y >= 0 &&
!libCounted.contains(100*x + y) &&
(m->at(x - 1, y - 1) == stoneNone )) // ?? check stoneErase ?
{
libCounted.append(100*x + y);
liberties ++;
} // end add eb 8
}
}
示例3: get_template_prefixes
void UmlClass::get_template_prefixes(Q3CString & template1,
Q3CString & template2) {
Q3ValueList<UmlFormalParameter> formals = this->formals();
if (!formals.isEmpty()) {
Q3ValueList<UmlFormalParameter>::ConstIterator it;
const char * sep1 = "template<";
const char * sep2 = "<";
for (it = formals.begin(); it != formals.end(); ++it) {
const UmlFormalParameter & f = *it;
template1 += sep1;
template1 += f.type();
template1 += " ";
template1 += f.name();
template2 += sep2;
template2 += f.name();
sep1 = sep2 = ", ";
}
template1 += ">\n";
template2 += ">";
}
}
示例4: slotUploadButton
void WSWindow::slotUploadButton()
{
KIPI::ImageCollection ic;
if (widget->addToAlbum->isChecked())
{
ic = interface->currentSelection();
service->startUpload(ic, widget->album->currentItem());
}
if (widget->uploadAlbums->isChecked())
{
ic = interface->currentAlbum();
Q3ValueList<KIPI::ImageCollection> toUpload;
toUpload.append(ic);
service->startUpload(toUpload);
}
if (widget->uploadAllAlbums->isChecked())
service->startUpload(interface->allAlbums());
}
示例5: MsgView
void UserWnd::modeChanged()
{
if (CorePlugin::m_plugin->getContainerMode()){
if (m_view == NULL)
m_view = new MsgView(m_splitter, m_id);
m_splitter->moveToFirst(m_view);
m_splitter->setResizeMode(m_edit, QSplitter::KeepSize);
m_view->show();
int editHeight = getEditHeight();
if (editHeight == 0)
editHeight = CorePlugin::m_plugin->getEditHeight();
if (editHeight){
Q3ValueList<int> s;
s.append(1);
s.append(editHeight);
m_bResize = true;
m_splitter->setSizes(s);
m_bResize = false;
}
}else{
if (m_view){
delete m_view;
m_view = NULL;
}
}
}
示例6: formals
void UmlClass::generate_formals(QTextOStream & f) {
Q3ValueList<UmlFormalParameter> fs = formals();
if (! fs.isEmpty()) {
Q3ValueList<UmlFormalParameter>::Iterator it;
const char * sep = "<";
for (it = fs.begin(); it != fs.end(); it++) {
UmlFormalParameter & p = *it;
f << sep;
sep = ", ";
f << p.name();
const UmlTypeSpec & t = p.extend();
if (t.type != 0) {
f << " extends ";
t.type->write(f);
}
else if (! t.explicit_type.isEmpty())
f << " extends " << JavaSettings::type(t.explicit_type);
}
f << ">";
}
}
示例7: getElementId
/*!
* Delets current element or group (with subgroups).
* \param item (in) - deleted element or group item.
*/
void CatalogForm::del_item( Q3ListViewItem * item )
{
// cat->groupSelect(getGroupId(item));
qulonglong id = getElementId(item);
if(id)
{
cat->select(id);
if(cat->First())
{
cat->delElement();
map_el.remove(id);
delete item;
item = 0;
}
}
else
{
id = getGroupId(item);
if(id)
{
Q3ValueList<qulonglong> listDeletedId;
cat->delGroup(id, listDeletedId);
Q3ValueList<qulonglong>::iterator it = listDeletedId.begin();
while(it!= listDeletedId.end())
{
if(map_el.contains(*it)) map_el.remove(*it);
else if(map_gr.contains(*it)) map_gr.remove(*it);
++it;
}
delete item; // destructor delete all subitems
item = 0;
}
}
}
示例8: QVERIFY
void tst_Q3ValueList::append()
{
Q3ValueList<int> list;
Q3ValueList<int>::Iterator it = list.append(1);
QVERIFY(*it == 1);
it = list.append(2);
QVERIFY(*it == 2);
}
示例9: switch
void UmlRelation::generate_implements(const char *& sep, QTextOStream & f,
const Q3ValueList<UmlActualParameter> & actuals,
const Q3CString & cl_stereotype) {
switch (relationKind()) {
default:
return;
case aGeneralisation:
case aRealization:
if (javaDecl().isEmpty())
return;
UmlClass * role_type = roleType();
const Q3CString & other_stereotype = role_type->java_stereotype();
if ((other_stereotype == "interface") || (other_stereotype == "@interface")) {
if ((cl_stereotype == "union") || (cl_stereotype == "enum_pattern")) {
write_trace_header();
UmlCom::trace(Q3CString(" <font color=\"red\"><b>an <i>")
+ cl_stereotype + "</i> cannot inherits</b></font><br>");
incr_warning();
}
else {
f << sep;
sep = ", ";
const char * p = javaDecl();
while (*p) {
if (!strncmp(p, "${type}", 7)) {
role_type->write(f);
p += 7;
if (!actuals.isEmpty()) {
Q3ValueList<UmlActualParameter>::ConstIterator ita;
bool used = FALSE;
for (ita = actuals.begin(); ita != actuals.end(); ++ita) {
if ((*ita).superClass() == role_type) {
used = TRUE;
(*ita).generate(f);
}
}
if (used) {
f << ">";
}
}
}
else if (*p == '@')
manage_alias(p, f);
else
f << *p++;
}
}
}
}
}
示例10: QCOMPARE
void tst_Q3ValueList::opStreamOut()
{
Q3ValueList<int> a;
a.append( 1 );
a.append( 10 );
a.append( 100 );
a << 1000 << 10000;
QCOMPARE( a.last(), 10000 );
}
示例11: s
Q3ValueList<KBookmark> K3BookmarkDrag::decode( const QMimeSource * e )
{
Q3ValueList<KBookmark> bookmarks;
if ( e->provides("application/x-xbel") )
{
QByteArray s( e->encodedData("application/x-xbel") );
//kDebug(7043) << "K3BookmarkDrag::decode s=" << QCString(s);
QDomDocument doc;
doc.setContent( s );
QDomElement elem = doc.documentElement();
QDomNodeList children = elem.childNodes();
for ( int childno = 0; childno < children.count(); childno++)
{
bookmarks.append( KBookmark( children.item(childno).cloneNode(true).toElement() ));
}
return bookmarks;
}
if ( e->provides("text/uri-list") )
{
KUrl::List m_lstDragURLs;
//kDebug(7043) << "K3BookmarkDrag::decode uri-list";
if ( K3URLDrag::decode( e, m_lstDragURLs ) )
{
KUrl::List::ConstIterator uit = m_lstDragURLs.constBegin();
KUrl::List::ConstIterator uEnd = m_lstDragURLs.constEnd();
for ( ; uit != uEnd ; ++uit )
{
//kDebug(7043) << "K3BookmarkDrag::decode url=" << (*uit).url();
bookmarks.append( KBookmark::standaloneBookmark(
(*uit).prettyUrl(), (*uit) ));
}
return bookmarks;
}
}
if( e->provides("text/plain") )
{
//kDebug(7043) << "K3BookmarkDrag::decode text/plain";
QString s;
if(Q3TextDrag::decode( e, s ))
{
QStringList listDragURLs = s.split(QChar('\n'), QString::SkipEmptyParts);
QStringList::ConstIterator it = listDragURLs.constBegin();
QStringList::ConstIterator end = listDragURLs.constEnd();
for( ; it!=end; ++it)
{
//kDebug(7043)<<"K3BookmarkDrag::decode string"<<(*it);
bookmarks.append( KBookmark::standaloneBookmark( KUrl(*it).prettyUrl(), KUrl(*it)));
}
return bookmarks;
}
}
bookmarks.append( KBookmark() );
return bookmarks;
}
示例12: itp
void UmlItem::write_stereotyped(FileOut & out)
{
QMap<QString, Q3PtrList<UmlItem> >::Iterator it;
for (it = _stereotypes.begin(); it != _stereotypes.end(); ++it) {
const char * st = it.key();
UmlClass * cl = UmlClass::findStereotype(it.key(), TRUE);
if (cl != 0) {
Q3ValueList<WrapperStr> extended;
cl->get_extended(extended);
Q3PtrList<UmlItem> & l = it.data();
UmlItem * elt;
for (elt = l.first(); elt != 0; elt = l.next()) {
out << "\t<" << st;
out.id_prefix(elt, "STELT_");
const Q3Dict<WrapperStr> props = elt->properties();
Q3DictIterator<WrapperStr> itp(props);
while (itp.current()) {
QString k = itp.currentKey();
if (k.contains(':') == 2) {
out << " ";
out.quote((const char *)k.mid(k.findRev(':') + 1)); //[jasa] ambiguous call
out << "=\"";
out.quote((const char *)*itp.current());
out << '"';
}
++itp;
}
Q3ValueList<WrapperStr>::Iterator iter_extended;
for (iter_extended = extended.begin();
iter_extended != extended.end();
++iter_extended) {
WrapperStr vr = "base_" + *iter_extended;
out.ref(elt, vr);
}
out << "/>\n";
elt->unload();
}
}
}
}
示例13: Q3VBox
void ParameterSetDialog::init_pins_tab()
{
bool visit = !hasOkButton();
Q3HBox * hbox;
QPushButton * button;
Q3VBox * vbox = new Q3VBox(this);
Q3VBox * page = vbox;
const Q3ValueList<BrowserPin *> & inpins = data->pins;
Q3ValueList<BrowserPin *>::ConstIterator it;
if (!visit) {
hbox = new Q3HBox(vbox);
vbox = new Q3VBox(hbox);
vbox->setMargin(5);
(new QLabel(TR("Parameters out of Parameter Set"), vbox))->setAlignment(Qt::AlignCenter);
lb_available = new Q3ListBox(vbox);
lb_available->setSelectionMode(Q3ListBox::Multi);
BrowserParameterSet * bn =
(BrowserParameterSet *) data->get_browser_node();
Q3ValueList<BrowserPin *> allpins =
((BrowserActivityAction *) bn->parent())->get_pins();
for (it = allpins.begin(); it != allpins.end(); it++)
if (inpins.find(*it) == inpins.end())
lb_available->insertItem(new ListBoxBrowserNode(*it, (*it)->full_name(TRUE)));
lb_available->sort();
vbox = new Q3VBox(hbox);
vbox->setMargin(5);
(new QLabel("", vbox))->setScaledContents(TRUE);
button = new QPushButton(vbox);
button->setPixmap(*rightPixmap);
connect(button, SIGNAL(clicked()), this, SLOT(associate_cls()));
(new QLabel("", vbox))->setScaledContents(TRUE);
button = new QPushButton(vbox);
button->setPixmap(*leftPixmap);
connect(button, SIGNAL(clicked()), this, SLOT(unassociate_cls()));
(new QLabel("", vbox))->setScaledContents(TRUE);
vbox = new Q3VBox(hbox);
}
vbox->setMargin(5);
(new QLabel(TR("Parameters in Parameter Set"), vbox))->setAlignment(Qt::AlignCenter);
lb_member = new Q3ListBox(vbox);
lb_member->setSelectionMode((visit) ? Q3ListBox::NoSelection
: Q3ListBox::Multi);
for (it = inpins.begin(); it != inpins.end(); ++it)
lb_member->insertItem(new ListBoxBrowserNode(*it, (*it)->full_name(TRUE)));
addTab(page, TR("Parameters"));
}
示例14: relationsValue
void UmlBaseClassInstance::relationsValue(Q3ValueList<SlotRelation> & result) {
UmlCom::send_cmd(_identifier, relationsCmd, (void *) 0);
unsigned n = UmlCom::read_unsigned();
result.clear();
while (n--) {
UmlRelation * r = (UmlRelation *) UmlBaseItem::read_();
result.append(SlotRelation(r, (UmlClassInstance *) UmlBaseItem::read_()));
}
}
示例15: saveTagsTo
void Tag::saveTagsTo(Q3ValueList<Tag*> &list, const QString &fullPath)
{
// Create Document:
QDomDocument document(/*doctype=*/"basketTags");
QDomElement root = document.createElement("basketTags");
root.setAttribute("nextStateUid", static_cast<long long int>(nextStateUid) );
document.appendChild(root);
// Save all tags:
for (List::iterator it = list.begin(); it != list.end(); ++it) {
Tag *tag = *it;
// Create tag node:
QDomElement tagNode = document.createElement("tag");
root.appendChild(tagNode);
// Save tag properties:
XMLWork::addElement( document, tagNode, "name", tag->name() );
XMLWork::addElement( document, tagNode, "shortcut", tag->shortcut().primary().toString());
XMLWork::addElement( document, tagNode, "inherited", XMLWork::trueOrFalse(tag->inheritedBySiblings()) );
// Save all states:
for (State::List::iterator it2 = (*it)->states().begin(); it2 != (*it)->states().end(); ++it2) {
State *state = *it2;
// Create state node:
QDomElement stateNode = document.createElement("state");
tagNode.appendChild(stateNode);
// Save state properties:
stateNode.setAttribute("id", state->id());
XMLWork::addElement( document, stateNode, "name", state->name() );
XMLWork::addElement( document, stateNode, "emblem", state->emblem() );
QDomElement textNode = document.createElement("text");
stateNode.appendChild(textNode);
QString textColor = (state->textColor().isValid() ? state->textColor().name() : "");
textNode.setAttribute( "bold", XMLWork::trueOrFalse(state->bold()) );
textNode.setAttribute( "italic", XMLWork::trueOrFalse(state->italic()) );
textNode.setAttribute( "underline", XMLWork::trueOrFalse(state->underline()) );
textNode.setAttribute( "strikeOut", XMLWork::trueOrFalse(state->strikeOut()) );
textNode.setAttribute( "color", textColor );
QDomElement fontNode = document.createElement("font");
stateNode.appendChild(fontNode);
fontNode.setAttribute( "name", state->fontName() );
fontNode.setAttribute( "size", state->fontSize() );
QString backgroundColor = (state->backgroundColor().isValid() ? state->backgroundColor().name() : "");
XMLWork::addElement( document, stateNode, "backgroundColor", backgroundColor );
QDomElement textEquivalentNode = document.createElement("textEquivalent");
stateNode.appendChild(textEquivalentNode);
textEquivalentNode.setAttribute( "string", state->textEquivalent() );
textEquivalentNode.setAttribute( "onAllTextLines", XMLWork::trueOrFalse(state->onAllTextLines()) );
}
}
// Write to Disk:
if (!Basket::safelySaveToFile(fullPath, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + document.toString()))
DEBUG_WIN << "<font color=red>FAILED to save tags</font>!";
}