Results 1 to 9 of 9

Thread: Program crashes when radioButton selected

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jun 2013
    Posts
    58
    Thanks
    26
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Question Re: Program crashes when radioButton selected

    Done some modifying on code... to no avail though

    Basically I need to check which radio button selected
    The Problem -> RadioButton in main dialog Class(Window)
    -> the Check statement is in a different class("label class" within Window/dialog)

    Created signals & slots as:
    Qt Code:
    1. Dialog::Dialog(QWidget *parent) :
    2. QDialog(parent),
    3. ui(new Ui::Dialog)
    4. {
    5. ui->setupUi(this);
    6. connect(ui->radioButton_1, SIGNAL(n1_Selected()), my_qlabel, SLOT(my_qlabel::HandleN1()));
    7. connect(ui->radioButton_2, SIGNAL(n2_Selected()), my_qlabel, SLOT(my_qlabel::HandleN2()));
    8. ...
    9. }
    To copy to clipboard, switch view to plain text mode 

    in dialog:
    Qt Code:
    1. void Dialog::on_radioButton_1_clicked()
    2. {
    3. emit n1_Selected();
    4. }
    5.  
    6. void Dialog::on_radioButton_2_clicked()
    7. {
    8. emit n2_Selected();
    9. }
    To copy to clipboard, switch view to plain text mode 

    my slots in sub class (label class)
    .h
    Qt Code:
    1. private slots:
    2. void HandleN1();
    3. void HandleN2();
    To copy to clipboard, switch view to plain text mode 
    .cpp
    Qt Code:
    1. void my_qlabel::HandleN1()
    2. {
    3. //calculations
    4. }
    5.  
    6. void my_qlabel::HandleN2()
    7. {
    8. //diff-calculations
    9. }
    To copy to clipboard, switch view to plain text mode 

    Above not working!
    Where am I going wrong?
    How do I fix it?

    Thanks
    Last edited by ebsaith; 13th June 2013 at 09:18. Reason: updated contents

Similar Threads

  1. Program crashes on 64-bit systems
    By WereWind in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2013, 10:29
  2. Program crashes on OS X Lion
    By fyodor in forum Newbie
    Replies: 1
    Last Post: 31st October 2011, 06:18
  3. Program crashes
    By Fallen_ in forum Qt Programming
    Replies: 49
    Last Post: 20th September 2010, 01:41
  4. Program crashes (SIGSEGV)
    By Voldemort in forum Qt Programming
    Replies: 47
    Last Post: 21st May 2007, 20:09
  5. Replies: 5
    Last Post: 27th May 2006, 13:44

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.