当前位置: 首页>>代码示例>>C++>>正文


C++ Q3PtrDict::setAutoDelete方法代码示例

本文整理汇总了C++中Q3PtrDict::setAutoDelete方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3PtrDict::setAutoDelete方法的具体用法?C++ Q3PtrDict::setAutoDelete怎么用?C++ Q3PtrDict::setAutoDelete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Q3PtrDict的用法示例。


在下文中一共展示了Q3PtrDict::setAutoDelete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sort_it

void BrowserNodeList::sort_it() {
  if (count() > 1000)
    QApplication::setOverrideCursor(Qt::waitCursor);
  
  BrowserPackage::prepare_for_sort();

  sort();

  SynonymousPath.setAutoDelete(TRUE);
  SynonymousPath.clear();
  
  if (count() > 1000)
    QApplication::restoreOverrideCursor();
}
开发者ID:SciBoy,项目名称:douml,代码行数:14,代码来源:BrowserNode.cpp

示例2: change_ranks

void ColMsgTable::change_ranks(int row, int col) {
  ColMsg * msg = flat_msg_list[row];
  HierarchicalRankValidator validator(view, msg->hierarchical_rank);
  BooL ok;
  QString new_hr = MyInputDialog::getText(TR("Enter new hierarchical rank"), TR("Hierarchical rank : "),
					  msg->hierarchical_rank, ok,
					  &validator);
  
  if (ok && (new_hr != msg->hierarchical_rank)) {
    QString old_hr = msg->hierarchical_rank;
    
#ifndef NEW_METHOD
    // it may be (?, not reproduced) not possible to reintroduce the message
    // at its original rank when the new rank is wrong => stop to follow this
    // way and save the original def before trying to use the new rank ;-(
    //
    // Fixed by doing a ColDiagramView::update_msgs() after load ?
    
    for (;;) {
      msg->in->remove_it(msg);
      msg->extract_it(view->get_msgs());
      ColMsg::update_ranks(view->get_msgs());
      
      msg->hierarchical_rank = new_hr;
      msg->place_in_internal(view->get_msgs());
      msg->place_in_its_support();
      ColMsg::update_ranks(view->get_msgs());
      
      if (new_hr.find('.') != -1) {
	// upper level msg dest must be msg start
	ColMsg * upper =
	  ColMsg::find_rec(new_hr.left(new_hr.findRev('.')), view->get_msgs());
	
	if (upper == 0)
	  // error
	  new_hr = QString::null;
	else {
	  CodObjCanvas * from;
	  CodObjCanvas * from_bis;
	  CodObjCanvas * to;
	  
	  msg->in->get_from_to(from, to, msg->is_forward);
 	  upper->in->get_from_to(from_bis, to, upper->is_forward);
 
	  if (to != from)
	    // error
	    new_hr = QString::null;
	}
      }
      if (msg->hierarchical_rank != new_hr) {
	msg_warning(TR("Warning"), TR("Invalid hierarchical rank"));
	new_hr = old_hr;
      }
      else
	break;
    }
    view->update_msgs();
    
    if (new_hr != old_hr) {
      refresh();
      setCurrentCell(flat_msg_list.findIndex(msg), col);
    }
#else
    // save all the messages
    Q3PtrDict<ColMsgList> saved;
    
    saved.setAutoDelete(TRUE);
    save_list(view->get_msgs(), saved);
    
    // remove the message
    msg->in->remove_it(msg);
    msg->extract_it(view->get_msgs());
    ColMsg::update_ranks(view->get_msgs());
    
    // try to insert the msg with the asked rank
    msg->hierarchical_rank = new_hr;
    msg->place_in_internal(view->get_msgs());
    msg->place_in_its_support();
    ColMsg::update_ranks(view->get_msgs());
    
    if (new_hr.find('.') != -1) {
      // upper level msg dest must be msg start
      ColMsg * upper =
	ColMsg::find_rec(new_hr.left(new_hr.findRev('.')), view->get_msgs());
      
      if (upper == 0)
	// error
	new_hr = QString::null;
      else {
	CodObjCanvas * from;
	CodObjCanvas * from_bis;
	CodObjCanvas * to;
	
	msg->in->get_from_to(from, to, msg->is_forward);
	upper->in->get_from_to(from_bis, to, upper->is_forward);
	
	if (to != from)
	  // error
	  new_hr = QString::null;
      }
//.........这里部分代码省略.........
开发者ID:kralf,项目名称:bouml,代码行数:101,代码来源:ColMsgTable.cpp


注:本文中的Q3PtrDict::setAutoDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。