本文整理汇总了C++中Q3PtrList::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrList::clear方法的具体用法?C++ Q3PtrList::clear怎么用?C++ Q3PtrList::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3PtrList
的用法示例。
在下文中一共展示了Q3PtrList::clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: closeSocket
void Q3SocketPrivate::close()
{
closeSocket();
wsize = 0;
rba.clear(); wba.clear();
windex = 0;
}
示例2: slotCursorRight
// -----------------------------------------------------------
void QucsApp::slotCursorRight()
{
if(!editText->isHidden()) return; // for edit of component property ?
Q3PtrList<Element> movingElements;
Schematic *Doc = (Schematic*)DocumentTab->currentPage();
int markerCount = Doc->copySelectedElements(&movingElements);
if((movingElements.count() - markerCount) < 1) {
if(markerCount > 0) { // only move marker if nothing else selected
Doc->markerLeftRight(false, &movingElements);
movingElements.clear();
}
else {
if(Doc->scrollRight(-Doc->horizontalScrollBar()->lineStep()))
Doc->scrollBy(Doc->horizontalScrollBar()->lineStep(), 0);
}
Doc->viewport()->update();
view->drawn = false;
return;
}
view->moveElements(&movingElements, Doc->GridX, 0); // move "GridX" to right
view->MAx3 = 1; // sign for moved elements
view->endElementMoving(Doc, &movingElements);
}
示例3: slotCursorDown
// -----------------------------------------------------------
void QucsApp::slotCursorDown()
{
if(!editText->isHidden()) { // for edit of component property ?
if(view->MAx3 == 0) return; // edit component namen ?
Component *pc = (Component*)view->focusElement;
Property *pp = pc->Props.at(view->MAx3-1); // current property
int Pos = pp->Description.find('[');
if(Pos < 0) return; // no selection list ?
Pos = pp->Description.find(editText->text(), Pos); // current list item
if(Pos < 0) return; // should never happen
Pos = pp->Description.find(',', Pos);
if(Pos < 0) return; // was last item ?
Pos++;
if(pp->Description.at(Pos) == ' ') Pos++; // remove leading space
int End = pp->Description.find(',', Pos);
if(End < 0) { // is last item ?
End = pp->Description.find(']', Pos);
if(End < 0) return; // should never happen
}
editText->setText(pp->Description.mid(Pos, End-Pos));
editText->selectAll();
return;
}
Q3PtrList<Element> movingElements;
Schematic *Doc = (Schematic*)DocumentTab->currentPage();
int markerCount = Doc->copySelectedElements(&movingElements);
if((movingElements.count() - markerCount) < 1) {
if(markerCount > 0) { // only move marker if nothing else selected
Doc->markerUpDown(false, &movingElements);
movingElements.clear();
}
else {
if(Doc->scrollDown(-Doc->verticalScrollBar()->lineStep()))
Doc->scrollBy(0, Doc->verticalScrollBar()->lineStep());
}
Doc->viewport()->update();
view->drawn = false;
return;
}
view->moveElements(&movingElements, 0, Doc->GridY); // move "GridY" down
view->MAx3 = 1; // sign for moved elements
view->endElementMoving(Doc, &movingElements);
}
示例4: top
void RuleStack::top( Q3PtrList<KScoringRule> &l )
{
l.clear();
KScoringManager::ScoringRuleList *l1 = stack.top();
l = *l1;
}
示例5: delete_internal
bool BrowserNode::delete_internal(QString & warning) {
if (deletedp())
return TRUE;
if (!is_writable() && !root_permission() && !is_from_lib()) {
warning += "\n " + TR("%1 is read-only", full_name());
return FALSE;
}
static Q3PtrList<BrowserNode> targetof;
static bool made = FALSE;
bool made_here;
if (!made) {
made = TRUE;
made_here = TRUE;
referenced_by(targetof, TRUE);
}
else
made_here = FALSE;
bool ro = FALSE;
if (!root_permission()) {
Q3PtrListIterator<BrowserNode> it(targetof);
BrowserNode * r;
while ((r = it.current()) != 0) {
if (!r->is_writable() && !r->is_from_lib()) {
ro = TRUE;
warning += "\n ";
switch (r->get_type()) {
case UmlComponent:
warning += TR("%1 referenced by the read-only component %2", full_name(), r->full_name());
break;
case UmlArtifact:
warning += TR("%1 referenced by the read-only artifact %2", full_name(), r->full_name());
break;
default:
warning += TR("%1 is the target of the read-only relation %2", full_name(), r->full_name());
break;
}
}
++it;
}
}
if (made_here) {
made = FALSE;
targetof.clear();
}
if (ro)
return FALSE;
// sub elts
Q3ListViewItem * child;
bool ok = TRUE;
for (child = firstChild(); child != 0; child = child->nextSibling())
ok &= ((BrowserNode *) child)->delete_internal(warning);
if (ok) {
is_deleted = TRUE;
if (is_marked) {
marked_list.removeRef(this);
is_marked = FALSE;
}
get_data()->delete_it();
repaint();
package_modified();
}
return ok;
}