Results 1 to 6 of 6

Thread: Which is the best way to make a fluid user interface in QT?

  1. #1
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Which is the best way to make a fluid user interface in QT?

    I make a program with many buttons on it, I created a main widget, on this widget I created 3 widgets to split them to 3 parts: Header, Footer, and Body; I’m using Horizontal Layouts on each widget to align to center and auto correct size of the buttons. Each button I use an image instead default QT button.

    When the form resizing, I use a function to resize image of each button and the result feel good to this point. But, I can’t resize the buttons bigger than original image size, such as: My original image size is 20 by 20 px, I can’t resize the button bigger than 20 by 20 px.

    Help me resolve this problem. Thanks!

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

    Default Re: Which is the best way to make a fluid user interface in QT?

    But, I can’t resize the buttons bigger than original image size, such as: My original image size is 20 by 20 px, I can’t resize the button bigger than 20 by 20 px.
    Why not?
    How are you resizing?
    QPixmap::scaled() should do that.
    It probably wont look good, but you certainly can resize the image beyond its original size.
    Why not use images with the maximal size that you will need, this way it will also look good.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Which is the best way to make a fluid user interface in QT?

    Can you make do without those images somehow? You can design really good looking buttons using style sheets and they will continue to behave nicely in layouts.

  4. #4
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Which is the best way to make a fluid user interface in QT?

    Quote Originally Posted by high_flyer View Post
    Why not?
    How are you resizing?
    QPixmap::scaled() should do that.
    It probably wont look good, but you certainly can resize the image beyond its original size.
    Why not use images with the maximal size that you will need, this way it will also look good.
    The problem is my buttons added to a layout (I set image as button icon), I don’t need to write any functions to resize them, they will auto resize with layout.

    My program has to run well on different biggest monitor as full screen. So I don’t know which maximum size for it.

    Can you give me any idea to make fluid UI on QT for this case?

    Quote Originally Posted by Cruz View Post
    Can you make do without those images somehow? You can design really good looking buttons using style sheets and they will continue to behave nicely in layouts.
    Yeah. I have CSS experiments, but depend on graphic design, I can’t do like you said.

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

    Default Re: Which is the best way to make a fluid user interface in QT?

    My program has to run well on different biggest monitor as full screen. So I don’t know which maximum size for it.
    Ok, but there is some maximal size that you can be sure that the application wont exceed.
    Use images in that maximal size, and it will also solve your problem with resizing.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  6. #6
    Join Date
    Mar 2010
    Posts
    68
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Which is the best way to make a fluid user interface in QT?

    Thank you very much! For now, that is good way I can do.

Similar Threads

  1. Using SVG as user interface for fast prototyping
    By benlau in forum Qt Programming
    Replies: 1
    Last Post: 8th January 2010, 12:01
  2. Customizing UIC (User Interface Compiler)
    By Thalionath in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2009, 17:53
  3. Regarding Database Display through user interface
    By Tavit in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2008, 10:32
  4. User Interface with QTableView
    By Brandybuck in forum Qt Programming
    Replies: 1
    Last Post: 22nd March 2006, 23:24

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.