Results 1 to 5 of 5

Thread: Problem with custom container widget

  1. #1
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with custom container widget

    Hi,

    QT 4.3 on windows.

    I have created a custom widget for use in QT Designer.
    This is intended as a collapsible groupbox. The .ui form
    previews and operates correctly in QT Designer. An image is attached.

    The plug-in also correctly appears in mt QT Designer toolbox
    and I can move it onto a form, preview the form and that works.

    This is intended to be a container widget in that controls may
    be moved onto it and placed in a layout. I am returning true
    in my isContainer() routine.

    My widget will allow me to place items on it. Radio buttons
    for example. I then select the radio buttons and apply a
    layout. The red rectangle appears. I then resize with the
    mouse and as soon as I let go of the selection QT Designer
    crashes.

    It's happy with the radio buttons if I don't attempt to
    place them in their own layout.

    I have tried using both a QWidget and a QFrame as my container
    portion of my widget. Both yield the same results.

    Any ideas?

    Thank you

    Mark
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with custom container widget

    Do you set any layout(in the plugin) for the container widget?
    Try saving the ui(without resizing it) after you apply the layout and then compile it with uic and take a look at the resulting source.
    See if everything is in order.

    Regards

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with custom container widget

    Can you use the widget properly from within manualy written code and not Designer?

  4. #4
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with custom container widget

    I am able to add controls to my control if I do it manually and not from QT Designer.

    In fact as soon as I place anything on my container control QT Designer crashes.

    Any ideas?

  5. #5
    Join Date
    Mar 2007
    Posts
    74
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem with custom container widget

    This seems to have been a result of applying
    A Grid layout to the overall control as the final step. I changed it to a Vertical layout and
    That seemed to take care of it.

Similar Threads

  1. Problem applying setWindowOpacity to a custom Widget
    By yellowmat in forum Qt Programming
    Replies: 8
    Last Post: 1st November 2006, 10:05
  2. Replies: 3
    Last Post: 12th April 2006, 08:20
  3. Problem reimplementing QSpinBox in a custom widget
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 30th March 2006, 08:12
  4. Problem with custom widget
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 15th March 2006, 11:55
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.