Package com.trolltech.qt.core

Examples of com.trolltech.qt.core.QModelIndex


            currentNoteGuid =  currentNote.getGuid();
            i = listManager.getNoteIndex().size();
          }
        }
      }
      QModelIndex index;
      for (int i=0; i<noteTableView.model().rowCount(); i++) {
        index = noteTableView.model().index(i, Global.noteTableGuidPosition);
        if (currentNoteGuid.equals(index.data())) {
//          noteTableView.selectionModel().blockSignals(true);
             noteTableView.selectRow(i);
//             noteTableView.selectionModel().blockSignals(false);
          noteTableView.scrollTo(index, ScrollHint.EnsureVisible)// This should work, but it doesn't
             i=listManager.getNoteTableModel().rowCount();
View Full Code Here


    if (selectedNoteGUIDs.size() == 0)
      selectedNoteGUIDs.add(currentNoteGuid);
   
      for (int j=0; j<selectedNoteGUIDs.size(); j++) {
        for (int i=0; i<listManager.getNoteTableModel().rowCount(); i++) {
          QModelIndex modelIndex =  listManager.getNoteTableModel().index(i, Global.noteTableGuidPosition);
          if (modelIndex != null) {
            SortedMap<Integer, Object> ix = listManager.getNoteTableModel().itemData(modelIndex);
            String tableGuid =  (String)ix.values().toArray()[0];
            if (tableGuid.equals(selectedNoteGUIDs.get(j))) {
              for (int k=0; k<Global.noteTableColumnCount; k++) {
View Full Code Here

   
    // If this wasn't already marked as unsynchronized, then we need to update the table
    listManager.getNoteTableModel().updateNoteSyncStatus(currentNoteGuid, false);
//      listManager.getUnsynchronizedNotes().add(currentNoteGuid);
      for (int i=0; i<listManager.getNoteTableModel().rowCount(); i++) {
        QModelIndex modelIndex =  listManager.getNoteTableModel().index(i, Global.noteTableGuidPosition);
        if (modelIndex != null) {
          SortedMap<Integer, Object> ix = listManager.getNoteTableModel().itemData(modelIndex);
          String tableGuid =  (String)ix.values().toArray()[0];
          if (tableGuid.equals(currentNoteGuid)) {
            listManager.getNoteTableModel().proxyModel.setData(i, Global.noteTableSynchronizedPosition, "false");
View Full Code Here

        }
        if (selectedNoteGUIDs.size() == 0 && !currentNoteGuid.equals(""))
          selectedNoteGUIDs.add(currentNoteGuid);
        for (int i=selectedNoteGUIDs.size()-1; i>=0; i--) {
          for (int j=listManager.getNoteTableModel().rowCount()-1; j>=0; j--) {
              QModelIndex modelIndex =  listManager.getNoteTableModel().index(j, Global.noteTableGuidPosition);
              if (modelIndex != null) {
                SortedMap<Integer, Object> ix = listManager.getNoteTableModel().itemData(modelIndex);
                String tableGuid =  (String)ix.values().toArray()[0];
                if (tableGuid.equals(selectedNoteGUIDs.get(i))) {
                  listManager.getNoteTableModel().removeRow(j);
View Full Code Here

    logger.log(logger.HIGH, "Merging notes");
    waitCursor(true);
    saveNote();
    String masterGuid = null;
    List<String> sources = new ArrayList<String>();
    QModelIndex index;
    for (int i=0; i<noteTableView.selectionModel().selectedRows().size(); i++) {
      int r = noteTableView.selectionModel().selectedRows().get(i).row();
      index = noteTableView.proxyModel.index(r, Global.noteTableGuidPosition);
      SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
          if (i == 0)
View Full Code Here

      if (!Global.isColumnVisible("guid"))
        noteTableView.hideColumn(Global.noteTableGuidPosition);

       // Check that the note is either synchronized, or in a local notebook
       for (int i=0; i<selections.size(); i++) {
         QModelIndex index;
         int row = selections.get(i).row();
        index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
        SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
           String selectedGuid = (String)ix.values().toArray()[0];
          
           Note n = conn.getNoteTable().getNote(selectedGuid, false, false, false, false, false);
           if (n.getUpdateSequenceNum() == 0 && !conn.getNotebookTable().isNotebookLocal(n.getNotebookGuid())) {
             QMessageBox.critical(this, tr("Please Synchronize") ,tr("Please either synchronize or move any " +
                 "new notes to a local notebook."));
             return;
           }
       }

       // Start building the URLs
      for (int i=0; i<selections.size(); i++) {
        QModelIndex index;
         int row = selections.get(i).row();
        index = noteTableView.proxyModel.index(row, Global.noteTableGuidPosition);
        SortedMap<Integer, Object> ix = noteTableView.proxyModel.itemData(index);
           String selectedGuid = (String)ix.values().toArray()[0];
           mime.setText(selectedGuid);
View Full Code Here

    showColumn(Global.noteTableGuidPosition);
    List<QModelIndex> selections = selectionModel().selectedRows();
    hideColumn(Global.noteTableGuidPosition);
   
      if (selections.size() > 0) {
        QModelIndex index;
        for (int i=0; i<selections.size(); i++) {
          int row = selections.get(i).row();
          index = proxyModel.index(row, Global.noteTableGuidPosition);
          SortedMap<Integer, Object> ix = proxyModel.itemData(index);
            guid.append((String)ix.values().toArray()[0]);
View Full Code Here

  }
 
 
  @SuppressWarnings("unused")
  private void deletePressed() {
    QModelIndex index = table.currentIndex();
    int row = index.row();
   
    QTableWidgetItem dirWidget = table.item(row, 0);
    String value = dirWidget.text();
    List<SharedNotebook> notebooks = conn.getSharedNotebookTable().getForNotebook(notebook.getGuid());
   
View Full Code Here

 
  @SuppressWarnings("unused")
  private void editPressed() {
    WatchFolderRecord record = new WatchFolderRecord();
    QModelIndex index = table.currentIndex();
    int row = index.row();
    QTableWidgetItem item = table.item(row, 0);
    record.folder = item.text();
    item = table.item(row, 1);
    record.notebook = item.text();
    item = table.item(row,2);
View Full Code Here

  }
 
 
  @SuppressWarnings("unused")
  private void deletePressed() {
    QModelIndex index = table.currentIndex();
    int row = index.row();
   
    QTableWidgetItem dirWidget = table.item(row, 0);
    String value = dirWidget.text();
    table.removeRow(row);
   
View Full Code Here

TOP

Related Classes of com.trolltech.qt.core.QModelIndex

Copyright © 2018 www.massapicom. 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.