本文整理汇总了C++中Q3PtrList::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrList::isEmpty方法的具体用法?C++ Q3PtrList::isEmpty怎么用?C++ Q3PtrList::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3PtrList
的用法示例。
在下文中一共展示了Q3PtrList::isEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_inherit
// check inheritance
QString BrowserNode::check_inherit(const BrowserNode * new_parent) const {
Q3PtrList<BrowserNode> all_parents;
Q3PtrList<BrowserNode> notyet = parents();
if (notyet.findRef(new_parent) != -1)
return TR("already generalize / realize");
notyet.append(new_parent);
do {
BrowserNode * cl = notyet.getFirst();
notyet.removeFirst();
if (cl == this)
return TR("can't have circular generalization / realization");
if (all_parents.findRef(cl) == -1) {
all_parents.append(cl);
Q3PtrList<BrowserNode> grand_parents = cl->parents();
for (cl = grand_parents.first(); cl; cl = grand_parents.next())
if (notyet.findRef(cl) == -1)
notyet.append(cl);
}
} while (! notyet.isEmpty());
return 0;
}
示例2: signal_unconsistencies
void BrowserNode::signal_unconsistencies()
{
QString pfix =
TR("<p><b>Warning, the model is not consistent because some elements have\n"
"the same internal identifier.</b></p>\n"
"<p>Users working on the same project have the same use identifier,\n"
"or you had change the model files, or used Project synchro\n"
"without following the mandatory rules</p>\n");
QString msg;
if (!UnconsistencyDeletedMsg.isEmpty())
msg = pfix + "<p>" + TR("These elements was <b>removed</b>") + " :</p>\n <ul>"
+ UnconsistencyDeletedMsg + "</ul>\n";
if (!UnconsistencyFixedMsg.isEmpty()) {
if (UnconsistencyDeletedMsg.isEmpty())
msg = pfix;
msg += "<p>"
+ TR("The internal identifier of these elements was changed,\n"
"but <u>I can't garantee the references to them are the right one</u>,\n"
"check your model")
+ " :</p>\n<ul>" + UnconsistencyFixedMsg + "</ul>\n";
do_change_shared_ids();
do
ModifiedPackages.take(0)->is_modified = TRUE;
while (! ModifiedPackages.isEmpty());
}
if (! msg.isEmpty()) {
UnconsistencyDeletedMsg = UnconsistencyFixedMsg = QString::null;
warn(msg);
}
}
示例3: post_load
void RelationData::post_load()
{
while (! IncludeToHeaderIfExternal.isEmpty()) {
RelationData * rd = IncludeToHeaderIfExternal.take(0);
if ((rd->end_removed_from != 0) &&
(rd->end_removed_from->get_type() == UmlClass) &&
((ClassData *) rd->end_removed_from->get_data())->cpp_is_external())
rd->a.cpp_decl = "#include in header";
}
}
示例4: check_edits
bool check_edits(Q3PtrList<BodyDialog> & edits)
{
if (edits.isEmpty())
return TRUE;
return (msg_critical("Douml",
TR("Sub dialog(s) still opened\n"
"If you choose 'Ok' the dialog will be closed\n"
"without taking into account it content"),
QMessageBox::Ok, QMessageBox::Abort)
== QMessageBox::Ok);
}
示例5: main
int main(int argc, char ** argv)
{
if (argc != 2)
return 0;
if (UmlCom::connect(Q3CString(argv[1]).toUInt())) {
bool aborted = TRUE;
try {
UmlCom::trace("<b>C++ roundtrip</b> release 1.3<br>");
UmlCom::traceAutoRaise(FALSE);
char * argv = 0;
int argc = 0;
QApplication * app = new QApplication(argc, &argv);
UmlItem * item = UmlCom::targetItem();
int n;
switch (item->kind()) {
default:
UmlCom::trace("<font face=helvetica><b>must be applied on a <i>package, class view, deployment view, artifact</i> or <i>class</i></b></font><br>");
aborted = FALSE;
throw 0;
case aPackage:
n = ((UmlPackage *) item)->count_roundtriped();
break;
case aClassView:
case aDeploymentView:
case anArtifact:
n = 1;
break;
case aClass:
if (item->parent()->kind() != aClassView) {
UmlCom::trace("<font face=helvetica><b>can't be applied on a <i>class</i> nested or out of a <i>class view</i></b></font><br>");
aborted = FALSE;
throw 0;
}
n = 1;
break;
}
UmlPackage * project = UmlPackage::getProject();
UmlCom::trace("<font face=helvetica>Upload project ...</font>");
Package::init(project, app);
UmlCom::trace("<font face=helvetica>...done</font><br>");
UmlCom::message("");
Package::set_step(0, n);
UmlCom::trace("<font face=helvetica>Preparation...</font>");
if (!item->set_roundtrip_expected() &&
(QMessageBox::warning(0, "Roundtrip",
"Some elements to roundtrip are read-only and will not be updated\n\n"
"Roundtrip anyway ?",
"Yes", "No", QString::null, 1, 1)
!= 0)) {
aborted = FALSE;
throw 0;
}
Package::set_step(0, -1);
UmlCom::trace("<font face=helvetica>...done</font><br>");
if ((item->kind() == aPackage) && !UmlArtifact::is_roundtrip_usefull()) {
UmlCom::trace("<font face=helvetica>you don't ask for to roundtrip artifact(s)<br><br>"
"probably you want to do a <i>reverse</i> rather than a <i>roundtrip</i></font><br>");
aborted = FALSE;
throw 0;
}
Q3CString f;
if (project->propertyValue("#file", f))
Lex::defines(f);
n = 0;
item->scan_it(n);
CppSettings::set_UseDefaults(TRUE);
project->set_childrenVisible(FALSE);
item->send_it(n);
UmlOperation::force_defs();
Statistic::produce();
// umark all
{
Q3PtrVector<UmlItem> marked = UmlItem::markedItems();
UmlItem ** v = marked.data();
UmlItem ** const vsup = v + marked.size();
for (;v != vsup; v += 1)
(*v)->set_isMarked(FALSE);
}
Q3PtrList<UmlItem> useless;
item->mark_useless(useless);
if (!useless.isEmpty() &&
(QMessageBox::warning(0, "C++ roundtrip",
"The marked elements are useless because they don't\n"
//.........这里部分代码省略.........
示例6: menu
void SdDurationCanvas::menu(const QPoint & p) {
Q3PopupMenu m(0);
Q3CanvasItemList items = collisions(TRUE);
Q3PtrList<SdDurationCanvas> l;
Q3CanvasItemList::ConstIterator it;
Q3CanvasItemList::ConstIterator end = items.end();
for (it = items.begin(); it != end; ++it) {
if ((*it)->visible()) {
DiagramItem * di = QCanvasItemToDiagramItem(*it);
if ((di != 0) &&
(di->type() == UmlActivityDuration) &&
(((SdDurationCanvas *) di)->support == support))
l.append((SdDurationCanvas *) di);
}
}
m.insertItem(new MenuTitle(TR("Activity bar"), m.font()), -1);
m.insertSeparator();
m.insertItem(TR("Upper"), 0);
m.insertItem(TR("Lower"), 1);
m.insertItem(TR("Go up"), 9);
m.insertItem(TR("Go down"), 10);
m.insertSeparator();
m.insertItem((coregion) ? TR("Draw as activity bar") : TR("Draw as a coregion"), 7);
m.insertItem(TR("Edit drawing settings"), 2);
m.insertSeparator();
m.insertItem(TR("Select linked items"), 3);
m.insertSeparator();
m.insertItem(TR("Remove from diagram"), 4);
m.insertSeparator();
m.insertItem(TR("Cut here"), 5);
if (!l.isEmpty())
m.insertItem(TR("Merge juxtaposed activity bars"), 6);
if (support->isaDuration())
m.insertItem(TR("Collapse in parent bar"), 8);
switch (m.exec(QCursor::pos())) {
case 0:
upper();
modified();
return;
case 1:
lower();
modified();
return;
case 9:
z_up();
modified(); // call package_modified()
return;
case 10:
z_down();
modified(); // call package_modified()
return;
case 2:
edit_drawing_settings();
return;
case 3:
select_associated();
break;
case 4:
delete_it();
package_modified();
break;
case 5:
cut(p);
package_modified();
break;
case 6:
merge(l);
package_modified();
break;
case 7:
coregion = !coregion;
modified();
return;
case 8:
{
SdDurationCanvas * d = (SdDurationCanvas *) support;
d->collapse(this);
d->update_hpos(); // update sub duration and msg hpos
d->update_self();
}
package_modified();
break;
default:
return;
}
canvas()->update();
}