-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix quick fits by disabling associated error + others
- Loading branch information
1 parent
61203f7
commit 73c1fab
Showing
33 changed files
with
3,591 additions
and
1,200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
QMAKE_CXX.INCDIRS = \ | ||
/usr/include/c++/8.2.1 \ | ||
/usr/include/c++/8.2.1/x86_64-pc-linux-gnu \ | ||
/usr/include/c++/8.2.1/backward \ | ||
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/include \ | ||
/usr/local/include \ | ||
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1/include-fixed \ | ||
/usr/include | ||
QMAKE_CXX.LIBDIRS = \ | ||
/usr/lib/gcc/x86_64-pc-linux-gnu/8.2.1 \ | ||
/usr/lib \ | ||
/lib | ||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L | ||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 8 | ||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2 | ||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1 | ||
QMAKE_CXX.COMPILER_MACROS = \ | ||
QT_COMPILER_STDCXX \ | ||
QMAKE_GCC_MAJOR_VERSION \ | ||
QMAKE_GCC_MINOR_VERSION \ | ||
QMAKE_GCC_PATCH_VERSION |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/*************************************************************************** | ||
File : EpsEngine.h | ||
Project : EpsEngine | ||
-------------------------------------------------------------------- | ||
Copyright : (C) 2014 by Ion Vasilief | ||
Email (use @ for *) : ion_vasilief*yahoo.fr | ||
Description : Enables the export of QPainter grafics to .eps files | ||
***************************************************************************/ | ||
#ifndef EPS_ENGINE_H | ||
#define EPS_ENGINE_H | ||
|
||
#include <QPaintDevice> | ||
#include <QPaintEngine> | ||
#include <QPrinter> | ||
|
||
class QFile; | ||
class EpsPaintEngine; | ||
|
||
class EpsPaintDevice : public QPaintDevice | ||
{ | ||
public: | ||
EpsPaintDevice(const QString& fileName, const QSize& s = QSize()); | ||
~EpsPaintDevice(); | ||
|
||
virtual QPaintEngine * paintEngine() const; | ||
//! Set color mode (Color or GrayScale) | ||
void setColorMode(const QPrinter::ColorMode &); | ||
//! Set size | ||
void setSize(const QSize& s){d_size = s;} | ||
//! Enables the Device-Independent Screen Preview | ||
void setPreviewPixmap(const QPixmap &, int = 1); | ||
//! Set creator information | ||
void setCreator(const QString&); | ||
|
||
protected: | ||
virtual int metric(PaintDeviceMetric) const; | ||
|
||
private: | ||
//! Size in pixels | ||
QSize d_size; | ||
EpsPaintEngine* engine; | ||
}; | ||
|
||
class EpsPaintEngine : public QPaintEngine | ||
{ | ||
public: | ||
EpsPaintEngine(const QString&); | ||
~EpsPaintEngine(){}; | ||
virtual bool begin(QPaintDevice*); | ||
virtual bool end(); | ||
virtual void updateState(const QPaintEngineState &){}; | ||
virtual void drawEllipse(const QRectF &); | ||
virtual QPaintEngine::Type type() const {return QPaintEngine::User;}; | ||
virtual void drawPoints(const QPointF *, int); | ||
virtual void drawLines(const QLineF * , int); | ||
virtual void drawPath(const QPainterPath&); | ||
virtual void drawPolygon(const QPointF *, int, PolygonDrawMode); | ||
virtual void drawTextItem(const QPointF &, const QTextItem &); | ||
virtual void drawRects(const QRectF *, int); | ||
virtual void drawPixmap(const QRectF &, const QPixmap &, const QRectF &); | ||
virtual void drawTiledPixmap(const QRectF&, const QPixmap&, const QPointF&); | ||
virtual void drawImage(const QRectF &, const QImage &, const QRectF &, Qt::ImageConversionFlags); | ||
|
||
//! Enables/Disables gray scale output | ||
void setGrayScale(bool on = true){d_gray_scale = on;} | ||
//! Enables the Device-Independent Screen Preview | ||
void setPreviewPixmap(const QPixmap&, int = 1); | ||
//! Set creator information | ||
void setCreator(const QString&s){d_creator_name = s;} | ||
|
||
private: | ||
enum Shape{Line, Polygon, Polyline, Rect, Ellipse, Path, Points}; | ||
//! Returns true if draw operation has NoBrush and NoPen | ||
bool emptyStringOperation(); | ||
double resFactorX(); | ||
double resFactorY(); | ||
|
||
QPointF convertPoint(const QPointF&); | ||
|
||
QString psBrush(const QBrush&, const QPainterPath& = QPainterPath()); | ||
QString psColor(const QColor&); | ||
QString psFont(const QFont&); | ||
QString psPath(const QPainterPath&); | ||
QString psPen(const QPen&); | ||
QString psPoint(const QPointF&); | ||
|
||
QString drawShape(Shape, const QPainterPath&); | ||
QString drawShape(Shape, const QString&); | ||
|
||
//! Draws pixmap pix in a given rectangle | ||
void drawPixmap(const QPixmap &, const QRectF &, const QString& = ""); | ||
void writeToFile(const QString& s); | ||
void writeImageData(const QImage&, int, int, bool = false); | ||
void writePreview(); | ||
|
||
static QString psRencode(); | ||
static QString patternStringStartHelper(int, int, int, int); | ||
static QString patternStringEndHelper(); | ||
static QString patternProcString(const Qt::BrushStyle&); | ||
QString patternString(const QBrush&); | ||
static QString escapeParentheses(const QString&); | ||
static QString replaceUnicodeCharacters(const QString&, bool *, bool *); | ||
static QString replaceGlyphs(const QString&); | ||
static QString replaceGlyph(const QString&, const QString&, int); | ||
static QString replaceSymbols(const QString&, const QString&, double); | ||
static QString replaceSymbol(const QString&, int, const QString&, const QString&, double); | ||
static int dingbatOctalCode(const QString&); | ||
static int dingbatOctalCode(int); | ||
void drawDingbatPixmap(const QString&, const QFont&, const QPen&, const QRectF&); | ||
|
||
QString replaceDingbat(const QString&, int, const QString&, const QString&, double); | ||
QString replaceDingbats(const QString&, const QString&, double); | ||
|
||
QFile *file; | ||
//! Name of the output file | ||
QString fname; | ||
bool d_gray_scale; | ||
QList<QBrush> d_brushes; | ||
QBrush d_current_brush; | ||
QPainterPath d_current_path; | ||
QStringList d_reencoded_fonts, d_dingbat_symbols; | ||
QFont d_current_font; | ||
QPixmap d_preview_pix; | ||
int d_preview_compression; | ||
QString d_creator_name; | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/*************************************************************************** | ||
File : EpsPaintDevice.cpp | ||
Project : EpsEngine | ||
-------------------------------------------------------------------- | ||
Copyright : (C) 2014 by Ion Vasilief | ||
Email (use @ for *) : ion_vasilief*yahoo.fr | ||
Description : Enables the export of QPainter grafics to .eps files | ||
***************************************************************************/ | ||
#include "EpsEngine.h" | ||
|
||
#include <QApplication> | ||
#include <QDesktopWidget> | ||
|
||
EpsPaintDevice::EpsPaintDevice(const QString& fileName, const QSize& s) | ||
: QPaintDevice() | ||
{ | ||
d_size = s; | ||
|
||
if (!d_size.isValid()) | ||
d_size = QSize(500, 400); | ||
|
||
engine = new EpsPaintEngine(fileName); | ||
} | ||
|
||
EpsPaintDevice::~EpsPaintDevice() | ||
{ | ||
delete engine; | ||
} | ||
|
||
QPaintEngine * EpsPaintDevice::paintEngine () const | ||
{ | ||
return engine; | ||
} | ||
|
||
void EpsPaintDevice::setColorMode(const QPrinter::ColorMode& mode) | ||
{ | ||
engine->setGrayScale(mode == QPrinter::GrayScale); | ||
} | ||
|
||
void EpsPaintDevice::setPreviewPixmap(const QPixmap& pix, int compression) | ||
{ | ||
engine->setPreviewPixmap(pix, compression); | ||
} | ||
|
||
void EpsPaintDevice::setCreator(const QString& s) | ||
{ | ||
engine->setCreator(s); | ||
} | ||
|
||
int EpsPaintDevice::metric(PaintDeviceMetric metric) const | ||
{ | ||
QDesktopWidget *desktop = QApplication::desktop(); | ||
int dpi_x = desktop->logicalDpiX(); | ||
int dpi_y = desktop->logicalDpiY(); | ||
switch (metric){ | ||
case QPaintDevice::PdmWidth: | ||
return d_size.width(); | ||
case QPaintDevice::PdmHeight: | ||
return d_size.height(); | ||
case QPaintDevice::PdmWidthMM: | ||
return int(25.4*d_size.width()/(double)dpi_x); | ||
case QPaintDevice::PdmHeightMM: | ||
return int(25.4*d_size.height()/(double)dpi_y); | ||
case QPaintDevice::PdmNumColors: | ||
return 65536;//should it be millions? | ||
case QPaintDevice::PdmDepth: | ||
return 32; | ||
case QPaintDevice::PdmDpiX: | ||
case QPaintDevice::PdmPhysicalDpiX: | ||
return dpi_x; | ||
case QPaintDevice::PdmDpiY: | ||
case QPaintDevice::PdmPhysicalDpiY: | ||
return dpi_y; | ||
#if QT_VERSION >= 0x050000 | ||
case QPaintDevice::PdmDevicePixelRatio: | ||
return (int)qApp->devicePixelRatio(); | ||
#endif | ||
default: | ||
qWarning ("EpsPaintDevice::Unknown metric asked"); | ||
return 0; | ||
} | ||
} |
Oops, something went wrong.