added spicy new segfaults
This commit is contained in:
+74
@@ -0,0 +1,74 @@
|
||||
#ifndef WORDPART_H
|
||||
#define WORDPART_H
|
||||
|
||||
#include <QRect>
|
||||
#include <QStringRef>
|
||||
|
||||
class Word;
|
||||
|
||||
class WordPart
|
||||
{
|
||||
public:
|
||||
WordPart(Word& word, int x, int y, const QStringRef& copyText, bool allowTrailingSpace = true);
|
||||
|
||||
const Word& word() const {
|
||||
return m_word;
|
||||
}
|
||||
|
||||
int width() const {
|
||||
return m_width;
|
||||
}
|
||||
|
||||
int height() const {
|
||||
return m_height;
|
||||
}
|
||||
|
||||
int x() const {
|
||||
return m_x;
|
||||
}
|
||||
|
||||
int y() const {
|
||||
return m_y;
|
||||
}
|
||||
|
||||
void setPosition(int x, int y) {
|
||||
m_x = x;
|
||||
m_y = y;
|
||||
}
|
||||
|
||||
int right() const {
|
||||
return m_x + m_width;
|
||||
}
|
||||
|
||||
int bottom() const {
|
||||
return m_y + m_height;
|
||||
}
|
||||
|
||||
QRect rect() const {
|
||||
return QRect(m_x, m_y, m_width, m_height);
|
||||
}
|
||||
|
||||
const QStringRef copyText() const {
|
||||
return m_copyText;
|
||||
}
|
||||
|
||||
int hasTrailingSpace() const {
|
||||
return m_trailingSpace;
|
||||
}
|
||||
|
||||
const QString& getText() const;
|
||||
|
||||
private:
|
||||
Word& m_word;
|
||||
|
||||
QStringRef m_copyText;
|
||||
|
||||
int m_x;
|
||||
int m_y;
|
||||
int m_width;
|
||||
int m_height;
|
||||
|
||||
bool m_trailingSpace;
|
||||
};
|
||||
|
||||
#endif // WORDPART_H
|
||||
Reference in New Issue
Block a user