You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# pragma once
# include "nmSubWxs_global.h"
# include <QWidget>
# include <QStringList>
# include <QButtonGroup> // 新增:用于管理单选按钮组
class QRadioButton ; // 修改: 使用QRadioButton替代QCheckBox
class QListWidget ;
class nmWxSelectResultWellItemWidget : public QWidget {
Q_OBJECT
public :
nmWxSelectResultWellItemWidget ( QWidget * parent , const QString & name ) ;
bool isSelected ( ) const ;
QString getName ( ) const ;
void setSelected ( bool selected ) ;
QRadioButton * getRadioButton ( ) ;
signals :
void sigItemClicked ( ) ;
private slots :
void onRadioButtonToggled ( bool ) ;
private :
void initUI ( ) ;
QRadioButton * m_pRadioButton ; // 修改:使用单选按钮
QString m_sName ;
} ;
class NM_SUB_WXS_EXPORT nmWxSelectResultWellsWidget : public QWidget {
Q_OBJECT
public :
nmWxSelectResultWellsWidget ( QWidget * parent = nullptr ) ;
void addItem ( const QString & name ) ;
QString getSelectedItem ( ) const ;
void setSelectedItem ( const QString & name ) ;
private :
QListWidget * m_pListWidget ;
QStringList m_items ;
QButtonGroup * m_pButtonGroup ; // 新增:管理单选按钮组
} ;