Results 1 to 3 of 3

Thread: How can I connect a QPushButton and QLineEdit

  1. #1
    Join Date
    May 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How can I connect a QPushButton and QLineEdit

    Hi.
    I am new programmer in qt and I want write a new program that when you
    Clicked a button, line that maked with QLineEdit show a simple word like "HELLO".
    I know I have to write a new class and make a new slot but I don't know how can
    I write it's slot!!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How can I connect a QPushButton and QLineEdit

    Do some effort please to read the documentation:
    http://doc.qt.nokia.com/4.7/tutorials.html

  3. #3
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How can I connect a QPushButton and QLineEdit

    as tbscope already mentioned, you need definitively some basics.

    to give you some hints:

    * write a custom class, I suggest to derive QDialog* put a QLineEditand a QPushButtoninto the dialog (you probably want to use Layouts)
    * write a custom slot without Parameters. within the definition of this slot, you set the text of your QLineEdit* connect the clicked()-signal of the button with your custom slot

    I think, this task is a good one to start with qt. you can always ask here i you have any problems. show us your code and explain, what you tried to do, then we can help. But please don't ask: "Can someone give me code for ...".

Similar Threads

  1. Replies: 4
    Last Post: 15th September 2010, 00:22
  2. connect a QPushButton matrix with a function
    By harmodrew in forum Newbie
    Replies: 6
    Last Post: 6th August 2010, 11:11
  3. connect a qpushbutton a slot
    By Lycus HackerEmo in forum Newbie
    Replies: 13
    Last Post: 29th March 2010, 09:14
  4. Connect QLabel and QLineEdit
    By abbapatris in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2008, 19:00
  5. Replies: 3
    Last Post: 28th January 2007, 17:24

Tags for this Thread

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.