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); }
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 ); }