Results 1 to 4 of 4

Thread: send the text QCheckBox to QTextEdit

  1. #1
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    61
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default send the text QCheckBox to QTextEdit

    It is possible when you click a QCheckBox the text () is sent to a QTextEdit?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: send the text QCheckBox to QTextEdit

    Yes, you can program anything you like in a slot connected to the clicked() or stateChanged() signal.

  3. #3
    Join Date
    Dec 2007
    Location
    Brazil
    Posts
    61
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: send the text QCheckBox to QTextEdit

    I was not plain in my question. Sorry my English.
    It would be something like:

    Qt Code:
    1. connect(QCheckBox, SIGNAL(clicked()), QTextEdit, SLOT(insertHtml(QCheckBox->text())));
    To copy to clipboard, switch view to plain text mode 

    Clicking on QCheckBox it sends your text() to QTextEdit.
    You can do this without derive the class QTextEdit to create a new SLOT?

  4. #4
    Join Date
    Apr 2010
    Location
    Russian Federation, Kaluga
    Posts
    20
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: send the text QCheckBox to QTextEdit

    No, it's impossible, because signatures of signal and slot are not match. (see http://doc.qt.nokia.com/stable/signalsandslots.html - fifth paragraph)
    The signature of a signal must match the signature of the receiving slot
    You have to define your own slot with signature (void) or (), then connect clicked() signal to this slot. Inside you slot you can create any action.

Similar Threads

  1. QCheckBox with long text label
    By Ferdous in forum Newbie
    Replies: 5
    Last Post: 29th October 2011, 19:05
  2. Replies: 1
    Last Post: 28th October 2011, 13:49
  3. using QCheckBox->text() from QThread
    By yodasoda in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2010, 07:49
  4. Custom ListWidget(QCheckBox + Icon + Text)
    By nrabara in forum Newbie
    Replies: 6
    Last Post: 13th May 2010, 06:35
  5. Replies: 1
    Last Post: 21st March 2007, 14:13

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.