Results 1 to 2 of 2

Thread: Line edit and push button

  1. #1
    Join Date
    Dec 2008
    Posts
    1

    Default Line edit and push button

    I am trying to get started with my school project relating to QT designer, but after going through different tutorials I still don't seem to get it. I haven't programmed with graphical user interfaces before.

    Problem is that I have a line edit box for text input and a push button. What I am trying to do is to save a text from the line edit box to a certain variable when push button is clicked. This sounds like a basic thing to me but I would appreciate if some one could give me a hint how to do this. Thanks.

  2. #2
    Join Date
    Sep 2008
    Posts
    24
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Line edit and push button

    Have you looked at Signals and Slots? It a way of linking events between two objects.

    For your problem, you'll need to write a function (to activate on the pushbutton being clicked) that would do something along the lines of
    Qt Code:
    1. QString var = linedit.text();
    To copy to clipboard, switch view to plain text mode 

    Connect that with the pushbutton clicked.

Similar Threads

  1. Logging Qt User Actions
    By Frank J. Lhota in forum Qt Programming
    Replies: 14
    Last Post: 30th May 2014, 22: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.