
Originally Posted by
VireX
But background-image is still bugged
It's not bugged. I could agree that it's not very mature, but certainly not bugged. At least not based on what you have just written.
I programmed in CSS for years before getting into programming, they dont use border:none; to display the image, this is indeed an odd feature of trolltech not a standard of CSS.
Correct me if I'm wrong, but in most cases "none" is a default value for "border" property in CSS. Qt behaves differently than CSS for HTML, because it handles something quite different so you can't expect everything to work exactly the same. This is relatively new technology and it's probably the only toolkit supporting such an approach. It has to take some time to make every aspect work. I could point many much more annoying "features" in QSS than the necessity to use border: none;
Now I have no way to stretch the image so that it looks like border-image in 4.2.3.
Why do you want to stretch an image for a fixed size button?
Since border-image was used in 4.2.3 I assumed my code was correct
Yes, we know you did. That's what we told you at the very beginning.
and indeed it was correct for 4.2.3
No, it was just working. If I do:
char *ptr = str.toByteArray().data();
printf("%s\n", ptr);
QString str = "xxx";
char *ptr = str.toByteArray().data();
printf("%s\n", ptr);
To copy to clipboard, switch view to plain text mode
it will work, but it won't be correct. It makes use of an unreliable assumption that nothing will overwrite the memory containing the char * data between two last lines of the above code. But if something DOES overwrite it (for example when using threads or having many very busy processes or just having bad luck), it will break.
this still is not my faulty code, because they suddenly changed it in 4.3.0 without any warnings.
I'm almost sure the changelog lists that "border-image" has been fixed. Would you expect a big message "Hey all you people who use border-image in an incorrect way - you code might break in 4.3 because we fixed that nasty bug in border-image causing blablabla..."?
4.3.0 has the least bugs because its only like 12 days old, what did you expect?
I expected you to bring up that argument and you did
Most bugs are reported at the very beginning, that's one thing and the other is that the number of reported bugs should be calculated relatively to amount of new code in the product in question. That's why "0" revisions have the most bugs - they introduce the most new features. I don't expect Qt 4.3 to be in any way different from 4.2.2, 4.2.0 and 4.1.0 - they all introduced new features and they have the most bugs. But I doubt 4.3.0 will have more bugs reported than 4.2.2 
Wait about a month and you'll see it will surpass all the previous versions.
I'm pretty sure it won't, especially that summer holidays are coming and people won't write as much code as during the rest of the year thus they will not be reporting problems. I also assume Trolltech will want to release a new (fixed) version of Qt before DevDays, so some of the bugs will be discovered in 4.3.1 or later.
I was not using border-image incorrectly according to Qt and Trolltech at v4.3.0
You were using it incorrectly. The property is to supply borders and scalable centre and that's exactly what it does.
I was using it incorrectly according to CSS standard yes, but since it worked in 4.2.3, I decided to stick with it, no one said "we're changing border-image in 4.3.0 so you're gonna have to remove many of your border-image and replace with background-image".
True. And no one said "don't use QPrinter to bake muffins". Why would anyone have to warn you about using code that simply doesn't fit to what you do?
In fact Stylesheet example still uses border-image, so stop saying I have incorrect code.
You have incorrect code and the stylesheet example is old and buggy. It will be replaced with a new one - Trolls are already working on that. And hey! somehow I know about it even though I didn't cry "Stylesheet example is buggy!". Trolltech has some channels of communication with its clients and users. If you don't use them, don't blame Trolls for that.
I am not blaming compiler differences, I'm blaming environment differences.
Like what differences?
That code has reproduced the pixelation bug in several people's Qt compilers. Not yours because you have a DIFFERENT VERSION OF QT
Nope 
and a DIFFERENT OPERATING SYSTEM
So? You think there are any platform dependent issues involved in border-image?
Take a look at src/gui/styles/qstylesheetstyle.cpp at methods cutBorderImage() and drawBorderImage() and tell me which parts of code may be influenced by the operating system or the compiler or any other "environment" difference. The only thing that might be influencing my system is that my version of Qt could have been patched before being packaged. But I don't think this is the case.
The only thing that might have influence is the one I tried to explained a few posts before.
how can you possibly say that Qt reacts exactly the same in all situations.
Because I read its source code when I want to learn how it works
Use my environment, since your profile says you do have Windows XP,
No, my profile doesn't say anything about Windows XP. It says "Windows", not "Windows XP".
Till then, dont argue with me, until you proven me wrong about the bug.
But there is no bug... I thought we agreed to that
You were using border-image incorrectly.
I am not a liar as you claim.
Hmm... where do I claim such things?
It's like you're afraid to admit that border-image is rendered differently between 4.2.3 and 4.3.0
I admit, border-image may be rendered differently in 4.2 and 4.3. But it's not a bug in 4.3 but in 4.2.
NO, it was, you said "oh btw i fixed your code" and thats all you changed.
No, you were using a dialog that contained the widget. Do you see that in my code?
The code is fine, it works fine in 4.2.3,
Please understand - if something works, it does not automatically mean "it's fine".
So what would be your solution to [ ] to [___________] for a big button? Because background-image doesn't stretch accordingly to the size of the button.
In general it depends what the button looks like. I'd probably use border-image with a nice scalable or repeatable centre part or a gradient using brand new Qt 4.3 features. The image you used in your example won't work, because it neither scales nor repeats itself. If I were to use such a complicated shape, I'd implement my own style and/or draw it using QPainter.
BTW. Thanks for a great flame war... eeem... discussion. I already feel fresh blood flowing through my veins.
Bookmarks