custom a display widget that can take input from touch panel
Hello, guys..
I have a job that need to implement a display widget who can take input from the touch panel.
the widget is used for displaying the content of QDateTime, or something else, I prefer use the QLabel class, which has the feature of "alignment", "font", "word wrap", "text format". but QLabel can not take input, like "clicked" event, because i would use "click" to show a window(set time dialog, etc).
Maybe i should use QPushButton or QAbstractButton to start, but really, I don't want to lose the power features provided by QLabel。
Exactly, I want both QPushButton and QLabel, a widget display things like QLabel, and responed events like QPushButton. ~_~ ...
what is the best way to go ?
tks ..
/WX
Re: custom a display widget that can take input from touch panel
You can overide the mouseevents of QLabel and interpret clicked() as you want.
Other way is to use QPushButton and set its style to flat(in case you dont have very stylish font or word wrapping).