This is what I have learnt about this project so far. Current Scenario:
In paragraph or one row Insets are considered as one character. That means if I insert inset at position 20 in row then whole inset will be placed at 20th position and next character in original text will be placed at 21st position.Width of character at position 20 will be considered as width of whole inset. So as we insert text in inset, its size(width) grows so size(width) of character(inset) placed at 20th position will grow larger and larger, and when it exceeds from current view-port space, it does not fit in current line and it is shifted in new line. Solution: So the idea is to change metrics and dimensions of inset so that it has two widths, Width of first row of inset and width of last row of inset. Calculations related to metrics and dimensions are already discussed in past or it can be viewed here.<https://drive.google.com/file/d/0B4JFO49DZ1P6eFpEMlFNZl9ad3c/edit?usp=sharing> When Width of first row exceeds from view-port, break-point is inserted and new text of inset will be painted in new line.So width of first row of inset will never exceed from view-port space so it will always fit in current row. Same way, if width of only last row is considered instead of maximum width(current implementation), next character in row of original text can be painted just after last row of inset ends. This implementation should also take into account special cases like inserting a table into insets. Implementation: This is overview of implementation First of all metrics related to insets will be recalculated.This will require change in mainly InsetText.cpp (methods like InsetText::dimension, InsetText::metrics). Then new shape will be drawn according to new dimensions and metrics. New shape will be polygon and it will require implementation of drawPolygon and fillPolygon using Qt in GuiPainter.cpp and draw methods in InsetText.cpp and may be in other classes. Next main problem is to make inset fit into current row. It will require modification in most methods of mainly Textetrics, RowPainter, ParagraphMetrics, paragraph classes. I am starting to write my proposal now as application submission deadline is just two days away, so give me any suggestions if I am missing any major point. I will try to add more technical details with better explanation probably with examples in proposal. Thank You.