Remove dead code from QColorDialog

Detected by GCC 6.

Change-Id: I24a735698d3c4a719fc9ffff1425f193511406f9
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
Thiago Macieira 2016-01-03 12:41:09 -02:00
parent 186d391f25
commit 56b5706ce0

View File

@ -168,8 +168,6 @@ private:
namespace {
struct QWellArrayData;
class QWellArray : public QWidget
{
Q_OBJECT
@ -189,8 +187,6 @@ public:
QSize sizeHint() const Q_DECL_OVERRIDE;
virtual void setCellBrush(int row, int col, const QBrush &);
inline int cellWidth() const
{ return cellw; }
@ -257,7 +253,6 @@ private:
int curCol;
int selRow;
int selCol;
QWellArrayData *d;
};
void QWellArray::paintEvent(QPaintEvent *e)
@ -307,15 +302,10 @@ void QWellArray::paintEvent(QPaintEvent *e)
}
}
struct QWellArrayData {
QBrush *brush;
};
QWellArray::QWellArray(int rows, int cols, QWidget *parent)
: QWidget(parent)
,nrows(rows), ncols(cols)
{
d = 0;
setFocusPolicy(Qt::StrongFocus);
cellw = 28;
cellh = 24;
@ -364,14 +354,12 @@ void QWellArray::paintCell(QPainter* p, int row, int col, const QRect &rect)
*/
void QWellArray::paintCellContents(QPainter *p, int row, int col, const QRect &r)
{
if (d) {
p->fillRect(r, d->brush[row*numCols()+col]);
} else {
p->fillRect(r, Qt::white);
p->setPen(Qt::black);
p->drawLine(r.topLeft(), r.bottomRight());
p->drawLine(r.topRight(), r.bottomLeft());
}
Q_UNUSED(row);
Q_UNUSED(col);
p->fillRect(r, Qt::white);
p->setPen(Qt::black);
p->drawLine(r.topLeft(), r.bottomRight());
p->drawLine(r.topRight(), r.bottomLeft());
}
void QWellArray::mousePressEvent(QMouseEvent *e)
@ -447,17 +435,6 @@ void QWellArray::focusInEvent(QFocusEvent*)
emit currentChanged(curRow, curCol);
}
void QWellArray::setCellBrush(int row, int col, const QBrush &b)
{
if (!d) {
d = new QWellArrayData;
int i = numRows()*numCols();
d->brush = new QBrush[i];
}
if (row >= 0 && row < numRows() && col >= 0 && col < numCols())
d->brush[row*numCols()+col] = b;
}
/*!\reimp
*/