Hello All,
In my program I have used a QlistWidget . Sometimes Item string are longer the space provided.
So I need to scroll my Text to and fro in order to show the full item string.
Please Help
Hello All,
In my program I have used a QlistWidget . Sometimes Item string are longer the space provided.
So I need to scroll my Text to and fro in order to show the full item string.
Please Help
Hmmm... I just wrote a sample program, and there the scroll bars appeared. So what's your problem exactly?
Qt Code:
int main( int argc, char *argv[] ) { QListWidget oListWidget; oListWidget.show(); return a.exec(); }To copy to clipboard, switch view to plain text mode
Otherwise you can wrap a QScrollArea around: http://doc.qt.nokia.com/4.7/qscrollarea.html#details
Actually I dont need a scroll bar.
I need when I select a particular Item of the QList Widget, if its length is longer than the space provided it should move to and fro to show the full string
I hope i could xplain
Thnx
Like the HTML marquee element along with all its failings?
Let's just suppose that, for whatever insane reason, one actually wanted to implement this. I'm trying to guess at how one might go about it.
My initial idea is to implement a QLineEdt delegate that, when displayed, would include a timer that would step the cursor position along one character at a time, either forward or backward, each time it fired. Would that be feasible?
The problem I see is that when you are not editing the cell in the QTableView there is no widget that you can do this with. When you are editing the cell you want a standard QLineEdit rather than trying to edit a bouncing message
You could render the text with a (sometimes) variable offset in the delegate paint() routine, but the delegate paint routine would only be called when it is required to repaint a particular cell (value changes or scrolls into view). The trick would be how to get this to fire periodically without forcing the redraw (update() or repaint()) of the whole QTableView. Not obvious to me.
Ah, yes, very true. With my solution it would be like editing karaoke. And you certainly wouldn't want every cell to be continuously scrolling back and forth, only the selected one.When you are editing the cell you want a standard QLineEdit rather than trying to edit a bouncing message
Never mind - anything that I can envision would be hideous.
It's not a big deal. One calls update() on the view's viewport using QAbstractItemView::visualRect(). Provided one uses Qt4 despite that his profile says otherwise (yeah, I know there is no QListWidgetItem in Qt3).
The epilepsy-warning issue still remains, though. I can't even think what it would look like if the text was spinning in multiple cells at once.
Ahh, you live and you learn.
Bookmarks