hi,

i need some help creating a multi column rich text editor ( like in the news paper articles). I have tried it with QTextEditor and QTextDocument and QTextFrames, but I don't know if this is the right track. A small part of my code where I want to set up the multi column stuff.

Qt Code:
  1. QPrinter printer;
  2. QTextDocument *doc = textEdit->document();
  3. QTextCharFormat txt_frm;
  4. QTextCursor cur( doc );
  5. QTextFrameFormat frame_frm;
  6.  
  7. printer.setPaperSize( QPrinter::A4 );
  8.  
  9. doc->setPageSize( printer.pageRect().size() );
  10. doc->setTextWidth( printer.pageRect().width());
  11.  
  12. frame_frm.setWidth( qreal( 105 ));
  13. frame_frm.setHeight( qreal( 297));
  14.  
  15. cur.beginEditBlock();
  16. cur.insertFrame( frame_frm );
  17.  
  18. QFile file( QString("./test.txt" ));
  19.  
  20. if( file.open( QFile::ReadOnly ))
  21. {
  22. QTextStream stream( &file );
  23. cur.insertText( stream.readAll(), txt_frm );
  24. }
To copy to clipboard, switch view to plain text mode