source: terepaima/terepaima-0.4.16/sources/thumbnailitem.h

desarrollostretch
Last change on this file was 1f4adec, checked in by aosorio <aosorio@…>, 8 years ago

Agregado proyecto base, esto luego del dh_make -f

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2
3Copyright 2014 Adam Reichold
4
5This file is part of qpdfview.
6
7qpdfview is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12qpdfview is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with qpdfview.  If not, see <http://www.gnu.org/licenses/>.
19
20*/
21
22#ifndef THUMBNAILITEM_H
23#define THUMBNAILITEM_H
24
25#include <QString>
26
27#if QT_VERSION >= QT_VERSION_CHECK(4,7,0)
28
29#include <QStaticText>
30
31#endif // QT_VERSION
32
33#include "pageitem.h"
34
35namespace qpdfview
36{
37
38namespace Model
39{
40class Page;
41}
42
43class ThumbnailItem : public PageItem
44{
45    Q_OBJECT
46
47public:
48    ThumbnailItem(Model::Page* page, const QString& text, int index, QGraphicsItem* parent = 0);
49
50    QRectF boundingRect() const;
51    void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
52
53#if QT_VERSION >= QT_VERSION_CHECK(4,7,0)
54
55    QString text() const { return m_text.text(); }
56    void setText(const QString& text) { m_text.setText(text); }
57
58#else
59
60    const QString& text() const { return m_text; }
61    void setText(const QString& text) { m_text = text; }
62
63#endif // QT_VERSION
64
65    qreal textHeight() const;
66
67    bool isHighlighted() const { return m_isHighlighted; }
68    void setHighlighted(bool highlighted);
69
70protected:
71    void mousePressEvent(QGraphicsSceneMouseEvent* event);
72    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*);
73    void mouseMoveEvent(QGraphicsSceneMouseEvent*);
74    void mouseReleaseEvent(QGraphicsSceneMouseEvent*);
75
76    void contextMenuEvent(QGraphicsSceneContextMenuEvent*);
77
78private slots:
79    void loadInteractiveElements();
80
81private:
82    Q_DISABLE_COPY(ThumbnailItem)
83
84#if QT_VERSION >= QT_VERSION_CHECK(4,7,0)
85
86    QStaticText m_text;
87
88#else
89
90    QString m_text;
91
92#endif // QT_VERSION
93
94    bool m_isHighlighted;
95
96};
97
98} // qpdfview
99
100#endif // THUMBNAILITEM_H
Note: See TracBrowser for help on using the repository browser.