Exemplo n.º 1
0
QString ColumnarTableWidget::textForColumn(int row,int col) const {
  QTableWidgetItem * item = this->item(row,col);
  QString str;
  if (item) {
    str = item->text();
  }
  else {
    QLabel * label = qobject_cast<QLabel *>(this->cellWidget(row,col));
    if (label) {
      str = label->text();
    }
  }
  return removeSpan(str);
}
Exemplo n.º 2
0
void
TextBuffer::insertSpan( std::string s, TextSpan &span ) { 

	startEdit( span.begin, span.end );

	if ( !span.empty() ) removeSpan(span);

	for ( t_CKUINT i=0; i < s.size(); i++) { 
		if ( s[i] == '\n' ) insertLine( span.end );
		else insertChar( s[i], span.end );
	}

	endEdit ( span.begin, span.end );
}