Results 1 to 6 of 6

Thread: Issue with using layout in custom widget plugins (Qt 5.1)

  1. #1
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Issue with using layout in custom widget plugins (Qt 5.1)

    Hi,
    I’ve written a custom widget plugin for QtDesigner and I’ve used layout system to arrange elements in the plugin. But when i use this plugin in forms, the layout system of the plugin won’t works correctly. What am i missing?! Is the plugins supports layout system?
    Thanks

  2. #2
    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: Issue with using layout in custom widget plugins (Qt 5.1)

    Quote Originally Posted by alizadeh91 View Post
    the layout system of the plugin won’t works correctly.
    What do you mean?

    Is the plugins supports layout system?
    The plugin doesn't care about internals of your widgets.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Issue with using layout in custom widget plugins (Qt 5.1)

    Suppose i want to put a comboBox besides a lineEdit in plugin and whenever expands it in a form, the lineEdit expands to fill extra spaces. If i put them in layout, when i use this layout in forms then this happens:
    Untitled-4.png
    What am i missing?

  4. #4
    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: Issue with using layout in custom widget plugins (Qt 5.1)

    What did you set the horizontal size policy of the line edit to?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jan 2012
    Location
    Iran, Tehran
    Posts
    308
    Thanks
    75
    Thanked 24 Times in 21 Posts
    Qt products
    Qt4 Qt5 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Issue with using layout in custom widget plugins (Qt 5.1)

    I've set QSizePolicy::Expanding for lineEdit with a high maximumWidth and a fixed size policy for comboBox and nothing is between them. An i'm so confused because when i create these combination in a simple form (not using plugin) the layout works like a charm but when i create the layout in plugin the plugin won't works correctly.


    Added after 10 minutes:


    I'll will attach an example tomorrow.
    Last edited by alizadeh91; 27th August 2013 at 16:50.

  6. #6
    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: Issue with using layout in custom widget plugins (Qt 5.1)

    Quote Originally Posted by alizadeh91 View Post
    I've set QSizePolicy::Expanding for lineEdit with a high maximumWidth and a fixed size policy for comboBox and nothing is between them.
    Why did you set a maximum width for it? Where do those large margins in your attachment come from?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Adding custom widget to an existing layout
    By santana in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2010, 18:29
  2. problem/error in adding custom widget plugins
    By miroslav_karpis in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 08:53
  3. resizing events of a custom widget in a layout
    By Rooster in forum Qt Programming
    Replies: 7
    Last Post: 16th February 2008, 11:52
  4. Qt4 widget and nested layout issue.
    By bunjee in forum Qt Programming
    Replies: 12
    Last Post: 18th January 2007, 21:29
  5. about custom widget plugins
    By hesummar in forum Qt Tools
    Replies: 16
    Last Post: 1st December 2006, 02:59

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.