QRadioButton 使用方法

时间:2015-06-23 06:18:35   收藏:0   阅读:228

 

QRadioButton 控件是Qt中实现多选一功能的控件,它的使用方法如下:

声明控件:

QRadioButton *rbutton;

 

然后实现它的响应函数:

void YourClass::on_rbutton_toggled(bool state) {
  // Implement here
  if (state) {
    // TO DO
  }
  else {
    // TO DO
  }
}

 

别忘了在头文件中加入私有槽的声明:

private slots:
  void on_rbutton_toggled(bool state);

 

原文:http://www.cnblogs.com/grandyang/p/4594463.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!