1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2025-10-16 15:38:43 +02:00

bugfix 2545, 2547

This commit is contained in:
2008-04-27 14:21:37 +00:00
parent 4a63a97e6c
commit 0de0cfa5df
2 changed files with 39 additions and 9 deletions

View File

@ -31,6 +31,7 @@ RuleGroupPanel::RuleGroupPanel (QWidget * parent,RuleSetView * rsv, int row) : Q
this->rsv = rsv;
this->setupUi(this);
setContentsMargins (3,3,3,3);
showHideRuleGroupButton->hide();
//showHideRuleGroupButton->setText("Collapse Group");
connect (showHideRuleGroupButton, SIGNAL(pressed()),this,SLOT(showHideRuleGroup()));
}

View File

@ -1362,12 +1362,22 @@ void RuleSetView::paintCell(QPainter *pntr,
if (rule==NULL)
{
RuleRowInfo * rri = rowsInfo[row];
if (!isRowHidden(row+1))
{
p.drawLine( (cr.width()-1)/2, (cr.height()-1)/2, cr.width()-1, (cr.height()-1)/2 );
if (rri->isBeginRow)
p.drawLine( (cr.width()-1)/2, (cr.height()-1)/2, (cr.width()-1)/2, cr.height()-1 );
}
{
p.drawRect((cr.width()-1)/2-4,(cr.height()-1)/2-4,8,8);
p.drawLine( (cr.width()-1)/2+7, (cr.height()-1)/2, cr.width()-1, (cr.height()-1)/2 );
p.drawLine( (cr.width()-1)/2-2, (cr.height()-1)/2,(cr.width()-1)/2+2, (cr.height()-1)/2);
if (!isRowHidden(row+1))
{
//if (!isRowHidden(row))
p.drawLine( (cr.width()-1)/2, (cr.height()-1)/2+7, (cr.width()-1)/2, cr.height()-1 );
p.drawLine( (cr.width()-1)/2, (cr.height()-1)/2-2,(cr.width()-1)/2, (cr.height()-1)/2+2);
}
}
}
else
{
@ -1473,8 +1483,13 @@ void RuleSetView::paintCell(QPainter *pntr,
{
p.drawLine( 1, 0, 1, cr.height()-1 );
}
p.drawLine( 1, cr.height()-3, cr.width() , cr.height()-3);
//p.drawLine( cr.width()-3, 0, cr.width()-3, cr.height()-1 );
p.drawLine( 1, cr.height()-3, cr.width()-3 , cr.height()-3);
if (col==ncols-1)
{
p.drawLine( cr.width()-3, 0, cr.width()-3, cr.height()-3 );
}
//p.drawLine( cr.width()-3, 0, cr.width()-3, cr.height()-1 );
}
else
{
@ -1482,11 +1497,11 @@ void RuleSetView::paintCell(QPainter *pntr,
if (col==1)
{
p.drawLine( 1, 0, 1, cr.height() );
p.drawLine( 1, 0, 1, cr.height()-3 );
}
if (col==ncols-1)
{
p.drawLine( cr.width()-3, 0, cr.width()-3, cr.height() );
p.drawLine( cr.width()-3, 0, cr.width()-3, cr.height()-3 );
}
@ -2191,6 +2206,20 @@ void RuleSetView::mousePressEvent( QMouseEvent* ev )
int row=rowAt(ev->y());
int col=columnAt(ev->x());
if (col==0)
{
if (rowsInfo[row]!=NULL)
{
QWidget * wgt = indexWidget(model()->index(row,1));
RuleGroupPanel * rfp = dynamic_cast<RuleGroupPanel *>(wgt);
if (rfp!=NULL)
{
showHideRuleGroup(rfp);
}
}
}
FWObject *obj=getObj(row,col,ev->y()+verticalOffset());
bool needUpdate= (row==currentRow() && col==currentColumn() && selectedObject!=obj);