Page 4 of 4 FirstFirst ... 234
Results 61 to 70 of 70

Thread: Qt 4.3.0 lots of Bugs!

  1. #61
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    Quote Originally Posted by VireX View Post
    Qt Stylesheet example is written that way, granted it's old code, but I'm sure a 1000 other people used border-image the way i used it, by simply looking at a Qt example. By removing the "bug" and fixing it so that it doesn't stretch properly anymore, then you're saying that it's ok to upset 1000 coders to satisfy another 1000 coders who use border-image the correct way, without making an extra feature to make both the 1000 coders happy.
    Others have already told you what I'm about to tell you, but I'll tell you anyway. Seems like it can't be repeated enough (and I will repeat a lot).

    It wasn't a "bug", it was a bug! A real one. Much more real that the bug you're claiming. Believe it or not: the border-image didn't stretch correctly in 4.2.3, but it does in 4.3.0.

    People who used border-image for what it was intended for, which is to provide a border image, got bad results in 4.2.3 because the image was stretched incorrectly. The corners were hideous, and people all around the world were very unhappy.

    The border-image property was never intended to be used to set a background image. That's what background-image is for. Unfortunately for you background-image doesn't do what you want it to do, but that doesn't prove that the 4.3.0 behaviour of border-image is wrong. Once again: border-image was broken in 4.2.3 and it was fixed in 4.3.0. Fixing this was the correct thing to do.

    Everyone who use border-image for what it is intended for, which is to provide borders without repulsive corners, are now happy because the corners are no longer looking nasty. Everyone who depend on the border-image bug in 4.2.3 as a hack to get stretched backgrounds are unhappy, but seriously, and please be honest now, do you really think that Trolltech should keep bugs in Qt so that people who are depending on these bugs will stay happy? Shouldn't they fix the bugs so that everyone who uses the feature for what it is intended for will be happy?

    Your problem isn't that border-image don't stretch any more. Your problem is that background-image don't stretch. It never did and that is why you did your border-image hack in the first place. Let me repeat: the problem you are experiencing now is caused by a hack, this hack depends on a bug in 4.2.3, the hack was written by you and it's located in your code! It worked with 4.2.3, but it doesn't work with 4.3.0 and that's something you simply have to accept.

    Now there are several alternatives for how you can handle this, but considering your rejection of the suggestions you already got from others I won't tell you unless you ask.

    And just for curiosity: did you report this to Trolltech yet? If they tell you that this indeed is a bug and that border-image will be changed to stretch the image for 4.3.1, complete with appalling corners and everything, I'll not only eat my hat, but I'll also help you with building all future beta versions of Qt so that you can find the bugs and report them to Trolltech before the final releases.

    Good day.

    (Edit: the f-word replaced with something milder)
    Last edited by mm78; 13th June 2007 at 23:16.

  2. #62
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    People who used border-image for what it was intended for, which is to provide a border image, got bad results in 4.2.3 because the image stretched. The corners got fucked up. They were very unhappy.
    Oh yeah. You mean the corners were "nasty"?
    This is my first post in this thread...

    I'm really curious what will happen next. This is like a miniseries.

    Another thing: does this mean we can use the f word regularly from now on?

    EDIT: Looks like we can say it after all, but only if we are really mad: http://www.qtcentre.org/forum/f-qt-p...highlight=fuck
    Last edited by marcel; 13th June 2007 at 22:00.

  3. #63
    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: Qt 4.3.0 lots of Bugs!

    Quote Originally Posted by marcel View Post
    Oh yeah. You mean the corners were "nasty"?

    Another thing: does this mean we can use the f word regularly from now on?
    We don't do any censoring but the rules of good behaviour and personal culture suggest you shouldn't. I was even thinking about asking the author of those words to use kinder words next time, but I'm a little fed up with this thread. I'm reading few others that are really interesting and making up strange parallels about flying planes on the ground. I think I'll even post something to my blog... (yeah! a short remark about my private site! Maybe someone finally comes to visit it!)

    EDIT: Looks like we can say it after all, but only if we are really mad: http://www.qtcentre.org/forum/f-qt-p...highlight=fuck
    Please don't

  4. #64
    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: Qt 4.3.0 lots of Bugs!

    Maybe someone finally comes to visit it
    I read it from time to time (when I have the time)
    ==========================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.

  5. #65
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Talking Re: Qt 4.3.0 lots of Bugs!

    Can you verify that the following code gives you what you want?

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char *argv[])
    4. {
    5. QApplication app(argc, argv);
    6. app.setStyle(QApplication::setStyle("Plastique")); // not related to bug prolly
    7. QDialog* qddd;
    8. qddd = new QDialog;
    9. QPushButton* qb = new QPushButton("Test", qddd);
    10.  
    11. // Changed these three lines
    12. qb->setMinimumSize(QSize(66, 47));
    13. qb->setMaximumSize(QSize(66, 47));
    14. qb->setStyleSheet("border-image: url(test.png) 0 0 0 0 stretch; border-width: 2;");
    15.  
    16. qddd->show();
    17. return app.exec();
    18. }
    To copy to clipboard, switch view to plain text mode 

    Works like a charm with Qt 4.3.0 on my Linux box.

    All I did was read the Qt 4.3.0 Documentation and follow the link to the CSS Draft Specification for details.

    Note that this code is still using border-image, so it's still not the correct thing even if it works. It can break in the future. The correct code would use background-image in combination with background-size. Check the CSS Specification for details. Unfortunately Qt 4.3.0 (nor 4.2.3) doesn't support the background-size property (yet). This you can report to Trolltech as a feature suggestion and they might add support for it in the future.

    Note that because of the border-width property I've added 4px to the image width and height. If you shrink the button smaller than this size it won't look nice. I'm sure the same is the case with Qt 4.2.3.

    I hope this makes up for using the f-word in an earlier post.
    Last edited by mm78; 14th June 2007 at 01:08.

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

    VireX (14th June 2007)

  7. #66
    Join Date
    Jan 2007
    Posts
    209
    Thanks
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    Thank you so much mm78, for providing a solution. Although those settings don't quite work for me, they are basically the same method I used to fix the problem.

    But before your post I have figured out one solution, instead of using border-image hack in 4.2.3, I will now use border-image hack in 4.3.0... border-image "hack/bug" still works, only thing you have to do is play with the border-width a little bit to get the correct fitting border on the background image.

    Qt Trolltech didn't say border-image was a bug in 4.2.3 NOR 4.3.0, just a matter of fixing up 4.3.0 so that it works better, the developer told me to use background-image, which was a pathetic substitute for the great border-image. But I will definitely wait quite a while before I upgrade to 4.3.1 >_<, unless something draws me in like 4.3.0 did, and I will definitely make sure any CSS changes are precisely studied before I "switch" again.

  8. #67
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    In which way don't they work?

    The four zeroes in:

    Qt Code:
    1. qb->setStyleSheet("border-image: url(test.png) 0 0 0 0 stretch; border-width: 2;");
    To copy to clipboard, switch view to plain text mode 

    circumvents the "cutting in 9 and scale the centre" feature by defining the whole image as the centre. Unless you do this I suspect you can fiddle as much as you want with the image size and borders, but nonetheless the image will be cut in 9 and stretched in a way you don't want it to be stretched in.

    There is nothing pathetic about background-image, and as earlier said it's the correct thing. The real problem here is the missing support for background-size in Qt. Read the CSS spec!
    Last edited by mm78; 14th June 2007 at 01:33.

  9. #68
    Join Date
    Jan 2007
    Posts
    209
    Thanks
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    Yeah, I understand what you were trying to do, but when I tried it, it didn't quite work out the way i wanted :S, but putting 12 stretch; made it work... I use to have 3 stretch; in 4.2.3

  10. #69
    Join Date
    Jan 2007
    Posts
    209
    Thanks
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    I apologize for reviving this old thread, but I wanted to apologize for the arguments.

    Border-Image bug

  11. #70
    Join Date
    Oct 2006
    Posts
    42
    Thanks
    1
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt 4.3.0 lots of Bugs!

    Sweet, just but be aware that the image will still be cut into nine parts and stretched appropriately if necessary, so how your buttons end up looking depends on the image and the numbers you provide to border-image and border-width, and how you scale your buttons.

    I suggest you download the latest 4.3.1 snapshot and try it yourself. I also suggest you read this if you didn't already.

Similar Threads

  1. Help needed handling image data
    By toratora in forum General Programming
    Replies: 2
    Last Post: 11th May 2007, 10:24
  2. how i can add image in my toolbar
    By jyoti in forum Qt Tools
    Replies: 7
    Last Post: 19th December 2006, 15:39
  3. Fast image drawing/scaling in Qt 3.3
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 11:45
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 17:36
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 20:01

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.