Enabling Qt-less builds

This commit is contained in:
Matthias Koefferlein 2026-01-15 01:41:09 +01:00
parent a0ca8febe5
commit 9fe22869ed
10 changed files with 35 additions and 27 deletions

View File

@ -24,7 +24,6 @@
#include "layDispatcher.h" #include "layDispatcher.h"
#include "layLayoutViewBase.h" #include "layLayoutViewBase.h"
#include "layEditorOptionsPage.h" #include "layEditorOptionsPage.h"
#include "layTipDialog.h"
#include "edtPlugin.h" #include "edtPlugin.h"
#include "edtConfig.h" #include "edtConfig.h"
#include "edtService.h" #include "edtService.h"
@ -44,6 +43,7 @@
# include <QApplication> # include <QApplication>
# include <QLayout> # include <QLayout>
# include <QMessageBox> # include <QMessageBox>
# include "layTipDialog.h"
#endif #endif
namespace edt namespace edt

View File

@ -32,7 +32,7 @@
#include "layLayoutView.h" #include "layLayoutView.h"
#include "laySnap.h" #include "laySnap.h"
#include "layConverters.h" #include "layConverters.h"
#include "layEditorOptionsPages.h" #include "layEditorOptionsPage.h"
#include "tlProgress.h" #include "tlProgress.h"
#include "tlTimer.h" #include "tlTimer.h"

View File

@ -26,10 +26,13 @@
#include "edtPropertiesPages.h" #include "edtPropertiesPages.h"
#include "layLayoutView.h" #include "layLayoutView.h"
#include "layEditorOptionsPage.h" #include "layEditorOptionsPage.h"
#include "layTipDialog.h"
#include "dbEdgeProcessor.h" #include "dbEdgeProcessor.h"
#include "dbPolygonTools.h" #include "dbPolygonTools.h"
#if defined(HAVE_QT)
# include "layTipDialog.h"
#endif
namespace edt namespace edt
{ {

View File

@ -371,7 +371,7 @@ EditorServiceBase::focus_page ()
bool bool
EditorServiceBase::key_event (unsigned int key, unsigned int /*buttons*/) EditorServiceBase::key_event (unsigned int key, unsigned int /*buttons*/)
{ {
if (is_active () && (key == Qt::Key_Tab || key == Qt::Key_Backtab)) { if (is_active () && (key == lay::KeyTab || key == lay::KeyBacktab)) {
focus_page_open (); focus_page_open ();
return true; return true;
} else { } else {
@ -384,7 +384,7 @@ EditorServiceBase::shortcut_override_event (unsigned int key, unsigned int /*but
{ {
auto fp = focus_page (); auto fp = focus_page ();
return is_active () return is_active ()
&& (key == Qt::Key_Tab || key == Qt::Key_Backtab) && (key == lay::KeyTab || key == lay::KeyBacktab)
&& fp && fp
&& (fp->is_modal_page () || fp->is_visible ()); && (fp->is_modal_page () || fp->is_visible ());
} }
@ -400,7 +400,9 @@ void
EditorServiceBase::show_error (tl::Exception &ex) EditorServiceBase::show_error (tl::Exception &ex)
{ {
tl::error << ex.msg (); tl::error << ex.msg ();
#if defined(HAVE_QT)
QMessageBox::critical (ui ()->widget (), tr ("Error"), tl::to_qstring (ex.msg ())); QMessageBox::critical (ui ()->widget (), tr ("Error"), tl::to_qstring (ex.msg ()));
#endif
} }
} }

View File

@ -24,16 +24,10 @@
#include "layEditable.h" #include "layEditable.h"
#include "layLayoutViewBase.h" #include "layLayoutViewBase.h"
#include "layEditorUtils.h" #include "layEditorUtils.h"
#include "layEditorOptionsPage.h"
#include "laySelector.h" #include "laySelector.h"
#include "laybasicConfig.h" #include "laybasicConfig.h"
#if defined(HAVE_QT)
# include "layEditorOptionsPage.h"
# include <QWidget>
# include <QHBoxLayout>
# include <QLineEdit>
#endif
namespace lay namespace lay
{ {

View File

@ -51,9 +51,9 @@ class ViewService;
class Editable; class Editable;
class Drawing; class Drawing;
class TechnologyComponentProvider; class TechnologyComponentProvider;
class EditorOptionsPage;
#if defined(HAVE_QT) #if defined(HAVE_QT)
class Browser; class Browser;
class EditorOptionsPage;
class ConfigPage; class ConfigPage;
#endif #endif

View File

@ -711,6 +711,7 @@ PluginImpl::move_ac (lay::angle_constraint_type ac) const
return ac != lay::AC_Global ? ac : m_move_ac; return ac != lay::AC_Global ? ac : m_move_ac;
} }
#if defined(HAVE_QTBINDINGS)
static std::vector<lay::EditorOptionsPageWidget *> static std::vector<lay::EditorOptionsPageWidget *>
get_editor_options_pages (PluginImpl *plugin) get_editor_options_pages (PluginImpl *plugin)
{ {
@ -733,7 +734,7 @@ get_focus_page (PluginImpl *plugin)
auto fp = plugin->focus_page (); auto fp = plugin->focus_page ();
return fp ? fp->widget () : 0; return fp ? fp->widget () : 0;
} }
#endif
Class<gsi::PluginImpl> decl_Plugin (decl_PluginBase, "lay", "Plugin", Class<gsi::PluginImpl> decl_Plugin (decl_PluginBase, "lay", "Plugin",
callback ("menu_activated", &gsi::PluginImpl::menu_activated, &gsi::PluginImpl::f_menu_activated, gsi::arg ("symbol"), callback ("menu_activated", &gsi::PluginImpl::menu_activated, &gsi::PluginImpl::f_menu_activated, gsi::arg ("symbol"),

View File

@ -23,6 +23,8 @@
#ifndef HDR_layEditorOptionsPageWidget #ifndef HDR_layEditorOptionsPageWidget
#define HDR_layEditorOptionsPageWidget #define HDR_layEditorOptionsPageWidget
#if defined(HAVE_QT)
#include <QWidget> #include <QWidget>
#include "layviewCommon.h" #include "layviewCommon.h"
@ -68,3 +70,5 @@ protected:
#endif #endif
#endif

View File

@ -23,6 +23,8 @@
#ifndef HDR_layEditorOptionsPages #ifndef HDR_layEditorOptionsPages
#define HDR_layEditorOptionsPages #define HDR_layEditorOptionsPages
#if defined(HAVE_QT)
#include "layviewCommon.h" #include "layviewCommon.h"
#include "layEditorOptionsPage.h" #include "layEditorOptionsPage.h"
@ -125,3 +127,5 @@ private:
#endif #endif
#endif

View File

@ -9,27 +9,15 @@ DEFINES += MAKE_LAYVIEW_LIBRARY
RESOURCES = \ RESOURCES = \
SOURCES = \ SOURCES = \
gsiDeclLayEditorOptionsPage.cc \
gsiDeclLayConfigPage.cc \
gsiDeclLayPluginFactory.cc \ gsiDeclLayPluginFactory.cc \
gsiDeclLayPlugin.cc \ gsiDeclLayPlugin.cc \
gsiDeclLayAdditional.cc \ gsiDeclLayAdditional.cc \
layEditorOptionsPageWidget.cc \
layGridNet.cc \ layGridNet.cc \
layEditorOptionsFrame.cc \
layEditorOptionsPages.cc \
layMoveEditorOptionsPage.cc \
layviewForceLink.cc \ layviewForceLink.cc \
HEADERS = \ HEADERS = \
gsiDeclLayEditorOptionsPage.h \
gsiDeclLayConfigPage.h \
layEditorOptionsPageWidget.h \
layGridNet.h \ layGridNet.h \
layEditorOptionsFrame.h \
layEditorOptionsPages.h \
layLayoutView.h \ layLayoutView.h \
layMoveEditorOptionsPage.h \
layviewForceLink.h \ layviewForceLink.h \
!equals(HAVE_QT, "0") { !equals(HAVE_QT, "0") {
@ -38,12 +26,24 @@ HEADERS = \
GridNetConfigPage.ui \ GridNetConfigPage.ui \
SOURCES += \ SOURCES += \
gsiDeclLayEditorOptionsPage.cc \
gsiDeclLayConfigPage.cc \
layGridNetConfigPage.cc \ layGridNetConfigPage.cc \
layLayoutView_qt.cc \ layEditorOptionsPageWidget.cc \
layEditorOptionsFrame.cc \
layEditorOptionsPages.cc \
layMoveEditorOptionsPage.cc \
gsiDeclLayLayoutView_qt.cc \ gsiDeclLayLayoutView_qt.cc \
layLayoutView_qt.cc \
HEADERS += \ HEADERS += \
gsiDeclLayEditorOptionsPage.h \
gsiDeclLayConfigPage.h \
layGridNetConfigPage.h \ layGridNetConfigPage.h \
layEditorOptionsFrame.h \
layEditorOptionsPages.h \
layEditorOptionsPageWidget.h \
layMoveEditorOptionsPage.h \
layLayoutView_qt.h \ layLayoutView_qt.h \
} else { } else {