Results 1 to 6 of 6

Thread: Custom widget, dealing with resize the right way?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Custom widget, dealing with resize the right way?

    Why don't you derive from QGroupBox? You'd have one level of hierarchy less...

    Q_PROPERTY is documented. Open Assistant and type in Q_PROPERTY into the index tab.

  2. The following user says thank you to wysota for this useful post:

    Ishark (26th May 2008)

  3. #2
    Join Date
    Jul 2007
    Posts
    11
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: Custom widget, dealing with resize the right way?

    Right, I'll derive directly from GroupBox.
    I've never used assistant and I've installed it. It does indeed document Q_PROPERTY.... is the documentation found there identical to the website?

    I'm also having a very weird behaviour with my widget. If I use a GroupBox to group my buttons/labels and redefine mousePressEvent to trap mouse events (not the one on buttons of course) then I never get a single event. If I replace the GroupBox with a Frame then I get the events. Is there some fundamental difference between the two? They used to work the same way in Qt3.

    I'll try to derive directly from GroupBox to see if it changes anything.

    EDIT: it does, when deriving from GroupBox I get the events as expected.
    Last edited by Ishark; 23rd May 2008 at 14:53.

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Custom widget, dealing with resize the right way?

    Quote Originally Posted by Ishark View Post
    I've never used assistant and I've installed it.
    It's shipped together with Qt.

    It does indeed document Q_PROPERTY.... is the documentation found there identical to the website?
    Yes.
    J-P Nurmi

Similar Threads

  1. resizing events of a custom widget in a layout
    By Rooster in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2008, 10:52
  2. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  3. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38
  4. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  5. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00

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.