Changeset View
Changeset View
Standalone View
Standalone View
ui/annotationwidgets.h
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 85 | Q_SIGNALS: | |||
---|---|---|---|---|---|
86 | void dataChanged(); | 86 | void dataChanged(); | ||
87 | 87 | | |||
88 | protected: | 88 | protected: | ||
89 | QWidget * createAppearanceWidget(); | 89 | QWidget * createAppearanceWidget(); | ||
90 | 90 | | |||
91 | virtual QWidget * createStyleWidget(); | 91 | virtual QWidget * createStyleWidget(); | ||
92 | virtual QWidget * createExtraWidget(); | 92 | virtual QWidget * createExtraWidget(); | ||
93 | 93 | | |||
94 | private: | ||||
95 | virtual bool hasColorButton() const { return true; } | ||||
96 | virtual bool hasOpacityBox() const { return true; } | ||||
97 | | ||||
94 | Okular::Annotation * m_ann; | 98 | Okular::Annotation * m_ann; | ||
95 | QWidget * m_appearanceWidget; | 99 | QWidget * m_appearanceWidget { nullptr }; | ||
tobiasdeiminger: It's not nice to have such a special type in the base class. Should better go to… | |||||
96 | QWidget * m_extraWidget; | 100 | QWidget * m_extraWidget { nullptr }; | ||
97 | KColorButton *m_colorBn; | 101 | KColorButton *m_colorBn { nullptr }; | ||
98 | QSpinBox *m_opacity; | 102 | QSpinBox *m_opacity { nullptr }; | ||
99 | }; | 103 | }; | ||
100 | 104 | | |||
105 | class QVBoxLayout; | ||||
106 | class QGridLayout; | ||||
107 | | ||||
101 | class TextAnnotationWidget | 108 | class TextAnnotationWidget | ||
All pointer type members of TextAnnotationWidget should be default initialized to nullptr (unrelated cleanup). tobiasdeiminger: All pointer type members of TextAnnotationWidget should be default initialized to nullptr… | |||||
102 | : public AnnotationWidget | 109 | : public AnnotationWidget | ||
103 | { | 110 | { | ||
104 | Q_OBJECT | 111 | Q_OBJECT | ||
105 | 112 | | |||
106 | public: | 113 | public: | ||
107 | explicit TextAnnotationWidget( Okular::Annotation * ann ); | 114 | explicit TextAnnotationWidget( Okular::Annotation * ann ); | ||
108 | 115 | | |||
109 | void applyChanges() override; | 116 | void applyChanges() override; | ||
110 | 117 | | |||
111 | protected: | 118 | protected: | ||
112 | QWidget * createStyleWidget() override; | 119 | QWidget * createStyleWidget() override; | ||
113 | 120 | | |||
114 | private: | 121 | private: | ||
122 | virtual bool hasColorButton() const override; | ||||
123 | virtual bool hasOpacityBox() const override; | ||||
124 | | ||||
125 | void createPopupNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); | ||||
126 | void createInlineNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); | ||||
127 | void createTypewriterStyleUi( QWidget * widget, QVBoxLayout * layout ); | ||||
128 | void addPixmapSelector( QWidget * widget, QLayout * layout ); | ||||
129 | void addFontRequester( QWidget * widget, QGridLayout * layout ); | ||||
130 | void addTextAlignComboBox( QWidget * widget, QGridLayout * layout ); | ||||
131 | void addWidthSpinBox( QWidget * widget, QGridLayout * layout ); | ||||
132 | | ||||
133 | inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); } | ||||
134 | | ||||
115 | Okular::TextAnnotation * m_textAnn; | 135 | Okular::TextAnnotation * m_textAnn; | ||
116 | PixmapPreviewSelector * m_pixmapSelector; | 136 | PixmapPreviewSelector * m_pixmapSelector { nullptr }; | ||
117 | KFontRequester * m_fontReq; | 137 | KFontRequester * m_fontReq { nullptr }; | ||
118 | QComboBox * m_textAlign; | 138 | QComboBox * m_textAlign { nullptr }; | ||
119 | QDoubleSpinBox * m_spinWidth; | 139 | QDoubleSpinBox * m_spinWidth { nullptr }; | ||
120 | }; | 140 | }; | ||
121 | 141 | | |||
122 | class StampAnnotationWidget | 142 | class StampAnnotationWidget | ||
123 | : public AnnotationWidget | 143 | : public AnnotationWidget | ||
124 | { | 144 | { | ||
125 | Q_OBJECT | 145 | Q_OBJECT | ||
126 | 146 | | |||
127 | public: | 147 | public: | ||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
It's not nice to have such a special type in the base class. Should better go to TextAnnotationWidget.