Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Add TreeWidget item from another dialog
Forum Updated to NodeBB v4.3 + New Features

Add TreeWidget item from another dialog

Scheduled Pinned Locked Moved Solved General and Desktop
qtreewidgetqlineeditqmainwindowqdialog
3 Posts 2 Posters 875 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on 24 Dec 2018, 12:43 last edited by
    #1

    Hello everyone and merry christmas!

    I have a dialog with a QLineEdit.
    And i have a Mainwindow with a QTreeWidget

    So, when i clicked OK in the dialog, then in the QTreeWidget in the Mainwindow should added an item, and the item contains the text from the QLineEdit in the dialog.

    But i don't have any idea, how to pass these data...
    I hope, someone can help me,

    Thanks,
    Henrik

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 24 Dec 2018, 13:48 last edited by
      #2

      Hi
      merry christmas to you too.
      You can define a new signal in dialog
      and in mainwindow hook this new signal up to up to a slot.
      and in slot simply add the item.
      Sample:
      alt text

      code:
      https://www.dropbox.com/s/hf944ilyk12swvi/ex2.zip?dl=0

      1 Reply Last reply
      1
      • ? Offline
        ? Offline
        A Former User
        wrote on 24 Dec 2018, 13:57 last edited by
        #3

        Thanks, mrjj!
        That's it!

        Merry christmas

        1 Reply Last reply
        0

        3/3

        24 Dec 2018, 13:57

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved