Results 1 to 2 of 2

Thread: QLCDNumber problem

  1. #1
    Join Date
    Sep 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QLCDNumber problem

    Dear everybody,

    I would like to write a class which is able to show a LCD number
    and some text outside the LCD number frame. Since I want to
    handle only one class to do that, my class is derived from
    QLCDNumber and I've reimplemented its paint event in order to
    draw the text. The LCD number shows correctly since my first
    instruction of the reimplemented paint event is
    QLCDNumber:aintEvent (event), but I'm not able to see
    the text because the QLCDNumber's paint device doesn't
    draw outside its area.

    Is my assumption correct ? Could you suggest me a way to draw
    my text ?

    Best Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QLCDNumber problem

    reimp sizeHint() and add there the space you need to draw. Or simply make a class which consists of a label and lcd number arranged in a layout. Provide some setter and getter functions and all is fine.

Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

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
  •  
Qt is a trademark of The Qt Company.