Fix crash : Qet crash when we save a project and the element collection is not loaded.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4951 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-04-29 17:51:55 +00:00
parent 62b82f6599
commit 0e003b27a5

View File

@@ -46,6 +46,14 @@ ElementsCollectionWidget::ElementsCollectionWidget(QWidget *parent):
QWidget(parent),
m_model(nullptr)
{
//The connection in the method ElementsCollectionWidget::reload return a warning message at compilation :
//**********
//QObject::connect: Cannot queue arguments of type 'QVector<int>'
//(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
//**********
//Register meta type has recommended by the message.
qRegisterMetaType<QVector<int>>();
setUpWidget();
setUpAction();
setUpConnection();
@@ -103,7 +111,8 @@ void ElementsCollectionWidget::removeProject(QETProject *project) {
*/
void ElementsCollectionWidget::highlightUnusedElement()
{
m_model->highlightUnusedElement();
if (m_model)
m_model->highlightUnusedElement();
}
bool ElementsCollectionWidget::event(QEvent *event)