本文整理汇总了C++中Column类的典型用法代码示例。如果您正苦于以下问题:C++ Column类的具体用法?C++ Column怎么用?C++ Column使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Column类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Column
Column* DatapickerCurve::appendColumn(const QString& name) {
Column* col = new Column(i18n("Column"), AbstractColumn::Numeric);
col->insertRows(0, m_datasheet->rowCount());
col->setName(name);
m_datasheet->addChild(col);
return col;
}
示例2: tableColumnFunction
/**
* \brief Implements column() function for tables.
*
* \arg \c columnPath Path to the column to read data from. See
* resolveColumnPath().
*
* The row to read from is determined by the muParser variable "i" set during
* iteration of a column
* formula. For explicitly specifying the row, use cell() instead.
*
* \sa tableCellFunction()
*/
double MuParserScript::tableColumnFunction(const char *columnPath) {
Column *column =
s_currentInstance->resolveColumnPath(QString::fromUtf8(columnPath));
if (!column) return NAN; // failsafe, shouldn't happen
int row = qRound(s_currentInstance->m_variables["i"]) - 1;
if (column->isInvalid(row)) throw new EmptySourceError();
return column->valueAt(row);
}
示例3: extract
void IOracle::extract(DoubleVector const & x, Column & column) {
for (int v(0); v < _input->nV(); ++v) {
if (x[v] > 0.5) {
column.insert(v);
}
}
column.cost() = column.computeCost();
}
示例4: Apply
void SumAggregator::Apply(const Table::Ptr& table, const Value& row)
{
Column column = table->GetColumn(m_SumAttr);
Value value = column.ExtractValue(row);
m_Sum += value;
}
示例5: fill
void fill(Column::Type type, QListWidget* lw, const QString& path){
Column* column = Column::make(type);
column->createRows(path);
setWindowTitle(type, lw);
lw->show();
lw->addItems(column->getRows());
delete column;
}
示例6: UnifySameSizedColumnSizes
void ColumnSet::CalculateSize()
{
gfx::Size pref;
// Reset the preferred and remaining sizes.
for(std::vector<ViewState*>::iterator i = view_states_.begin();
i!=view_states_.end(); ++i)
{
ViewState* view_state = *i;
if(!view_state->pref_width_fixed || !view_state->pref_height_fixed)
{
pref = view_state->view->GetPreferredSize();
if(!view_state->pref_width_fixed)
{
view_state->pref_width = pref.width();
}
if(!view_state->pref_height_fixed)
{
view_state->pref_height = pref.height();
}
}
view_state->remaining_width = pref.width();
view_state->remaining_height = pref.height();
}
// Let layout element reset the sizes for us.
LayoutElement::ResetSizes(&columns_);
// Distribute the size of each view with a col span == 1.
std::vector<ViewState*>::iterator view_state_iterator =
view_states_.begin();
for(; view_state_iterator!=view_states_.end()&&
(*view_state_iterator)->col_span==1; ++view_state_iterator)
{
ViewState* view_state = *view_state_iterator;
Column* column = columns_[view_state->start_col];
column->AdjustSize(view_state->pref_width);
view_state->remaining_width -= column->Size();
}
// Make sure all linked columns have the same size.
UnifySameSizedColumnSizes();
// Distribute the size of each view with a column span > 1.
for(; view_state_iterator!=view_states_.end(); ++view_state_iterator)
{
ViewState* view_state = *view_state_iterator;
// Update the remaining_width from columns this view_state touches.
UpdateRemainingWidth(view_state);
// Distribute the remaining width.
DistributeRemainingWidth(view_state);
// Update the size of linked columns.
// This may need to be combined with previous step.
UnifySameSizedColumnSizes();
}
}
示例7: Apply
void MinAggregator::Apply(const Table::Ptr& table, const Value& row)
{
Column column = table->GetColumn(m_MinAttr);
Value value = column.ExtractValue(row);
if (value < m_Min)
m_Min = value;
}
示例8: Apply
void AvgAggregator::Apply(const Table::Ptr& table, const Value& row)
{
Column column = table->GetColumn(m_AvgAttr);
Value value = column.ExtractValue(row);
m_Avg += value;
m_AvgCount++;
}
示例9: while
void PostgreSqlDbAdapter::ConvertTable(Table* pTab) {
SerializableList::compatibility_iterator node = pTab->GetFirstChildNode();
while( node ) {
if( node->GetData()->IsKindOf( CLASSINFO(Column)) ) {
Column* col = (Column*) node->GetData();
col->SetType(ConvertType(col->GetType()));
}
node = node->GetNext();
}
}
示例10: findColumn
void Table::setPrimaryKey(string colName) {
Column *theCol = findColumn(colName);
if(theCol == NULL) {
throw DatabaseException(20, colName + " does not exist.");
}
theCol->setPrimary(true);
}
示例11: Apply
void SumAggregator::Apply(const Table::Ptr& table, const Value& row, AggregatorState **state)
{
Column column = table->GetColumn(m_SumAttr);
Value value = column.ExtractValue(row);
SumAggregatorState *pstate = EnsureState(state);
pstate->Sum += value;
}
示例12: GetValue
std::string * Row::GetValue(const std::string & column_name)
{
Column * col = _tbl->GetColumn(column_name);
if (!col)
{
return nullptr;
}
return GetValue(col->GetIndex(), false);
}
示例13: Q_D
/*!
Returns the data stored in the row in the column named \a column or an invalid
QVariant if this column does not exist in the table of the row.
*/
QVariant Row::data(const QString &column) const
{
Q_D(const Row);
Column *c = d->table->column(column);
if(!c)
return QVariant();
return data(c->index());
}
示例14: Apply
void StdAggregator::Apply(const Table::Ptr& table, const Value& row)
{
Column column = table->GetColumn(m_StdAttr);
Value value = column.ExtractValue(row);
m_StdSum += value;
m_StdQSum += pow(value, 2);
m_StdCount++;
}
示例15: wxDynamicCast
Column* TableSettings::GetColumn(const wxString& name)
{
for( SerializableList::iterator it = m_lstColumns.begin();
it != m_lstColumns.end(); ++it ) {
Column *c = wxDynamicCast( *it, Column );
if( c && ( c->GetName() == name ) ) return c;
}
return NULL;
}