0
設置QItemSelectionModel崩潰我的應用程序。任何人都知道如何解決此問題?設置QItemSelectionModel崩潰應用程序
#ifndef DIALOG_H
#define DIALOG_H
#include <QFileDialog>
#include <QItemSelectionModel>
#include <QStringListModel>
//#include "ui_Dialog.h"
//#include "File_List_Model.h"
class Dialog : public QDialog//, private Ui::Dialog
{
Q_OBJECT
private:
QStringListModel* model_;
QItemSelectionModel* sel_model_;
public:
explicit Dialog(QWidget *parent = 0);
public slots:
//void add_files();
};
#endif // DIALOG_H
//cpp
#include "Dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),model_(new QStringListModel(this))
{
setupUi(this);
sel_model_ = (new QItemSelectionModel(model_,this));//THIS LINE CRASHES MY APP
listView->setModel(model_);
}
非常感謝。重建後它有效。奇怪...再次感謝。 – smallB
隨時接受答案,如果它爲你工作= P –
會做到這一點(並無論如何)愉快 – smallB