Mentor
|
This is the patch from Linex with small modifications which I currently mailed to Richard, the maintainer from ksnapshot.
Last edited by sayakb on Fri Jan 02, 2009 5:49 pm, edited 1 time in total.
[size=x-small]code | [url=cia.vc/stats/author/msoeken]cia.vc[/url] | [url=kde.org/support]donating KDE[/url] | [url=tinyurl.com/cto4ns]wishlist[/url][/size] |
Alumni
|
I saw the patch below today on kde's bugzilla. The patch is quite similar to mine but I think mine is less complicating because it solved it at one place. In this proposed patch, the width and height are resized in the constructor. The width is first resized to an arbitary width(180). Then it is resized again in paintEvent(). I think its unnecessary to resize in paintEvent(), its not like the text or font going to change while counting down. Maybe I'm missing something here.
Furthermore, I think it is quite necessary to change the flag in boundingRect() to Qt::TextSingleLine so that even if in unforeseen situation, part of the text will at the very least be shown. If it is Qt::TextWordWrap, the slightest shortage of space on the left will wrap the rest of the text and in this case makes it not visible since the height of the widget is kinda fixed to the height of the font. So for what its worth, Qt::TextWordWrap really served no purpose here( in fact, less helpful ) except having to put something as part of the function's parameters. Qt::TextSingleLine would serve a better purpose instead. The core issue in this bug is that we need to resize the SnapshotTimer widget which is a QWidget. But to what size ? The text is not declared yet so we don't know what size to resize the widget to. I can think of no other way except to declare the text first, and then resize() the qwidget, or do both in one line. I tried setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum ) in the constructor, nothing happened. It would be interesting to see if there is an alternative way.
Last edited by Linex on Fri Jan 02, 2009 9:35 am, edited 1 time in total.
Alsagoff, proud to be a member of KDE forums since 2008-Dec.
|
Registered users: Bing [Bot], Google [Bot], kesang, Sogou [Bot], Yahoo [Bot]