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
QtWS25 Last Chance

Add TreeWidget item from another dialog

Scheduled Pinned Locked Moved Solved General and Desktop
qtreewidgetqlineeditqmainwindowqdialog
3 Posts 2 Posters 852 Views
  • 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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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 last edited by
        #3

        Thanks, mrjj!
        That's it!

        Merry christmas

        1 Reply Last reply
        0

        • Login

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