Results 1 to 5 of 5

Thread: Size of a plugin widget in designer

  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Size of a plugin widget in designer

    Hi,

    Qt4, linux.
    I have made a designer plugin.
    But when I pick it from the plugin panel, its size is a defalut size, which I would like to change.
    I tried to resize it in my plugin wrapper clss before the instance of the widget is returned, but that has no affect.
    I am reading the docs about it at the moment , but if any one can point me to the right direction to save me some time I will appreciate it.

    Thanks.

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

    Default Re: Size of a plugin widget in designer

    Could you explain the situation a bit more? You can't resize a widget once it's placed on a form? Did you use layouts while designing it?

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Size of a plugin widget in designer

    What I mean is, when you pick a widget from the widget panel, it pops under your cursor for you do drag and drop it on a form.
    I managed to have it the size I want once dropped on the form.
    But I can't seem to control its size during the "drag" faze from the panel to the form.
    For example, if you look at the worldclock example, once you click on it, it apears in a 200x200 rectangle.
    If you look at the code, TT just made resize(200,200) in the clocks constructor.
    There is no other sizing code in the plugin inplementation or the base clock class (that I can see).
    If I use resize() in my plugins base class it has no effect, nor when I do it in the plugin implementation class in createWidget().
    So far I could not find what am I doing wrong, and why in my case the widget ignores the resize() in the costructor when it clearly works for the clock example...

    Thanks.

    EDIT: no layout is used for the widget, its just one widget.

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

    Default Re: Size of a plugin widget in designer

    I guess the size during the drag is taken from the sizeHint of the widget.

  5. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Size of a plugin widget in designer

    I figured it out.
    You can set it in the xml code in the domXml() of your plugin class.

Similar Threads

  1. Simple custom widget won't size properly
    By MrGarbage in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 13:12
  2. Replies: 4
    Last Post: 9th August 2007, 08:20
  3. QPluginLoader not recognizing a plugin
    By KShots in forum Qt Programming
    Replies: 3
    Last Post: 29th June 2007, 14:13
  4. Replies: 13
    Last Post: 15th December 2006, 11:52
  5. Managing widget plugin in Qt Designer
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 31st January 2006, 09:58

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.