Results 1 to 3 of 3

Thread: do the QGraphicsTextItem have a function to set the cursor width?

  1. #1

    Lightbulb do the QGraphicsTextItem have a function to set the cursor width?

    Qt Code:
    1. void QTextEdit::setCursorWidth(int width)
    2. {
    3. Q_D(QTextEdit);
    4. d->control->setCursorWidth(width);
    5. }
    To copy to clipboard, switch view to plain text mode 

    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.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: do the QGraphicsTextItem have a function to set the cursor width?

    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:
    Qt Code:
    1. QGraphicsTextItem::setTextCursor ( const QTextCursor & cursor );
    To copy to clipboard, switch view to plain text mode 
    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 ?
    Quote Originally Posted by robertkun View Post
    Qt Code:
    1. Q_D(QTextEdit);
    2. d->control->setCursorWidth(width);
    To copy to clipboard, switch view to plain text mode 

  3. #3

    Smile Re: do the QGraphicsTextItem have a function to set the cursor width?

    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 .

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. Regading Driver to connect Postgresql Database
    By dummystories in forum Installation and Deployment
    Replies: 38
    Last Post: 12th March 2009, 07:19
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  4. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.