mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-01 12:24:36 -04:00
added patience plugin
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2245 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
024e7f4b44
commit
0b78ed6ff8
430 changed files with 7336 additions and 0 deletions
49
plugins/patience_plugin/Patience/Hilfszeiger.cpp
Normal file
49
plugins/patience_plugin/Patience/Hilfszeiger.cpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
#include "Hilfszeiger.h"
|
||||
#include "Basisstapel.h"
|
||||
#include "Proportionen.h"
|
||||
#include <QPainter>
|
||||
|
||||
using namespace std;
|
||||
|
||||
Hilfszeiger::Hilfszeiger(Basisstapel *parent) : QObject(parent), QGraphicsItem(parent), meinstapel(parent), breite(parent->boundingRect().width() / HILFSZEIGER_BREITE_VERHAELTNIS), hoehe(parent->boundingRect().height() / HILFSZEIGER_HOEHE_VERHAELTNIS), dicke(parent->boundingRect().height() / HILFSZEIGER_DICKE_VERHAELTNIS)
|
||||
{
|
||||
setZValue(1000);
|
||||
}
|
||||
|
||||
|
||||
Hilfszeiger::~Hilfszeiger()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void Hilfszeiger::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*)
|
||||
{
|
||||
painter->setPen(Qt::darkBlue);
|
||||
painter->setBrush(Qt::darkBlue);
|
||||
|
||||
QPen stift(painter->pen());
|
||||
stift.setWidth(dicke);
|
||||
painter->setPen(stift);
|
||||
|
||||
painter->drawLine(breite / 2, 0 + (dicke / 2), breite / 2, hoehe - (dicke / 2));
|
||||
painter->drawLine(breite / 2, 0 + (dicke / 2), dicke / 2, (hoehe / 2));
|
||||
painter->drawLine(breite / 2, 0 + (dicke / 2), breite - (dicke / 2), (hoehe / 2));
|
||||
}
|
||||
|
||||
|
||||
QRectF Hilfszeiger::boundingRect() const
|
||||
{
|
||||
return QRectF(0, 0, breite, hoehe);
|
||||
}
|
||||
|
||||
|
||||
void Hilfszeiger::passe_groesse_an(const QRectF& wert)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
|
||||
breite = wert.width() / HILFSZEIGER_BREITE_VERHAELTNIS;
|
||||
hoehe = wert.height() / HILFSZEIGER_HOEHE_VERHAELTNIS;
|
||||
dicke = wert.height() / HILFSZEIGER_DICKE_VERHAELTNIS;
|
||||
|
||||
update();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue