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_actionEditor->setObjectName("ActionEditor");
|
||||||
m_formEditor->setActionEditor(m_actionEditor);
|
m_formEditor->setActionEditor(m_actionEditor);
|
||||||
m_designerToolWindows.append(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_designerIntegration = new QDesignerIntegration(m_formEditor,this);
|
||||||
m_formEditor->setIntegration(m_designerIntegration);
|
m_formEditor->setIntegration(m_designerIntegration);
|
||||||
|
@ -253,6 +253,7 @@ void ReportDesignWidget::createNewDialogTab(const QString& dialogName, const QBy
|
|||||||
QWidget* dialogDesigner = m_dialogDesignerManager->createFormEditor(description);
|
QWidget* dialogDesigner = m_dialogDesignerManager->createFormEditor(description);
|
||||||
int pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogName);
|
int pageIndex = m_tabWidget->addTab(dialogDesigner,QIcon(),dialogName);
|
||||||
m_tabWidget->setTabWhatsThis(pageIndex,"dialog");
|
m_tabWidget->setTabWhatsThis(pageIndex,"dialog");
|
||||||
|
m_tabWidget->setCurrentIndex(pageIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
DialogDesigner*ReportDesignWidget::activeDialogPage()
|
DialogDesigner*ReportDesignWidget::activeDialogPage()
|
||||||
|
@ -78,8 +78,8 @@ ReportDesignWindow::ReportDesignWindow(ReportEnginePrivate *report, QWidget *par
|
|||||||
createDialogPropertyEditor();
|
createDialogPropertyEditor();
|
||||||
createDialogObjectInspector();
|
createDialogObjectInspector();
|
||||||
createDialogActionEditor();
|
createDialogActionEditor();
|
||||||
createDialogResourceEditor();
|
|
||||||
createDialogSignalSlotEditor();
|
createDialogSignalSlotEditor();
|
||||||
|
createDialogResourceEditor();
|
||||||
createDialogDesignerToolBar();
|
createDialogDesignerToolBar();
|
||||||
#endif
|
#endif
|
||||||
m_instance=this;
|
m_instance=this;
|
||||||
@ -330,7 +330,9 @@ void ReportDesignWindow::createToolBars()
|
|||||||
|
|
||||||
createReportToolBar();
|
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()
|
void ReportDesignWindow::createDialogObjectInspector()
|
||||||
{
|
{
|
||||||
QDockWidget *doc = new QDockWidget(this);
|
QDockWidget *dock = new QDockWidget(this);
|
||||||
doc->setWindowTitle(tr("Object Inspector"));
|
dock->setWindowTitle(tr("Object Inspector"));
|
||||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector));
|
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ObjectInspector));
|
||||||
doc->setObjectName("ObjectInspector");
|
dock->setObjectName("ObjectInspector");
|
||||||
addDockWidget(Qt::RightDockWidgetArea,doc);
|
addDockWidget(Qt::RightDockWidgetArea,dock);
|
||||||
m_dialogEditors.append(doc);
|
m_dialogEditors.append(dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::createDialogActionEditor()
|
void ReportDesignWindow::createDialogActionEditor()
|
||||||
{
|
{
|
||||||
QDockWidget *doc = new QDockWidget(this);
|
QDockWidget *dock = new QDockWidget(this);
|
||||||
doc->setWindowTitle(tr("Action Editor"));
|
dock->setWindowTitle(tr("Action Editor"));
|
||||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor));
|
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ActionEditor));
|
||||||
doc->setObjectName("ActionEditor");
|
dock->setObjectName("ActionEditor");
|
||||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||||
m_dialogEditors.append(doc);
|
m_dialogEditors.append(dock);
|
||||||
|
m_docksToTabify.append(dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::createDialogResourceEditor()
|
void ReportDesignWindow::createDialogResourceEditor()
|
||||||
{
|
{
|
||||||
QDockWidget *doc = new QDockWidget(this);
|
QDockWidget *dock = new QDockWidget(this);
|
||||||
doc->setWindowTitle(tr("Resource Editor"));
|
dock->setWindowTitle(tr("Resource Editor"));
|
||||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor));
|
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::ResourceEditor));
|
||||||
doc->setObjectName("ResourceEditor");
|
dock->setObjectName("ResourceEditor");
|
||||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||||
m_dialogEditors.append(doc);
|
m_dialogEditors.append(dock);
|
||||||
|
m_docksToTabify.append(dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::createDialogSignalSlotEditor()
|
void ReportDesignWindow::createDialogSignalSlotEditor()
|
||||||
{
|
{
|
||||||
QDockWidget *doc = new QDockWidget(this);
|
QDockWidget *dock = new QDockWidget(this);
|
||||||
doc->setWindowTitle(tr("SignalSlot Editor"));
|
dock->setWindowTitle(tr("SignalSlot Editor"));
|
||||||
doc->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor));
|
dock->setWidget(m_reportDesignWidget->toolWindow(ReportDesignWidget::SignalSlotEditor));
|
||||||
doc->setObjectName("SignalSlotEditor");
|
dock->setObjectName("SignalSlotEditor");
|
||||||
addDockWidget(Qt::BottomDockWidgetArea,doc);
|
addDockWidget(Qt::BottomDockWidgetArea,dock);
|
||||||
m_dialogEditors.append(doc);
|
m_dialogEditors.append(dock);
|
||||||
|
m_docksToTabify.append(dock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReportDesignWindow::createDialogDesignerToolBar()
|
void ReportDesignWindow::createDialogDesignerToolBar()
|
||||||
@ -1252,9 +1257,15 @@ void ReportDesignWindow::showDefaultEditors(){
|
|||||||
foreach (QDockWidget* w, m_pageEditors) {
|
foreach (QDockWidget* w, m_pageEditors) {
|
||||||
w->setVisible(m_editorTabType != ReportDesignWidget::Dialog);
|
w->setVisible(m_editorTabType != ReportDesignWidget::Dialog);
|
||||||
}
|
}
|
||||||
|
#ifdef HAVE_QTDESIGNER_INTEGRATION
|
||||||
foreach (QDockWidget* w, m_dialogEditors) {
|
foreach (QDockWidget* w, m_dialogEditors) {
|
||||||
w->setVisible(m_editorTabType == ReportDesignWidget::Dialog);
|
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()
|
void ReportDesignWindow::slotActivePageChanged()
|
||||||
|
@ -259,6 +259,7 @@ private:
|
|||||||
QMap<QString,QDateTime> m_recentFiles;
|
QMap<QString,QDateTime> m_recentFiles;
|
||||||
QVector<QDockWidget*> m_pageEditors;
|
QVector<QDockWidget*> m_pageEditors;
|
||||||
QVector<QDockWidget*> m_dialogEditors;
|
QVector<QDockWidget*> m_dialogEditors;
|
||||||
|
QVector<QDockWidget*> m_docksToTabify;
|
||||||
ReportDesignWidget::EditorTabType m_editorTabType;
|
ReportDesignWidget::EditorTabType m_editorTabType;
|
||||||
QByteArray m_pageEditorsState;
|
QByteArray m_pageEditorsState;
|
||||||
QByteArray m_dialogEditorsState;
|
QByteArray m_dialogEditorsState;
|
||||||
|
Loading…
Reference in New Issue
Block a user