PDA

View Full Version : QDateTimeEdit



coderbob
5th January 2008, 17:51
When sub classing QLineEdit I can use functions such as hasSelectedText(), isUndoAvailable() to re implement copy,undo, etc functions for a contextMenuEvent.

Sub classing QDateTimeEdit I can not find any of these functions or something I can re implement from an inherited object.

QDateTimeEdit does have these functions in its default context menu so I am not sure where I am missing the connection.

Bob

Thomas
5th January 2008, 18:06
You are not missing anything. QDateTimeEdit does not inherit QLineEdit. Therefore the mentioned methods are not available.

coderbob
5th January 2008, 18:17
But it still offers such features as copy,paste,etc from its context menu. So my guess is it implements the functionality somewhere?

Thomas
5th January 2008, 19:54
I would suppose so. It inherits QAbstractSpinBox which in turn inherits Qwidget. Both show some events. Probably the best place to look at is the source code of QDateTimeEdit.