Results 1 to 4 of 4

Thread: Derived class from QLineEdit is behaving differently.

  1. #1
    Join Date
    May 2010
    Posts
    100
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Derived class from QLineEdit is behaving differently.

    hi,

    i have derived a class say MyLineEdit From QLineEdit as below.

    Qt Code:
    1. classs MyLineEdit:public QLineEdit
    2. {
    3.  
    4. setFocusPolicy(Qt::OnClickFocus);
    5. setInputMask("000");
    6. setmaxLength(5);
    7. setStyleSheet("color:white");
    8. }
    9.  
    10.  
    11. myLineEdit *obj1;
    12. obj1 -> setInputMask("NNNNNN");
    13. connect(obj1,SIGNAL(editingFinished()),this,SLOT( printFinish()));
    To copy to clipboard, switch view to plain text mode 
    But, This never comes in a printFinish() Slot.

    If i dont take use, obj1 -> setInputMask("NNNNNN"); , than the things are normal and it invokes printFinish() Slot.

    what is the problem in this.
    Last edited by high_flyer; 20th January 2011 at 09:19. Reason: code tags

  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: Derived class from QLineEdit is behaving differently.

    What do you type in to the line edit?
    you need to input 6 chars.
    ==========================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.

  3. #3
    Join Date
    May 2010
    Posts
    100
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Derived class from QLineEdit is behaving differently.

    Yah,

    I want to type 6 ascii chars in LineEdit by changing the setInputMask to 'aaaaaaa' .

    cant i change for the derived object ?

  4. #4
    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: Derived class from QLineEdit is behaving differently.

    I don't understand your question.
    The mask states you have to input 6 chars.
    ==========================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. Can not cast into the derived class from QScrollBar
    By learning_qt in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2008, 10:23
  2. no frame on Qlabel derived class
    By tupu_83 in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2008, 16:01
  3. Use QWidget derived class in Dialog
    By qtneuling in forum Qt Tools
    Replies: 2
    Last Post: 17th May 2008, 23:29
  4. rtti() of derived class
    By quickNitin in forum Newbie
    Replies: 4
    Last Post: 8th October 2006, 14:20
  5. Signal/slot looking in base class, not derived class
    By georgie in forum Qt Programming
    Replies: 2
    Last Post: 12th May 2006, 07:36

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.