Changeset View
Changeset View
Standalone View
Standalone View
src/ksqueezedtextlabel.h
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 56 | public: | |||
---|---|---|---|---|---|
77 | 77 | | |||
78 | /** | 78 | /** | ||
79 | * @return the label's preferred size, which is wide enough | 79 | * @return the label's preferred size, which is wide enough | ||
80 | * to display the text without squeezing it | 80 | * to display the text without squeezing it | ||
81 | */ | 81 | */ | ||
82 | QSize sizeHint() const Q_DECL_OVERRIDE; | 82 | QSize sizeHint() const Q_DECL_OVERRIDE; | ||
83 | 83 | | |||
84 | /** | 84 | /** | ||
85 | * Sets the indentation of the label. | ||||
86 | * Reimplementation of QLabel::setIndent(), but see setText() for additional remark. | ||||
87 | * @param indent the amount of indentation in pixels | ||||
88 | * | ||||
89 | * @since 5.38 | ||||
90 | */ | ||||
91 | void setIndent(int indent); | ||||
92 | | ||||
93 | /** | ||||
94 | * Sets the margin of the label. | ||||
95 | * Reimplementation of QLabel::setMargin(), but see setText() for additional remark. | ||||
96 | * @param margin the margin size in pixels | ||||
97 | * | ||||
98 | * @since 5.38 | ||||
99 | */ | ||||
100 | void setMargin(int margin); | ||||
101 | | ||||
102 | /** | ||||
103 | * Sets the frame width of the label. | ||||
104 | * Reimplementation of QLabel::setLineWidth(), but see setText() for additional remark. | ||||
105 | * @param width the frame width in pixels | ||||
106 | * | ||||
107 | * @see QFrame::setFrameStyle() | ||||
108 | * | ||||
109 | * @since 5.38 | ||||
110 | */ | ||||
111 | void setLineWidth(int width); | ||||
112 | | ||||
113 | /** | ||||
85 | * Overridden for internal reasons; the API remains unaffected. | 114 | * Overridden for internal reasons; the API remains unaffected. | ||
86 | */ | 115 | */ | ||
87 | virtual void setAlignment(Qt::Alignment); | 116 | virtual void setAlignment(Qt::Alignment); | ||
88 | 117 | | |||
89 | /** | 118 | /** | ||
90 | * @return the text elide mode | 119 | * @return the text elide mode | ||
91 | */ | 120 | */ | ||
92 | Qt::TextElideMode textElideMode() const; | 121 | Qt::TextElideMode textElideMode() const; | ||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 168 | protected: | |||
152 | */ | 181 | */ | ||
153 | void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE; | 182 | void contextMenuEvent(QContextMenuEvent *) Q_DECL_OVERRIDE; | ||
154 | 183 | | |||
155 | /** | 184 | /** | ||
156 | * does the dirty work | 185 | * does the dirty work | ||
157 | */ | 186 | */ | ||
158 | void squeezeTextToLabel(); | 187 | void squeezeTextToLabel(); | ||
159 | 188 | | |||
189 | /** | ||||
190 | * @return the rectangle to squeeze the text into | ||||
191 | * | ||||
192 | * Reimplementation of QLabel::contentsRect(), but see setText() for additional remark. | ||||
193 | * | ||||
194 | * @since 5.38 | ||||
195 | */ | ||||
196 | QRect contentsRect() const; | ||||
197 | | ||||
160 | private: | 198 | private: | ||
161 | Q_PRIVATE_SLOT(d, void _k_copyFullText()) | 199 | Q_PRIVATE_SLOT(d, void _k_copyFullText()) | ||
162 | KSqueezedTextLabelPrivate *const d; | 200 | KSqueezedTextLabelPrivate *const d; | ||
163 | }; | 201 | }; | ||
164 | 202 | | |||
165 | #endif // KSQUEEZEDTEXTLABEL_H | 203 | #endif // KSQUEEZEDTEXTLABEL_H |