mirror of
https://github.com/fralx/LimeReport.git
synced 2025-01-11 17:18:10 +03:00
Crash on destroy has been fixed
This commit is contained in:
parent
7b04b6efca
commit
02a8ef8b5c
@ -96,7 +96,7 @@ DialogDesignerManager::DialogDesignerManager(QObject *parent) : QObject(parent)
|
||||
m_actionEditor->setObjectName("ActionEditor");
|
||||
m_formEditor->setActionEditor(m_actionEditor);
|
||||
m_designerToolWindows.append(m_actionEditor);
|
||||
connect(m_formEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) );
|
||||
connect(m_actionEditor, SIGNAL(destroyed(QObject*)), this, SLOT(slotObjectDestroyed(QObject*)) );
|
||||
|
||||
m_designerIntegration = new QDesignerIntegration(m_formEditor,this);
|
||||
m_formEditor->setIntegration(m_designerIntegration);
|
||||
|
@ -253,6 +253,7 @@ void ReportDesignWidget::createNewDialogTab(const QString& dialogName, const QBy
|
||||
QWidget* dialogDesigner = m_dialogDesignerManager->createFormEditor(description);
|
||||
int pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogName);
|
||||
m_tabWidget->setTabWhatsThis(pageIndex,"dialog");
|
||||
m_tabWidget->setCurrentIndex(pageIndex);
|
||||
}
|
||||
|
||||
DialogDesigner*ReportDesignWidget::activeDialogPage()
|
||||
|
@ -78,8 +78,8 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par
|
||||
createDialogPropertyEditor();
|
||||
createDialogObjectInspector();
|
||||
createDialogActionEditor();
|
||||
createDialogResourceEditor();
|
||||
createDialogSignalSlotEditor();
|
||||
createDialogResourceEditor();
|
||||
createDialogDesignerToolBar();
|
||||
#endif
|
||||
m_instance=this;
|
||||
@ -330,7 +330,9 @@ void ReportDesignWindow::createToolBars()
|
||||
|
||||
createReportToolBar();
|
||||
|
||||
m_pageTools << m_mainToolBar << m_reportToolBar << m_fontEditorBar << m_textAlignmentEditorBar << m_itemsBordersEditorBar;
|
||||
m_pageTools << m_mainToolBar << m_reportToolBar << m_fontEditorBar
|
||||
<< m_textAlignmentEditorBar << m_itemsAlignmentEditorBar
|
||||
<< m_itemsBordersEditorBar;
|
||||
|
||||
}
|
||||
|
||||
@ -544,42 +546,45 @@ void ReportDesignWindow::createDialogPropertyEditor()
|
||||
|
||||
void ReportDesignWindow::createDialogObjectInspector()
|
||||
{
|
||||
QDockWidget *doc = new QDockWidget(this);
|
||||
doc->setWindowTitle(tr("Object Inspector"));
|
||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector));
|
||||
doc->setObjectName("ObjectInspector");
|
||||
addDockWidget(Qt::RightDockWidgetArea,doc);
|
||||
m_dialogEditors.append(doc);
|
||||
QDockWidget *dock = new QDockWidget(this);
|
||||
dock->setWindowTitle(tr("Object Inspector"));
|
||||
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector));
|
||||
dock->setObjectName("ObjectInspector");
|
||||
addDockWidget(Qt::RightDockWidgetArea,dock);
|
||||
m_dialogEditors.append(dock);
|
||||
}
|
||||
|
||||
void ReportDesignWindow::createDialogActionEditor()
|
||||
{
|
||||
QDockWidget *doc = new QDockWidget(this);
|
||||
doc->setWindowTitle(tr("Action Editor"));
|
||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor));
|
||||
doc->setObjectName("ActionEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
||||
m_dialogEditors.append(doc);
|
||||
QDockWidget *dock = new QDockWidget(this);
|
||||
dock->setWindowTitle(tr("Action Editor"));
|
||||
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor));
|
||||
dock->setObjectName("ActionEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||
m_dialogEditors.append(dock);
|
||||
m_docksToTabify.append(dock);
|
||||
}
|
||||
|
||||
void ReportDesignWindow::createDialogResourceEditor()
|
||||
{
|
||||
QDockWidget *doc = new QDockWidget(this);
|
||||
doc->setWindowTitle(tr("Resource Editor"));
|
||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor));
|
||||
doc->setObjectName("ResourceEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
||||
m_dialogEditors.append(doc);
|
||||
QDockWidget *dock = new QDockWidget(this);
|
||||
dock->setWindowTitle(tr("Resource Editor"));
|
||||
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor));
|
||||
dock->setObjectName("ResourceEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||
m_dialogEditors.append(dock);
|
||||
m_docksToTabify.append(dock);
|
||||
}
|
||||
|
||||
void ReportDesignWindow::createDialogSignalSlotEditor()
|
||||
{
|
||||
QDockWidget *doc = new QDockWidget(this);
|
||||
doc->setWindowTitle(tr("SignalSlot Editor"));
|
||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor));
|
||||
doc->setObjectName("SignalSlotEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
||||
m_dialogEditors.append(doc);
|
||||
QDockWidget *dock = new QDockWidget(this);
|
||||
dock->setWindowTitle(tr("SignalSlot Editor"));
|
||||
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor));
|
||||
dock->setObjectName("SignalSlotEditor");
|
||||
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||
m_dialogEditors.append(dock);
|
||||
m_docksToTabify.append(dock);
|
||||
}
|
||||
|
||||
void ReportDesignWindow::createDialogDesignerToolBar()
|
||||
@ -1252,9 +1257,15 @@ void ReportDesignWindow::showDefaultEditors(){
|
||||
foreach (QDockWidget* w, m_pageEditors) {
|
||||
w->setVisible(m_editorTabType != ReportDesignWidget::Dialog);
|
||||
}
|
||||
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||
foreach (QDockWidget* w, m_dialogEditors) {
|
||||
w->setVisible(m_editorTabType == ReportDesignWidget::Dialog);
|
||||
}
|
||||
for ( int i = 0; i < m_docksToTabify.size() - 1; ++i){
|
||||
tabifyDockWidget(m_docksToTabify.at(i),m_docksToTabify.at(i+1));
|
||||
}
|
||||
m_docksToTabify.at(0)->raise();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ReportDesignWindow::slotActivePageChanged()
|
||||
|
@ -259,6 +259,7 @@ private:
|
||||
QMap<QString,QDateTime> m_recentFiles;
|
||||
QVector<QDockWidget*> m_pageEditors;
|
||||
QVector<QDockWidget*> m_dialogEditors;
|
||||
QVector<QDockWidget*> m_docksToTabify;
|
||||
ReportDesignWidget::EditorTabType m_editorTabType;
|
||||
QByteArray m_pageEditorsState;
|
||||
QByteArray m_dialogEditorsState;
|
||||
|
Loading…
Reference in New Issue
Block a user