Skip to content
Permalink
Browse files
Set font via stylesheet
  • Loading branch information
domi4484 committed May 13, 2021
1 parent c2f470b commit 3992e1815587cdd3ec720de86dc18e72856be564
@@ -44,9 +44,8 @@ class GUI_EXPORT QgsJsonEditConfigDlg : public QgsEditorConfigWidget, private Ui
*/
explicit QgsJsonEditConfigDlg( QgsVectorLayer *vl, int fieldIdx, QWidget *parent = nullptr );

// QgsEditorConfigWidget interface
public:
QVariantMap config() override;

void setConfig( const QVariantMap &config ) override;
};

@@ -32,7 +32,7 @@ QgsJsonEditWidget::QgsJsonEditWidget( QWidget *parent )
mCodeEditorJson->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded );
mCodeEditorJson->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );

mTreeWidget->setFont( QgsCodeEditor::getMonospaceFont() );
mTreeWidget->setStyleSheet( QStringLiteral( "font-family: %1;" ).arg( QgsCodeEditor::getMonospaceFont().family() ) );

connect( mTextToolButton, &QToolButton::clicked, this, &QgsJsonEditWidget::textToolButtonClicked );
connect( mTreeToolButton, &QToolButton::clicked, this, &QgsJsonEditWidget::treeToolButtonClicked );
@@ -39,9 +39,8 @@ class GUI_EXPORT QgsJsonEditWidgetFactory : public QgsEditorWidgetFactory
*/
QgsJsonEditWidgetFactory( const QString &name );

// QgsEditorWidgetFactory interface
public:
QgsEditorWidgetWrapper *create( QgsVectorLayer *vl, int fieldIdx, QWidget *editor, QWidget *parent ) const override;

QgsEditorConfigWidget *configWidget( QgsVectorLayer *vl, int fieldIdx, QWidget *parent ) const override;

unsigned int fieldScore( const QgsVectorLayer *vl, int fieldIdx ) const override;
@@ -54,9 +54,8 @@ class GUI_EXPORT QgsJsonEditWrapper : public QgsEditorWidgetWrapper
*/
explicit QgsJsonEditWrapper( QgsVectorLayer *layer, int fieldIdx, QWidget *editor = nullptr, QWidget *parent = nullptr );

// QgsEditorWidgetWrapper interface
public:
QVariant value() const override;

void showIndeterminateState() override;

protected:

0 comments on commit 3992e18

Please sign in to comment.