Results 1 to 5 of 5

Thread: alternative to qtextedit

  1. #1
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default alternative to qtextedit

    I have a series of custom widgets that I use to draw graphs on. I also resize them with a series of zoom in and zoom outs. However, when I insert the qtextedit widget in there everything seems to go crazy. When I try to resize all the graph widgets disappear. I use the qtextedit widget for debugging but ultimately it will be used to display information about the graphs. Is there something else that I could use to out text on to using QStrings?

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: alternative to qtextedit

    mmmm... Not very clear.
    Do you mean you've created some sort of graph (presumably in a QGraphicsView) and at some point you add a QTextEdit to the scene (a bit crazy)? Or do you add it in a layout close to the view (recommended)? Or is it something else?

    edit : seeing the "Qt3" tag I suppose you're using QCanvas instead but I'm pretty sure the above still stand.
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: alternative to qtextedit

    I am using qt4 and what I have is a custom widget that has a paint event that draws the graphs. The QTextEdit is in a layout below the graphs. When I remove it from the qui everything works fine, but when I include it everything goes to crap.

    Hope this helps explain things.

  4. #4
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: alternative to qtextedit

    So you insert a QTextEdit, which causes a resize of all previously inserted widget according to the layout policy and then your widget looks bad that's it?

    Have you tried resizing your graph widget on the fly (without having the text edit inserted)? Most likely it will lead to the same drawing problems which indicates that there is something wrong in your drawing code (not taking reacting to resize events, not taking widget size into account when drawing, ...)
    Current Qt projects : QCodeEdit, RotiDeCode

  5. The following user says thank you to fullmetalcoder for this useful post:

    Rooster (7th August 2008)

  6. #5
    Join Date
    Feb 2008
    Posts
    25
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: alternative to qtextedit

    I went back and took a look at how I was doing the resizing and played around with that and now everything works.

    Thanks

Similar Threads

  1. QTextEdit and cursor
    By newplayer in forum Qt Programming
    Replies: 1
    Last Post: 30th July 2008, 23:24
  2. QTextEdit slow to insert text
    By thomaspu in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2008, 12:05
  3. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  4. [QT 4] QTextEdit performance
    By fellobo in forum Qt Programming
    Replies: 8
    Last Post: 6th March 2006, 19:27
  5. Obtaining clean (x)html from QTextEdit
    By ccf_h in forum Qt Programming
    Replies: 1
    Last Post: 5th February 2006, 14:47

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.