Results 1 to 10 of 10

Thread: Differencies between Qt designer preview and ui file

  1. #1
    Join Date
    Jun 2009
    Posts
    21
    Qt products
    Platforms
    Unix/X11 Windows

    Default Differencies between Qt designer preview and ui file

    I built window using Qt designer 4.3.2 and converted resulted ui file using pyuic4. But converted ui doesn't look like this showed by Qt designer preview. Below are two screenshots. One is from Qt designer and the second is resulting PyQt window. Why is this happening ?
    Attached Images Attached Images
    Last edited by shadowfax; 24th June 2009 at 21:42.

  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: Differencies between Qt designer preview and ui file

    please attach the images at the forum that your post stays consistent.

    Seems like a bug in pyuic4, that the padding property in inline layouts is not transformed correctly. how does the generated h file look like?

  3. #3
    Join Date
    Jun 2009
    Posts
    21
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Differencies between Qt designer preview and ui file

    Here is resulted py file.
    Attached Files Attached Files

  4. #4
    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: Differencies between Qt designer preview and ui file

    it's like i thought, there are no setting for spacing or margin for the layouts. I guess you have altered them to 0 inside your splitters. If so, send that result with the original ui to the mailing list of pyqt, since that is no error of Qt rather in the python bindings.

  5. #5
    Join Date
    Jun 2009
    Posts
    21
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Differencies between Qt designer preview and ui file

    So how can I lay the bottom listWidget properly ? Is there any workaround for this ?

  6. #6
    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: Differencies between Qt designer preview and ui file

    you can set the spacing and margin by hand after you called the setupUi function. to get the layouts you can use QObject::findChild().

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

    Default Re: Differencies between Qt designer preview and ui file

    It seems your PyQt installation is older than your Qt installation and pyuic is lagging behind uic in terms of functionality. Try upgrading PyQt.
    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.


  8. #8
    Join Date
    Jun 2009
    Posts
    21
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Differencies between Qt designer preview and ui file

    I think I'm doing something wrong I updated PyQt to 4.5.1 and tried this ui both in Linux and Windows. The problem still exists. Here's my ui file.
    Attached Files Attached Files

  9. #9
    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: Differencies between Qt designer preview and ui file

    Ok, since you don't set explicit the margins and spacings for the layout, the designer and your app have obviously different default values for that.
    So set the margins explicit in the designer (the name of the property is then bold; If already 0, change to 1 and back.)

  10. #10
    Join Date
    Jun 2009
    Posts
    21
    Qt products
    Platforms
    Unix/X11 Windows

    Default Re: Differencies between Qt designer preview and ui file

    Thanks! Everything works perfect right now.

Similar Threads

  1. designer 4.5 widget preview (plastique)
    By janus in forum Qt Tools
    Replies: 3
    Last Post: 21st April 2009, 12:30
  2. File Open dialog with preview?
    By will49 in forum Qt Programming
    Replies: 2
    Last Post: 24th July 2007, 19:08
  3. preview file dialog
    By mickey in forum Qt Programming
    Replies: 11
    Last Post: 22nd April 2006, 00:03
  4. Replies: 4
    Last Post: 24th March 2006, 23:50
  5. Qt Designer 4.0.1 Preview Colors
    By jtyler in forum Qt Tools
    Replies: 2
    Last Post: 14th February 2006, 16:47

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.