PDA

View Full Version : do the QGraphicsTextItem have a function to set the cursor width?



robertkun
7th August 2009, 04:18
void QTextEdit::setCursorWidth(int width)
{
Q_D(QTextEdit);
d->control->setCursorWidth(width);
}

In the QTextEdit class there have a function to set the Cursor'width for the user.

But In the QGraphisTextItem there is nothing .

How can I to change it ? thanks.

yogeshgokul
7th August 2009, 07:15
There is no straight way, you my need to sub class QTextCursor and change the paintEvent.
Then set this customized cursor to your QGraphicsTextItem by calling this method:

QGraphicsTextItem::setTextCursor ( const QTextCursor & cursor );
But the effort not worth, why this cursor width is so important ?

Can you please tell me what is this? Is this some kind of advance programming or what ?:):)



Q_D(QTextEdit);
d->control->setCursorWidth(width);

robertkun
10th August 2009, 06:12
But the effort not worth, why this cursor width is so important ?

Can you please tell me what is this? Is this some kind of advance programming or what ?

oh , I am developing a project likes the soft of the pemier( video edit ),
when you want to input some text ,there have a problem ,the cursor in the edit too thin to find it ...
so it is a trouble .