QViScintilla
::QViScintilla( QWidget* parent
) : QsciScintilla(parent)
{
const QString usersetfont
= setter.
value("DefaultFontsS").
toString();
settfont.fromString(usersetfont);
int fromsetting = settfont.pointSize();
qDebug() << "### sci usersetfont " << usersetfont;
qDebug() << "### sci fromsetting " << fromsetting;
fontsize = 12;
#if defined Q_WS_MAC
fontsize = 22;
#endif
numerobase = 0;
if (fromsetting > 2) {
setFont(settfont);
} else {
font.
setFamily(QString::fromUtf8("Arial"));
font.setPointSize(fontsize);
setFont(font);
}
/* QsciLexerHTML lexer overwrite font! */
setIndentationGuidesBackgroundColor
(QColor("#e6e6de"));
setAutoCompletionThreshold(2);
setFolding(QsciScintilla::BoxedFoldStyle);;
setMarginLineNumbers(1,true);
setAutoCompletionFillupsEnabled(true);
setAutoCompletionSource(QsciScintilla::AcsAll);
setCaretWidth(10);
setCaretLineBackgroundColor
(QColor("#e6fff0"));
setCaretLineVisible(true);
ensureLineVisible(1);
setUtf8(true);
setWhitespaceVisibility(QsciScintilla::WsVisible);
QsciLexerHTML *htmllex = new QsciLexerHTML(this);
setLexer(htmllex);
model = PAGER_LOADING_FUNCTIONS;
connect(shortcut1, SIGNAL(activated()),this, SLOT(SaveCurrentDoc()));
/////////connect(this, SIGNAL(textChanged()),this, SLOT(UpdateParent()));
connect(shortcut7, SIGNAL(activated()),this, SLOT(Decreasefont()));
connect(shortcut8, SIGNAL(activated()),this, SLOT(Increasefont()));
}
void QViScintilla::Increasefont()
{
////qDebug() << "### zoom + " << fontsize;
zoomIn();
}
void QViScintilla::Decreasefont()
{
////qDebug() << "### zoom - " << fontsize;
zoomOut();
}
QViScintilla::QViScintilla( QWidget* parent )
: QsciScintilla(parent)
{
const QString usersetfont = setter.value("DefaultFontsS").toString();
QFont settfont;
settfont.fromString(usersetfont);
int fromsetting = settfont.pointSize();
qDebug() << "### sci usersetfont " << usersetfont;
qDebug() << "### sci fromsetting " << fromsetting;
fontsize = 12;
#if defined Q_WS_MAC
fontsize = 22;
#endif
numerobase = 0;
if (fromsetting > 2) {
setFont(settfont);
} else {
QFont font;
font.setFamily(QString::fromUtf8("Arial"));
font.setPointSize(fontsize);
setFont(font);
}
/* QsciLexerHTML lexer overwrite font! */
setPaper(QColor("#fbffcb"));
setIndentationGuidesBackgroundColor(QColor("#e6e6de"));
setAutoCompletionThreshold(2);
setFolding(QsciScintilla::BoxedFoldStyle);;
setMarginLineNumbers(1,true);
setAutoCompletionFillupsEnabled(true);
setAutoCompletionSource(QsciScintilla::AcsAll);
setCaretWidth(10);
setCaretLineBackgroundColor(QColor("#e6fff0"));
setCaretLineVisible(true);
ensureLineVisible(1);
setUtf8(true);
setWhitespaceVisibility(QsciScintilla::WsVisible);
QsciLexerHTML *htmllex = new QsciLexerHTML(this);
setLexer(htmllex);
shortcut1 = new QShortcut(QKeySequence("Ctrl+S"),this);
model = PAGER_LOADING_FUNCTIONS;
connect(shortcut1, SIGNAL(activated()),this, SLOT(SaveCurrentDoc()));
/////////connect(this, SIGNAL(textChanged()),this, SLOT(UpdateParent()));
shortcut7 = new QShortcut(QKeySequence::ZoomOut,this); /* CTRL- */
shortcut8 = new QShortcut(QKeySequence::ZoomIn,this); /* CTRL+ */
connect(shortcut7, SIGNAL(activated()),this, SLOT(Decreasefont()));
connect(shortcut8, SIGNAL(activated()),this, SLOT(Increasefont()));
}
void QViScintilla::Increasefont()
{
////qDebug() << "### zoom + " << fontsize;
zoomIn();
}
void QViScintilla::Decreasefont()
{
////qDebug() << "### zoom - " << fontsize;
zoomOut();
}
To copy to clipboard, switch view to plain text mode
Bookmarks