Page 3 of 3 FirstFirst 123
Results 41 to 54 of 54

Thread: Still need help: Best way to have application "skins"?

  1. #41
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default

    How do I have multiple border images, ie some images have to be fixed size while the others have to stretch.

    My form has to be dynamic, different fonts are used on different OS's, so I can't create one big image...
    Last edited by wysota; 24th February 2008 at 16:20. Reason: Posts merged

  2. #42
    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: Still need help: Best way to have application "skins"?

    Quote Originally Posted by codeslicer View Post
    How do I have multiple border images, ie some images have to be fixed size while the others have to stretch.
    See the docs for border-image.

  3. The following user says thank you to wysota for this useful post:

    codeslicer (24th February 2008)

  4. #43
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Still need help: Best way to have application "skins"?

    Wow, I guess that's why you're a guru

    Thanks a lot =]

    I guess I'll still use the functions setPlainMode() and setFancyMode() and based on that set and remove masks, etc.

    How would I set masks on the border image though? And would the "stand" (See picture in previous post) be put in the border image, or should it be seperate? Thanks again

  5. #44
    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: Still need help: Best way to have application "skins"?

    Quote Originally Posted by codeslicer View Post
    How would I set masks on the border image though?
    You mask widgets, not images.

    And would the "stand" (See picture in previous post) be put in the border image, or should it be seperate?
    Yes, it can be part of the border image. You can obtain the shape you want using setMask.

  6. The following user says thank you to wysota for this useful post:

    codeslicer (24th February 2008)

  7. #45
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Wink Re: Still need help: Best way to have application "skins"?

    Ok, then how would I mask the border-image widget?

  8. #46
    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: Still need help: Best way to have application "skins"?

    Mask the top level widget (window). Of course you need to calculate the mask first, but it shouldn't be hard.

  9. The following user says thank you to wysota for this useful post:

    codeslicer (24th February 2008)

  10. #47
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Still need help: Best way to have application "skins"?

    I don't think this will work, because, the buttons at the bottom of the monitor will stretch. Take a look at that screenshot on page 2. But that's a nice idea, if I didn't have to worry about scaling, then that would have been the ideal solution.

    I'm thinking of using QWidget->hide() on each of those image labels, what do you think, will that work?

    Thanks for helping me out, my lack of explanation skills keeps requiring more and more solutions

  11. #48
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Still need help: Best way to have application "skins"?

    You may use QStyle and make usage of polish() / unpolish() methods to set/unset masks etc.
    It would be more flexible when you'll be adding more styles in future (u have all style stuff in single class & you don't have to remember about changes in lots of places in entire application code).

    I'm using single style for skins effect that gets images path in constructor and styleplugin searches skins directory and creates an instance of the same style for different images set.
    It causes that adding new skins doesn't require coding, just some painting job.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  12. #49
    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: Still need help: Best way to have application "skins"?

    Quote Originally Posted by codeslicer View Post
    I don't think this will work, because, the buttons at the bottom of the monitor will stretch.
    Not necessarily. If you get the cuts right and combine it with setting the border size on each edge it might just work.

  13. The following user says thank you to wysota for this useful post:

    codeslicer (25th February 2008)

  14. #50
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Still need help: Best way to have application "skins"?

    Quote Originally Posted by wysota View Post
    Not necessarily. If you get the cuts right and combine it with setting the border size on each edge it might just work.

    The form resizes based on its contents, so I can't have fixed size.

  15. #51
    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: Still need help: Best way to have application "skins"?

    Read again how border-image works. Pay special attention to the parameters. Read about border-width as well.

  16. The following user says thank you to wysota for this useful post:

    codeslicer (25th February 2008)

  17. #52
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Still need help: Best way to have application "skins"?

    Yes, I read it. It's just that the buttons and stand will stretch to the right and left, horizontally. Oh well, the stretch probably won't be more than a few pixels.

    To understand better, attached is the ui form + resources...

    Please do not copy/use those images in your applications (Although I doubt you will need to)
    Last edited by marcel; 27th February 2008 at 03:13. Reason: removed attachmets at user's request

  18. #53
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Still need help: Best way to have application "skins"?

    *Bump*

    Border image doesn't have a middle image that doesn't stretch right?

  19. #54
    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: Still need help: Best way to have application "skins"?

    I think it does. But if it doesn't work, use background-image.

Similar Threads

  1. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 19:37
  2. Application deployment problem
    By shapirlex in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 13th April 2007, 01:11
  3. Replies: 3
    Last Post: 8th December 2006, 19:51
  4. Replies: 3
    Last Post: 31st March 2006, 19:38

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.