mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Signatures: line tool
This commit is contained in:
@@ -24,6 +24,7 @@ namespace pdf
|
||||
{
|
||||
|
||||
class PDFPageContentScene;
|
||||
class PDFPageContentElementLine;
|
||||
class PDFPageContentElementRectangle;
|
||||
|
||||
class PDFCreatePCElementTool : public PDFWidgetTool
|
||||
@@ -68,6 +69,39 @@ private:
|
||||
PDFPageContentElementRectangle* m_element;
|
||||
};
|
||||
|
||||
/// Tool that creates line element.
|
||||
class PDF4QTLIBSHARED_EXPORT PDFCreatePCElementLineTool : public PDFCreatePCElementTool
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
using BaseClass = PDFCreatePCElementTool;
|
||||
|
||||
public:
|
||||
explicit PDFCreatePCElementLineTool(PDFDrawWidgetProxy* proxy,
|
||||
PDFPageContentScene* scene,
|
||||
QAction* action,
|
||||
bool isHorizontal,
|
||||
bool isVertical,
|
||||
QObject* parent);
|
||||
virtual ~PDFCreatePCElementLineTool() override;
|
||||
|
||||
virtual void drawPage(QPainter* painter,
|
||||
PDFInteger pageIndex,
|
||||
const PDFPrecompiledPage* compiledPage,
|
||||
PDFTextLayoutGetter& layoutGetter,
|
||||
const QMatrix& pagePointToDevicePointMatrix,
|
||||
QList<PDFRenderError>& errors) const override;
|
||||
|
||||
private:
|
||||
void clear();
|
||||
void onPointPicked(pdf::PDFInteger pageIndex, QPointF pagePoint);
|
||||
|
||||
PDFPickTool* m_pickTool;
|
||||
PDFPageContentElementLine* m_element;
|
||||
std::optional<QPointF> m_startPoint;
|
||||
};
|
||||
|
||||
} // namespace pdf
|
||||
|
||||
#endif // PDFPAGECONTENTEDITORTOOLS_H
|
||||
|
Reference in New Issue
Block a user