mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't connect to the MainWindow
We really shouldn't need to connect to the MainWindow in order to get the right scale for the fonts when printing. While printing likely will remain a desktop only function, this is just bad design. And making calls like this from the paint() function is a bad plan, anyway. So instead we make sure that every DiveTextItem knows what the printScale was when it was created (or actually, when the text was first set as they frequently get created before we have a scene which we use to get to the profile), and gets updated whenever that scale changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
487ddce353
commit
64aace63f0
4 changed files with 32 additions and 3 deletions
|
@ -20,13 +20,19 @@ public:
|
|||
const QString &text();
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
|
||||
private
|
||||
slots:
|
||||
void fontPrintScaleUpdate(double scale);
|
||||
|
||||
private:
|
||||
void updateText();
|
||||
int internalAlignFlags;
|
||||
QGraphicsPathItem *textBackgroundItem;
|
||||
QGraphicsPathItem *textItem;
|
||||
QString internalText;
|
||||
double printScale;
|
||||
double scale;
|
||||
bool connected;
|
||||
};
|
||||
|
||||
#endif // DIVETEXTITEM_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue