From f0dcd59060076729113ff2707ca7e273e5aa4fb8 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 15 May 2022 17:29:08 +0200 Subject: [PATCH] WIP --- src/klayout.pro | 4 ++-- src/laybasic/laybasic/layLayoutViewBase.cc | 24 +++++++++++----------- src/laybasic/laybasic/layLayoutViewBase.h | 10 ++++----- src/layview/layview/layLayoutView_qt.cc | 6 ++---- src/layview/layview/layLayoutView_qt.h | 4 +--- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/klayout.pro b/src/klayout.pro index a2ece4bb7..4a17bdc57 100644 --- a/src/klayout.pro +++ b/src/klayout.pro @@ -101,9 +101,9 @@ equals(HAVE_RUBY, "1") { } - layui.depends += rdb + layui.depends += laybasic layview.depends += layui - lay.depends += laybasic ant img edt layui + lay.depends += ant img edt layui plugins.depends += lay diff --git a/src/laybasic/laybasic/layLayoutViewBase.cc b/src/laybasic/laybasic/layLayoutViewBase.cc index cd8af3a8c..f6f1da238 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.cc +++ b/src/laybasic/laybasic/layLayoutViewBase.cc @@ -235,11 +235,11 @@ struct OpDeleteLayerProps const double animation_interval = 0.5; -LayoutViewBase::LayoutViewBase (db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) - : lay::Dispatcher (plugin_parent, false /*not standalone*/), +LayoutViewBase::LayoutViewBase (db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) : #if defined(HAVE_QT) - mp_widget (0), + QFrame (0), #endif + lay::Dispatcher (plugin_parent, false /*not standalone*/), mp_ui (0), m_editable (editable), m_options (options), @@ -252,14 +252,14 @@ LayoutViewBase::LayoutViewBase (db::Manager *manager, bool editable, lay::Plugin } #if defined(HAVE_QT) -LayoutViewBase::LayoutViewBase (QWidget *widget, lay::LayoutView *ui, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) +LayoutViewBase::LayoutViewBase (QWidget *parent, lay::LayoutView *ui, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) : #else -LayoutViewBase::LayoutViewBase (lay::LayoutView *ui, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) +LayoutViewBase::LayoutViewBase (lay::LayoutView *ui, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) : #endif - : lay::Dispatcher (plugin_parent, false /*not standalone*/), #if defined(HAVE_QT) - mp_widget (widget), + QFrame (parent), #endif + lay::Dispatcher (plugin_parent, false /*not standalone*/), mp_ui (ui), m_editable (editable), m_options (options), @@ -272,14 +272,14 @@ LayoutViewBase::LayoutViewBase (lay::LayoutView *ui, db::Manager *manager, bool } #if defined(HAVE_QT) -LayoutViewBase::LayoutViewBase (QWidget *widget, lay::LayoutView *ui, lay::LayoutViewBase *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) +LayoutViewBase::LayoutViewBase (QWidget *parent, lay::LayoutView *ui, lay::LayoutViewBase *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) : #else -LayoutViewBase::LayoutViewBase (lay::LayoutView *ui, lay::LayoutViewBase *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) +LayoutViewBase::LayoutViewBase (lay::LayoutView *ui, lay::LayoutViewBase *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, unsigned int options) : #endif - : lay::Dispatcher (plugin_parent, false /*not standalone*/), #if defined(HAVE_QT) - mp_widget (widget), + QFrame (parent), #endif + lay::Dispatcher (plugin_parent, false /*not standalone*/), mp_ui (ui), m_editable (editable), m_options (options), @@ -3375,7 +3375,7 @@ LayoutViewBase::box () const QWidget * LayoutViewBase::widget () { - return mp_widget; + return this; } #endif diff --git a/src/laybasic/laybasic/layLayoutViewBase.h b/src/laybasic/laybasic/layLayoutViewBase.h index 0c41cf425..46ede53ed 100644 --- a/src/laybasic/laybasic/layLayoutViewBase.h +++ b/src/laybasic/laybasic/layLayoutViewBase.h @@ -54,7 +54,7 @@ #include "dbInstElement.h" #if defined(HAVE_QT) -class QWidget; +# include #endif namespace rdb { @@ -155,6 +155,9 @@ struct LAYBASIC_PUBLIC LayerDisplayProperties * It manages the layer display list, bookmark list etc. */ class LAYBASIC_PUBLIC LayoutViewBase : +#if defined(HAVE_QT) + public QFrame, +#endif public lay::Editables, public lay::Dispatcher { @@ -193,7 +196,7 @@ public: * @brief Constructor */ #if defined(HAVE_QT) - LayoutViewBase (QWidget *widget, lay::LayoutView *ui, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options = (unsigned int) LV_Normal); + LayoutViewBase (QWidget *parent, lay::LayoutView *ui, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options = (unsigned int) LV_Normal); #else LayoutViewBase (lay::LayoutView *ui, db::Manager *mgr, bool editable, lay::Plugin *plugin_parent, unsigned int options = (unsigned int) LV_Normal); #endif @@ -2667,9 +2670,6 @@ private: void signal_apply_technology (lay::LayoutHandle *layout_handle); private: -#if defined(HAVE_QT) - QWidget *mp_widget; -#endif lay::LayoutView *mp_ui; bool m_editable; int m_disabled_edits; diff --git a/src/layview/layview/layLayoutView_qt.cc b/src/layview/layview/layLayoutView_qt.cc index 3606f56ce..9c41b9f4b 100644 --- a/src/layview/layview/layLayoutView_qt.cc +++ b/src/layview/layview/layLayoutView_qt.cc @@ -93,8 +93,7 @@ const int timer_interval = 10; static LayoutView *ms_current = 0; LayoutView::LayoutView (db::Manager *manager, bool editable, lay::Plugin *plugin_parent, QWidget *parent, const char *name, unsigned int options) - : QFrame (parent), - LayoutViewBase (this, this, manager, editable, plugin_parent, options), + : LayoutViewBase (parent, this, manager, editable, plugin_parent, options), dm_setup_editor_option_pages (this, &LayoutView::do_setup_editor_options_pages) { // ensures the deferred method scheduler is present @@ -105,8 +104,7 @@ LayoutView::LayoutView (db::Manager *manager, bool editable, lay::Plugin *plugin } LayoutView::LayoutView (lay::LayoutView *source, db::Manager *manager, bool editable, lay::Plugin *plugin_parent, QWidget *parent, const char *name, unsigned int options) - : QFrame (parent), - LayoutViewBase (this, this, source, manager, editable, plugin_parent, options), + : LayoutViewBase (parent, this, source, manager, editable, plugin_parent, options), dm_setup_editor_option_pages (this, &LayoutView::do_setup_editor_options_pages) { // ensures the deferred method scheduler is present diff --git a/src/layview/layview/layLayoutView_qt.h b/src/layview/layview/layLayoutView_qt.h index 486abc108..9d2378218 100644 --- a/src/layview/layview/layLayoutView_qt.h +++ b/src/layview/layview/layLayoutView_qt.h @@ -54,7 +54,6 @@ #include #include -#include #include class QSpinBox; @@ -94,8 +93,7 @@ class EditorOptionsPages; * It manages the layer display list, bookmark list etc. */ class LAYVIEW_PUBLIC LayoutView - : public QFrame, - public LayoutViewBase + : public LayoutViewBase { Q_OBJECT