PDA

View Full Version : eparml



Radek
9th September 2013, 16:24
I would like to implement the IPF command "eparml" in my document viewer. The "eparml" is, in fact, a "bulletted" text, where bullets are (different) texts. The result should be something like this:



Some tag Tag text, can span several lines and it
should be aligned this way.
Can also contain line and paragraph breaks.

Another tag Another tag text.
Next line. etc.


The "tag column" has fixed size, the "data column" is expandable. I have implemented this way:



QTextOption::Tab newtab;
int NewMargin = CurrentMargin + TagColumnSize;

setTextMargin(newmargin);
setTextIndent(-TagColumnSize);

newtab.position = TagColumnSize;
newtab.type = TextOption::LeftTab;

<replace tabs with newtab>


Write the tag, make TAB, write data. This works perfectly but it clobbers TAB settings. I would like a solution that preserves TAB settings. In other words, I need to emulate a TAB without issuing setTabPositions(). Is there a way how to do it?