我创建了一个模型,它在listView中显示可检查字符串列表。我不知道如何检查listView中显示的那些字符串是否被检查||不。任何人都知道如何去做? 编辑:
class File_List_Model : public QAbstractListModel
{
Q_OBJECT
private:
QStringList files_;//here I'm storing files selected by user
};
在我的名为Line_Counter的对话框中,我有一个fnc:
void Line_Counter::add_files()
{
QStringList selected_files = QFileDialog::getOpenFileNames();//here I'm getting those files
if (selected_files.size())
{
model_->setData(QModelIndex(),selected_files);//here I'm adding them to my model
}
}
答案 0 :(得分:0)
connect(pointerToYourItem,SIGNAL(toggled(bool)),pointerToYourWindow,SLOT(somefunc(bool)));