PDA

View Full Version : How to create a line edit box that has characteristics from two different QObjects?



paie
10th August 2011, 12:27
I would like an edit box for user input that has characteristics from two different QObject classes.

Since multiple inheritance of QObjects is not supported, how can I do this?

I need the QComboBox::lineEditIO function to call setInputMask(), and I need the QPlainTextEdit::setFrameStyle() function to set a nice frame.

I can find a QObject that has both of these features, so how do I create one that does?


The lineEdit() function is not s

high_flyer
11th August 2011, 14:18
Usually if things not already inherited, they can be combined.
setInputMask: http://doc.qt.nokia.com/latest/qlineedit.html#inputMask-prop , see also setValidator().
For a frame, if initStyleOption() is not enough for you, you can call setFrame(flase) and put your QLineEdit in a QFrame.