Examples of QModelIndex


Examples of com.trolltech.qt.core.QModelIndex

  public void updateNoteAuthor(String guid, String author) {
    for (int i=0; i<getMasterNoteIndex().size(); i++) {
      if (getMasterNoteIndex().get(i).getGuid().equals(guid)) {
        getMasterNoteIndex().get(i).getAttributes().setAuthor(author);
        getMasterNoteIndex().get(i).getAttributes().setAltitudeIsSet(true);
        QModelIndex idx = createIndex(i, Global.noteTableAuthorPosition, nativePointer());
        setData(idx, author, Qt.ItemDataRole.EditRole);
        i = getMasterNoteIndex().size();
     
    }
    // Update the list tables
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

  public void updateNoteSourceUrl(String guid, String url) {
    for (int i=0; i<getMasterNoteIndex().size(); i++) {
      if (getMasterNoteIndex().get(i).getGuid().equals(guid)) {
        getMasterNoteIndex().get(i).getAttributes().setSourceURL(url);
        getMasterNoteIndex().get(i).getAttributes().setSourceURLIsSet(true);
        QModelIndex idx = createIndex(i, Global.noteTableSourceUrlPosition, nativePointer());
        setData(idx, url, Qt.ItemDataRole.EditRole);
        i = getMasterNoteIndex().size();
     
    }
    // Update the list tables
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

      metaData.get(guid).setDirty(!sync);
   
    // Now we need to go through the table & update it
    for (int i=0; i<getMasterNoteIndex().size(); i++) {
      if (getMasterNoteIndex().get(i).getGuid().equals(guid)) {
        QModelIndex idx = createIndex(i, Global.noteTableSynchronizedPosition, nativePointer());
        String value;
        if (!sync)
          value = tr("false");
        else
          value = tr("true");
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

 
  public void updateNotePinnedStatus(String guid, boolean pinned) {
    // Now we need to go through the table & update it
    for (int i=0; i<getMasterNoteIndex().size(); i++) {
      if (getMasterNoteIndex().get(i).getGuid().equals(guid)) {
        QModelIndex idx = createIndex(i, Global.noteTablePinnedPosition, nativePointer());
        String value;
        if (metaData.containsKey(guid));
          metaData.get(guid).setPinned(pinned);
        if (pinned)
          value = tr("true");
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

    invalidateFilter();
  }
  @Override
  protected boolean filterAcceptsRow(int sourceRow, QModelIndex sourceParent) {
    QAbstractItemModel model = sourceModel();
    QModelIndex guidIndex = sourceModel().index(sourceRow, Global.noteTableGuidPosition);
    String guid = (String)model.data(guidIndex);
   
    if (guids.containsKey(guid) || pinnedGuids.containsKey(guid))
      return true;
    else
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

     
      if (!Global.isColumnVisible("guid"))
        noteTableView.hideColumn(Global.noteTableGuidPosition);
     
      if (selections.size() > 0) {
        QModelIndex index;
        menuBar.noteDuplicateAction.setEnabled(true);
        menuBar.noteOnlineHistoryAction.setEnabled(true);
        menuBar.noteMergeAction.setEnabled(true);
        selectedNoteGUIDs.clear();
        if (selections.size() != 1 || Global.showDeleted) {
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

        else
          pos = 1;
        if (noteTableView.proxyModel.rowCount() == 0)
          pos = 0;
        if (pos>0)  {
          QModelIndex i = noteTableView.proxyModel.index(pos-1, Global.noteTableGuidPosition);
          if (i!=null) {
            currentNoteGuid = (String)i.data();
          }
        }
      }   
    if (!noteTableView.isColumnHidden(Global.noteTableGuidPosition))
      showColumns();
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

      if (historyPosition <= 0)
        return;
        String historyGuid = historyGuids.get(historyPosition-1);
        fromHistory = true;
      for (int i=0; i<noteTableView.model().rowCount(); i++) {
        QModelIndex modelIndex =  noteTableView.model().index(i, Global.noteTableGuidPosition);
        if (modelIndex != null) {
          SortedMap<Integer, Object> ix = noteTableView.model().itemData(modelIndex);
          String tableGuid =  (String)ix.values().toArray()[0];
          if (tableGuid.equals(historyGuid)) {
            noteTableView.selectRow(i);
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

        return;
        String historyGuid = historyGuids.get(historyPosition);
        historyPosition++;
        fromHistory = true;
      for (int i=0; i<noteTableView.model().rowCount(); i++) {
        QModelIndex modelIndex =  noteTableView.model().index(i, Global.noteTableGuidPosition);
        if (modelIndex != null) {
          SortedMap<Integer, Object> ix = noteTableView.model().itemData(modelIndex);
          String tableGuid =  (String)ix.values().toArray()[0];
          if (tableGuid.equals(historyGuid)) {
            noteTableView.selectRow(i);
View Full Code Here

Examples of com.trolltech.qt.core.QModelIndex

        if (i<tags.size()-1)
          tagBuffer.append(", ");
      }
     
      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(guid)) {
            listManager.getNoteTableModel().setData(i, Global.noteTableTagPosition,tagBuffer.toString());
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.