Début modif C-Vertu pour 2 itinéraires
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user