Début modif C-Vertu pour 2 itinéraires

This commit is contained in:
jfmartel
2021-06-10 15:27:46 -04:00
parent 7081376137
commit 02b67321bb
7 changed files with 161 additions and 17 deletions
+2 -2
View File
@@ -34,7 +34,7 @@
CCDVItem::CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent)
CCDVItem::CCDVItem(CCDV *CDVPtr, QGraphicsItem *Parent)
{
if(Parent != 0)
setParentItem(Parent);
@@ -47,7 +47,7 @@ CCDVItem::CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent)
mCDVState = CDV_STATE_FREE;
mCurBrush = mCDVFreeBrush;
setGeometry(0,0,90,20);
setGeometry(0,0,90,20);
}
CCDVItem::~CCDVItem()
+2 -1
View File
@@ -33,6 +33,7 @@
#ifndef CDVITEM_H
#define CDVITEM_H
class CCDV;
class CCDVItem : public QGraphicsWidget
@@ -40,7 +41,7 @@ class CCDVItem : public QGraphicsWidget
Q_OBJECT
public:
CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent = 0);
CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent = 0);
~CCDVItem();
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
+12 -1
View File
@@ -198,6 +198,12 @@ unsigned int CZTPage::SetCDVList(QList<CCDV *> *CDVListPtr)
//adjust all their position on screen and
//set parameters
// unsigned int LastPos = 0;
bool scale = false;
if(mCDVList->size() > 9)
{
scale = true;
}
for(int i = 0; i < mCDVList->size(); i++)
{
int x = 0, y = 70;
@@ -214,9 +220,14 @@ unsigned int CZTPage::SetCDVList(QList<CCDV *> *CDVListPtr)
}
if(scale)
{
NewCDVGraphicalItem->resize(70,NewCDVGraphicalItem->rect().height());
}
NewCDVGraphicalItem->SetParameters(mCDVList->at(i)->GetLabel());
mCDVItemsList.append(NewCDVGraphicalItem);
x = (mCDVList->at(i)->GetCDVGraphicalPos() * NewCDVGraphicalItem->geometry().width())+90;
x = (mCDVList->at(i)->GetCDVGraphicalPos() * NewCDVGraphicalItem->geometry().width())+90;
if(mCDVList->at(i)->GetCDVWay() == 2)
y += WaysSpacing+NewCDVGraphicalItem->geometry().height();
// NewCDVGraphicalItem->setPos(i*NewCDVGraphicalItem->geometry().width()+90,70);