Results 1 to 4 of 4

Thread: lineEdit show in other form as label

  1. #1
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default lineEdit show in other form as label

    hi all,

    i have the following problem: i have a mainWindow and a 1.ui form which opens if i press a button in the mainWindow.
    on 1.ui i have an button (something like "add new item") which opens another form (2.ui) where information could be entered as text in lineEdit. 2.ui has a Save and a Cancel button.

    as soon as I press Save, i would like to show the information inserted in the lineEdit in form 1.ui, as a label.

    any suggestions how to do it?
    thanks for your input.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: lineEdit show in other form as label

    There are several ways to do that:
    1) manipulate a shared data structure
    2) let the second class emit its data on OK
    3) let the first class retrieve the data from the second class using getter methods

    Cheers,
    _

  3. #3
    Join Date
    May 2013
    Location
    Schweiz
    Posts
    21
    Thanked 1 Time in 1 Post
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default Re: lineEdit show in other form as label

    hi,
    There are several ways to do that:
    1) manipulate a shared data structure
    2) let the second class emit its data on OK
    3) let the first class retrieve the data from the second class using getter methods
    could you please let me know where I should start reading about these methods? i need a starting point. no info found so far.
    thanks.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: lineEdit show in other form as label

    (1) and (2) are standard C++ features so they are most likely covered in all non-trivial C++ tutorials out there.
    For (2) see http://qt-project.org/doc/qt-5.0/qtc...sandslots.html

    Cheers,
    _

Similar Threads

  1. how to show a intger value in LineEdit
    By gauravg in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2012, 11:01
  2. conversion of lineedit text to numeric form
    By sachinmcajnu in forum Newbie
    Replies: 3
    Last Post: 9th March 2011, 18:45
  3. lineEdit's setSelection - How to show more text?
    By squidge in forum Qt Programming
    Replies: 3
    Last Post: 30th January 2010, 18:22
  4. How to embed label in lineedit?
    By blonde in forum Qt Programming
    Replies: 7
    Last Post: 1st December 2009, 16:26
  5. read and write content of lineedit widget in Other Form
    By validator in forum Qt Programming
    Replies: 1
    Last Post: 25th April 2008, 16:07

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.