ich möchte aus meinem Programm heraus ein QTextDocument erstellen und als Odt - Datei abspeichern.
Mein Problem ist nun, daß meine Vorgaben für das Framelayout nicht übernommen werden:
Code: Alles auswählen
QTextDocument doku;
QString string = "Das ist eine Testeingabe m m m m m m m m m mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm";
QTextBlock block;
QTextCursor cursor(&doku);
QTextFrame *top_frame = cursor.currentFrame();
QTextFrameFormat top_frame_format;
qreal breite = 100.0;
top_frame_format.setWidth(15);
top_frame_format.setHeight(breite);
top_frame_format.setBorder(3.00);
top_frame_format.setBorderBrush(QBrush(Qt::blue));
top_frame_format.setBackground(QBrush(Qt::red));
top_frame->setFrameFormat(top_frame_format);
cursor.insertFrame(top_frame_format) ;
cursor.insertText(string);
cursor.insertBlock();
cursor.insertText(string);
QTextDocumentWriter *writer = new QTextDocumentWriter;
writer->setFormat("odf");
writer->setFileName("/home/horst/ausgabe_test.odt");
writer->write(&doku);
Im Odt File wird eine Zeilenumbruch angezeigt,
dann 1.-mal der Text,
ein Absatzumbruch,
das 2.-mal der Text,
wieder ein Absatzumbruch.
Was fehlt die die Formatierungen von Framebreite, Farben und Umrandung.
Was habe ich noch zu tun ?
Dankbar für jede hilfe
sfbeetle