Esempio n. 1
0
void KWidgetListbox::showItems(show_callback func, void* data)
{
  for(int i = 0; i < numRows(); ++i)
  {
    if(func == 0)
      showRow(i);
    else
    {
      if(func(i, item(i), data))
        showRow(i);
      else
        hideRow(i);
    }
  }
  updateColors();
}
Esempio n. 2
0
void toResultTableView::applyFilter()
{
    if (!Filter || !Model)
        return;

    Filter->startingQuery();

    setUpdatesEnabled(false);
    for (int row = 0; row < Model->rowCount(); row++)
    {
        if (!Filter->check(Model, row))
            hideRow(row);
        else
            showRow(row);
    }
    setUpdatesEnabled(true);
}
Esempio n. 3
0
  void TableView::applyFilter(QString& filterText)
  {
    //  QRegExp regExp(filterText); //strict regular expression matching
    QRegExp regExp(filterText, Qt::CaseInsensitive, QRegExp::Wildcard); // text wild card *, ? matching
    std::vector<int> rowsToShow;

    for (int row=0;row<rowCount();row++)
    {
      if (  (regExp.exactMatch(item(row,m_slHeaders.indexOf("Variable Name"))->text()))
          || (regExp.exactMatch(item(row,m_slHeaders.indexOf("Key Value"))->text()))
          || (regExp.exactMatch(item(row,m_slHeaders.indexOf("Reporting Frequency"))->text()))
          || (regExp.exactMatch(item(row,m_slHeaders.indexOf("Environment Period"))->text()))
          //       || (regExp.exactMatch(item(row,m_slHeaders.indexOf("File"))->text()))
          || (regExp.exactMatch(item(row,m_slHeaders.indexOf("Alias"))->text())) )   rowsToShow.push_back(row);
    }
    for (int i=0; i<rowCount();i++)
    {
      if ( std::find(rowsToShow.begin(), rowsToShow.end(), i) == rowsToShow.end() )
        hideRow(i);
      else
        showRow(i);
    }
  }
Esempio n. 4
0
bool QTable::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setNumRows((int)static_QUType_int.get(_o+1)); break;
    case 1: setNumCols((int)static_QUType_int.get(_o+1)); break;
    case 2: setShowGrid((bool)static_QUType_bool.get(_o+1)); break;
    case 3: hideRow((int)static_QUType_int.get(_o+1)); break;
    case 4: hideColumn((int)static_QUType_int.get(_o+1)); break;
    case 5: showRow((int)static_QUType_int.get(_o+1)); break;
    case 6: showColumn((int)static_QUType_int.get(_o+1)); break;
    case 7: static_QUType_bool.set(_o,isRowHidden((int)static_QUType_int.get(_o+1))); break;
    case 8: static_QUType_bool.set(_o,isColumnHidden((int)static_QUType_int.get(_o+1))); break;
    case 9: setColumnWidth((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 10: setRowHeight((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 11: adjustColumn((int)static_QUType_int.get(_o+1)); break;
    case 12: adjustRow((int)static_QUType_int.get(_o+1)); break;
    case 13: setColumnStretchable((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 14: setRowStretchable((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 15: static_QUType_bool.set(_o,isColumnStretchable((int)static_QUType_int.get(_o+1))); break;
    case 16: static_QUType_bool.set(_o,isRowStretchable((int)static_QUType_int.get(_o+1))); break;
    case 17: setSorting((bool)static_QUType_bool.get(_o+1)); break;
    case 18: swapRows((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 19: swapRows((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 20: swapColumns((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 21: swapColumns((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 22: swapCells((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3),(int)static_QUType_int.get(_o+4)); break;
    case 23: setLeftMargin((int)static_QUType_int.get(_o+1)); break;
    case 24: setTopMargin((int)static_QUType_int.get(_o+1)); break;
    case 25: setCurrentCell((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 26: clearSelection(); break;
    case 27: clearSelection((bool)static_QUType_bool.get(_o+1)); break;
    case 28: setColumnMovingEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 29: setRowMovingEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 30: setReadOnly((bool)static_QUType_bool.get(_o+1)); break;
    case 31: setRowReadOnly((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 32: setColumnReadOnly((int)static_QUType_int.get(_o+1),(bool)static_QUType_bool.get(_o+2)); break;
    case 33: setDragEnabled((bool)static_QUType_bool.get(_o+1)); break;
    case 34: static_QUType_bool.set(_o,dragEnabled()); break;
    case 35: insertRows((int)static_QUType_int.get(_o+1)); break;
    case 36: insertRows((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 37: insertColumns((int)static_QUType_int.get(_o+1)); break;
    case 38: insertColumns((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 39: removeRow((int)static_QUType_int.get(_o+1)); break;
    case 40: removeRows((const QMemArray<int>&)*((const QMemArray<int>*)static_QUType_ptr.get(_o+1))); break;
    case 41: removeColumn((int)static_QUType_int.get(_o+1)); break;
    case 42: removeColumns((const QMemArray<int>&)*((const QMemArray<int>*)static_QUType_ptr.get(_o+1))); break;
    case 43: editCell((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2)); break;
    case 44: editCell((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(bool)static_QUType_bool.get(_o+3)); break;
    case 45: setRowLabels((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break;
    case 46: setColumnLabels((const QStringList&)*((const QStringList*)static_QUType_ptr.get(_o+1))); break;
    case 47: columnWidthChanged((int)static_QUType_int.get(_o+1)); break;
    case 48: rowHeightChanged((int)static_QUType_int.get(_o+1)); break;
    case 49: columnIndexChanged((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3)); break;
    case 50: rowIndexChanged((int)static_QUType_int.get(_o+1),(int)static_QUType_int.get(_o+2),(int)static_QUType_int.get(_o+3)); break;
    case 51: columnClicked((int)static_QUType_int.get(_o+1)); break;
    case 52: doAutoScroll(); break;
    case 53: doValueChanged(); break;
    case 54: updateGeometriesSlot(); break;
    default:
	return QScrollView::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 5
0
 void TableView::clearFilter()
 {
   for (int i=0; i<rowCount();i++) showRow(i);
 }