Fixes for OSX
Fix 8x8 data grid not showing up on OSX. Reformat text within data grid a bit.
This commit is contained in:
+4
-1
@@ -43,6 +43,7 @@ void CANDataGrid::mousePressEvent(QMouseEvent *event)
|
||||
void CANDataGrid::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
qDebug() << "CANDataGrid Paint Event";
|
||||
int x, y;
|
||||
unsigned char prevByte, thisByte;
|
||||
bool thisBit, prevBit;
|
||||
@@ -54,6 +55,8 @@ void CANDataGrid::paintEvent(QPaintEvent *event)
|
||||
int xSpan = viewport.right() - viewport.left();
|
||||
int ySpan = viewport.bottom() - viewport.top();
|
||||
|
||||
qDebug() << "XSpan" << xSpan << " YSpan " << ySpan;
|
||||
|
||||
int xSector = xSpan / 10;
|
||||
int ySector = ySpan / 10;
|
||||
|
||||
@@ -139,7 +142,7 @@ void CANDataGrid::paintEvent(QPaintEvent *event)
|
||||
|
||||
//painter.fillRect(viewport.left() + (x+2) * xSector, viewport.top() + (y+2) * ySector, xSector, ySector, redBrush);
|
||||
painter.drawRect(viewport.left() + (x+2) * xSector, viewport.top() + (y+2) * ySector, xSector, ySector);
|
||||
painter.drawText(viewport.left() + (x+2) * xSector + (xSector / 3), viewport.top() + (y + 3) * ySector - (ySector / 3), QString::number(y * 8 + (7-x)));
|
||||
painter.drawText(viewport.left() + (x+2) * xSector + (xSector / 8), viewport.top() + (y + 3) * ySector - (ySector / 3), QString::number(y * 8 + (7-x)));
|
||||
}
|
||||
}
|
||||
upperLeft.setX(viewport.left() + 2 * xSector);
|
||||
|
||||
@@ -44,6 +44,8 @@ void NewGraphDialog::showEvent(QShowEvent* event)
|
||||
{
|
||||
QDialog::showEvent(event);
|
||||
loadMessages();
|
||||
drawBitfield();
|
||||
qDebug() << "S" << ui->gridData->geometry();
|
||||
}
|
||||
|
||||
void NewGraphDialog::addButtonClicked()
|
||||
@@ -153,6 +155,7 @@ void NewGraphDialog::bitfieldClicked(int x,int y)
|
||||
|
||||
void NewGraphDialog::drawBitfield()
|
||||
{
|
||||
qDebug() << "Draw Bitfield";
|
||||
int64_t bitField = 0;
|
||||
int endBit, sBit;
|
||||
|
||||
|
||||
@@ -46,8 +46,8 @@
|
||||
<widget class="CANDataGrid" name="bitfield" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>200</height>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>681</width>
|
||||
<height>640</height>
|
||||
<height>659</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -133,14 +133,14 @@
|
||||
<widget class="CANDataGrid" name="gridData" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>290</height>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>150</height>
|
||||
<width>300</width>
|
||||
<height>300</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
Reference in New Issue
Block a user