[Qt-interest] insertFrame() without blank line?

Israel Brewster israel at frontierflying.com
Fri Mar 27 23:36:48 CET 2009


I am trying to achieve what is basically a two-column QTextEdit, with  
the left column being left justified, and the right column being right  
justified. So far, I have attempted to do this by using the  
QTextCursor::insertFrame() function, with the TextFrameFormat position  
set to "FloatRight". Here's the code:

QTextFrame * topFrame=cursor.currentFrame();
QTextFrameFormat rightFormat;
rightFormat.setPosition(QTextFrameFormat::FloatRight);
rightFormat.setWidth(15);
cursor.movePosition(QTextCursor::Start);
QTextFrame *rightFrame=cursor.insertFrame(rightFormat);

I then populate the top frame and right frame. This works as desired,  
with one caveat: when I insert the right frame,  it also inserts a  
blank line above the right frame. I want the frame to be at the top of  
the document, not one line down. How can I get rid of the extra line?  
Thanks.

-----------------------------------------------
Israel Brewster
Computer Support Technician II
Frontier Flying Service Inc.
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7250 x293
-----------------------------------------------






More information about the Qt-interest-old mailing list