Results 1 to 2 of 2

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

  1. #1
    Join Date
    Aug 2011
    Posts
    33
    Thanks
    11
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to create a line edit box that has characteristics from two different QObjects?

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to create a line edit box that has characteristics from two different QObject

    Usually if things not already inherited, they can be combined.
    setInputMask: http://doc.qt.nokia.com/latest/qline...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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. QTableView line edit clears the text on edit
    By PlasticJesus in forum Qt Programming
    Replies: 5
    Last Post: 14th March 2015, 19:06
  2. validator on line edit
    By Raul in forum Qt Programming
    Replies: 4
    Last Post: 27th August 2010, 04:18
  3. Replies: 3
    Last Post: 26th August 2010, 08:57
  4. mask line edit
    By steg90 in forum Qt Programming
    Replies: 4
    Last Post: 3rd July 2007, 10:27
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.