Results 1 to 3 of 3

Thread: How to enable a different QPlainTextEdit by clicking a PushButton?

  1. #1

    Default How to enable a different QPlainTextEdit by clicking a PushButton?

    I tried many times to enable a different QPlainTextEdit by clicking two different PushButtons.
    Here part of my code:

    Qt Code:
    1. // MERGE
    2. descriptionEdit->setPlainText("Select the two fragments.");
    3. connect(b_merge, SIGNAL(triggered()), descriptionEdit, SLOT(on_pushButton_clicked()));
    4.  
    5. // SPLIT
    6. descriptionEdit->setPlainText("Draw a polyline.");
    7. connect(b_split, SIGNAL(triggered()), descriptionEdit, SLOT(on_pushButton_clicked()));
    To copy to clipboard, switch view to plain text mode 

    It gives me only the second one (SPLIT), and without any clicking.
    I just want that by clicking one of the two buttons also the text sholud be change.

  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: How to enable a different QPlainTextEdit by clicking a PushButton?

    I am not sure what you mean.

    So you set up to connections to the same receiver object, same slot.
    Does that slot make the distinction between the two senders?

    Maybe you can show the implementation of that slot?

    Cheers,
    _

  3. #3

    Default Re: How to enable a different QPlainTextEdit by clicking a PushButton?

    I found the problem: it was in the function on_pushButton_clicked()
    thanks anyway

Similar Threads

  1. Replies: 8
    Last Post: 1st October 2015, 07:23
  2. Enable editing by double clicking QGraphicsTextItem
    By Seishin in forum Qt Programming
    Replies: 1
    Last Post: 11th December 2012, 15:07
  3. How to disable pushbutton after clicking it
    By Cengaver in forum Newbie
    Replies: 12
    Last Post: 19th April 2011, 15:22
  4. How to add Treewidget Items when clicking on PushButton
    By mkkguru in forum Qt Programming
    Replies: 7
    Last Post: 11th February 2010, 13:48
  5. QTableView - Enable Clicking for some columns only
    By Gabriel in forum Qt Programming
    Replies: 1
    Last Post: 23rd June 2006, 22:42

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
  •  
Qt is a trademark of The Qt Company.