Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[FEATURE][composer] Allow specifying user stylesheets to apply to a H…
…TML item's content
- Loading branch information
Showing
with
324 additions
and 4 deletions.
- +37 −0 python/core/composer/qgscomposerhtml.sip
- +1 −0 python/gui/gui.sip
- +10 −0 python/gui/qgscodeeditorcss.sip
- +57 −1 src/app/composer/qgscomposerhtmlwidget.cpp
- +5 −0 src/app/composer/qgscomposerhtmlwidget.h
- +35 −1 src/core/composer/qgscomposerhtml.cpp
- +39 −0 src/core/composer/qgscomposerhtml.h
- +2 −0 src/gui/CMakeLists.txt
- +47 −0 src/gui/qgscodeeditorcss.cpp
- +39 −0 src/gui/qgscodeeditorcss.h
- +30 −2 src/ui/qgscomposerhtmlwidgetbase.ui
- +22 −0 tests/src/core/testqgscomposerhtml.cpp
- BIN ...data/control_images/expected_composerhtml_userstylesheet/expected_composerhtml_userstylesheet.png
@@ -0,0 +1,10 @@ | ||
class QgsCodeEditorCSS: QgsCodeEditor | ||
{ | ||
%TypeHeaderCode | ||
#include <qgscodeeditorcss.h> | ||
%End | ||
|
||
public: | ||
QgsCodeEditorCSS( QWidget *parent /TransferThis/ = 0 ); | ||
~QgsCodeEditorCSS(); | ||
}; |
@@ -0,0 +1,47 @@ | ||
/*************************************************************************** | ||
qgscodeeditorcss.cpp - A CSS editor based on QScintilla | ||
-------------------------------------- | ||
Date : 27-Jul-2014 | ||
Copyright : (C) 2014 by Nyall Dawson | ||
Email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#include "qgsapplication.h" | ||
#include "qgscodeeditorcss.h" | ||
|
||
#include <QWidget> | ||
#include <QString> | ||
#include <QFont> | ||
#include <Qsci/qscilexercss.h> | ||
|
||
|
||
QgsCodeEditorCSS::QgsCodeEditorCSS( QWidget *parent ) | ||
: QgsCodeEditor( parent ) | ||
{ | ||
if ( !parent ) | ||
{ | ||
setTitle( tr( "CSS Editor" ) ); | ||
} | ||
setMarginVisible( false ); | ||
setFoldingVisible( true ); | ||
setSciLexerCSS(); | ||
} | ||
|
||
QgsCodeEditorCSS::~QgsCodeEditorCSS() | ||
{ | ||
} | ||
|
||
void QgsCodeEditorCSS::setSciLexerCSS() | ||
{ | ||
QsciLexerCSS* lexer = new QsciLexerCSS(); | ||
lexer->setDefaultFont( QFont( "Sans", 10 ) ); | ||
|
||
setLexer( lexer ); | ||
} |
Oops, something went wrong.