Examples of QTreeWidgetItem


Examples of com.trolltech.qt.gui.QTreeWidgetItem

    HashMap<FamilyType, QTreeWidgetItem> familyItems = new HashMap<FamilyType, QTreeWidgetItem>();
    HashMap<String, QTreeWidgetItem> subFamilyItems = new HashMap<String, QTreeWidgetItem>();
   
    for(String partName : FileTools.getAvailableParts()){
      FamilyType type = PartNameTools.getFamilyTypeFromPart(partName);
      QTreeWidgetItem familyItem = familyItems.get(type);
      if(familyItem == null){
        familyItem = new QTreeWidgetItem(treeWidget);
        familyItem.setText(0, PartNameTools.getFormalFamilyNameFromType(type));
        familyItems.put(type, familyItem);
      }
      String subFamilyName = PartNameTools.getSubFamilyFromPart(partName);
      QTreeWidgetItem partItem = null;
      QTreeWidgetItem parent = familyItem;
      if(subFamilyName != null){
        QTreeWidgetItem subFamilyItem = subFamilyItems.get(type.toString() + subFamilyName);
        if(subFamilyItem == null){
          subFamilyItem = new QTreeWidgetItem(parent);
          subFamilyItem.setText(0, subFamilyName);
          subFamilyItems.put(type.toString() + subFamilyName, subFamilyItem);
        }
        parent = subFamilyItem;
      }
      partItem = new QTreeWidgetItem(parent);
      partItem.setText(0, partName);
          partItem.setData(0, ItemDataRole.AccessibleDescriptionRole, partName);
    }
    return treeWidget;
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

   */
  protected void updatePrimitiveList(){
    primitiveList.clear();
    if(currTile == null || currTile.getPrimitiveSites() == null) return;
    for(PrimitiveSite ps : currTile.getPrimitiveSites()){
      QTreeWidgetItem treeItem = new QTreeWidgetItem();
      treeItem.setText(0, ps.getName());
      treeItem.setText(1, ps.getType().toString());
      primitiveList.insertTopLevelItem(0, treeItem);
    }
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

   */
  protected void updateWireList(){
    wireList.clear();
    if(currTile == null || currTile.getWireHashMap() == null) return;
    for(Integer wire : currTile.getWireHashMap().keySet()) {
      QTreeWidgetItem treeItem = new QTreeWidgetItem();
      treeItem.setText(0, we.getWireName(wire));
      WireConnection[] connections = currTile.getWireConnections(wire);
      treeItem.setText(1, String.format("%3d", connections == null ? 0 : connections.length));
      wireList.insertTopLevelItem(0, treeItem);
    }
    wireList.sortByColumn(0, SortOrder.AscendingOrder);
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      sortItems(0, SortOrder.AscendingOrder);
  }

 
  public boolean selectGuid(String guid) {
    QTreeWidgetItem root = invisibleRootItem();
    QTreeWidgetItem child;

    for (int i=0; i<root.childCount(); i++) {
      child = root.child(i);
      if (child.text(1).equals(guid)) {
        child.setSelected(true);
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

    menu.exec(event.globalPos());
  }
 
 
  public void selectSavedSearch(QTreeWidgetItem item) {
    QTreeWidgetItem root = invisibleRootItem();
    QTreeWidgetItem child;
   
    for (int i=0; i<root.childCount(); i++) {
      child = root.child(i);
      if (child.text(1).equals(item.text(1))) {
        child.setSelected(true);
        return;
      }
    }
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      trashItem.setForeground(1, gray);           
    }
  }
 
  public void load() {
        trashItem = new QTreeWidgetItem();
        trashItem.setIcon(0, trashIcon);
        trashItem.setText(0, tr("Trash"));
        Qt.Alignment ra = new Qt.Alignment(Qt.AlignmentFlag.AlignRight);
        trashItem.setTextAlignment(1, ra.value());
        List<String> headers = new ArrayList<String>();
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      Tag tag;
      List<NTreeWidgetItem> index = new ArrayList<NTreeWidgetItem>();
      NTreeWidgetItem child;
              
      /* First, let's find out which stacks are expanded */
      QTreeWidgetItem root =   invisibleRootItem();
      List<String> expandedTags = findExpandedTags(root);


     
      //Clear out the tree & reload
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

        if (counts.get(i).getGuid().equals(guid)) {
          children.get(j).setText(1, new Integer(counts.get(i).getCount()).toString());
          if (counts.get(i).getCount() > 0 || children.get(j).isSelected()) {
            children.get(j).setForeground(0, blue);     
            children.get(j).setForeground(1, blue);
            QTreeWidgetItem parent = children.get(j);
            while (parent != null) {
              parent.setForeground(0, blue);     
              parent.setForeground(1, blue);
              parent.setHidden(false);
              parent = parent.parent();
            }
          }
        }
      }
    }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      String current = d.toString();
     
      // Check we don't do a dumb thing like move a parent to a child of itself
      if (!checkParent(parent, current))
        return false;
      QTreeWidgetItem newChild;
      if (parent == null) {
//        tagSignal.changeParent.emit(current, "");
        db.getTagTable().updateTagParent(current, "");
        newChild = new QTreeWidgetItem(this);
      } else {
//        tagSignal.changeParent.emit(current, parent.text(2));
        db.getTagTable().updateTagParent(current, parent.text(2));
        newChild = new QTreeWidgetItem(parent);
      }
      copyTreeItem(currentItem(), newChild);
      currentItem().setHidden(true);
      sortItems(0, SortOrder.AscendingOrder);
      return true;
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

    target.setText(2, source.text(2));
    Qt.Alignment ra = new Qt.Alignment(Qt.AlignmentFlag.AlignRight);
    target.setTextAlignment(1, ra.value());
   
    for (int i=0; i<source.childCount(); i++) {
      QTreeWidgetItem newChild = new QTreeWidgetItem(target);
      copyTreeItem(source.child(i), newChild);
      source.child(i).setHidden(true);
    }
    return;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.