diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-05 16:48:22 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-03-05 16:48:22 -0600 |
commit | b4eece7cc6ded028251408312d7b7f2aa69fe10a (patch) | |
tree | 7b7da484f62e1bed527771eadc9226ce6ca3da1d | |
parent | 9a75b154bf0732aa3a501b6e31e566e06c5f8a31 (diff) | |
download | qt3-b4eece7cc6ded028251408312d7b7f2aa69fe10a.tar.gz qt3-b4eece7cc6ded028251408312d7b7f2aa69fe10a.zip |
Fix TQPainter::drawWinFocusRect
This patch brings the behaviour on external paint devices in line with the documentation at http://trinitydesktop.org/docs/qt3/qpainter.html#drawWinFocusRect
-rw-r--r-- | src/kernel/qnamespace.h | 1 | ||||
-rw-r--r-- | src/kernel/qpainter.cpp | 2 | ||||
-rw-r--r-- | src/kernel/qpainter_x11.cpp | 17 |
3 files changed, 15 insertions, 5 deletions
diff --git a/src/kernel/qnamespace.h b/src/kernel/qnamespace.h index 2201a3d..d414d02 100644 --- a/src/kernel/qnamespace.h +++ b/src/kernel/qnamespace.h @@ -768,6 +768,7 @@ public: DotLine, DashDotLine, DashDotDotLine, + FineDotLine, MPenStyle = 0x0f }; diff --git a/src/kernel/qpainter.cpp b/src/kernel/qpainter.cpp index e5e9026..97a51b4 100644 --- a/src/kernel/qpainter.cpp +++ b/src/kernel/qpainter.cpp @@ -414,6 +414,8 @@ typedef QPtrStack<QWMatrix> QWMatrixStack; \value DashDotDotLine one dash, two dots, one dash, two dots. + \value FineDotLine single pixel dots separated by single pixels. + \value MPenStyle mask of the pen styles. \img pen-styles.png Pen Styles diff --git a/src/kernel/qpainter_x11.cpp b/src/kernel/qpainter_x11.cpp index 206bffc..126c0d6 100644 --- a/src/kernel/qpainter_x11.cpp +++ b/src/kernel/qpainter_x11.cpp @@ -786,6 +786,13 @@ void QPainter::updatePen() dashes[5] = dot; dash_len = 6; allow_zero_lw = FALSE; + break; + case FineDotLine: + dot = 1; + dashes[0] = dot; + dashes[1] = dot; + dash_len = 2; + allow_zero_lw = FALSE; } Q_ASSERT( dash_len <= (int) sizeof(dashes) ); @@ -1836,21 +1843,21 @@ void QPainter::drawWinFocusRect( int x, int y, int w, int h, if ( xorPaint ) { if ( QColor::numBitPlanes() <= 8 ) - setPen( color1 ); + setPen( QPen(color1, 0, Qt::FineDotLine) ); else - setPen( white ); + setPen( QPen(white, 0, Qt::FineDotLine) ); setRasterOp( XorROP ); } else { if ( qGray( bgColor.rgb() ) < 128 ) - setPen( white ); + setPen( QPen(white, 0, Qt::FineDotLine) ); else - setPen( black ); + setPen( QPen(black, 0, Qt::FineDotLine) ); } if ( testf(ExtDev|VxF|WxF) ) { if ( testf(ExtDev) ) { QPDevCmdParam param[1]; - QRect r( x, y, w, h ); + QRect r( x, y, w-1, h-1 ); param[0].rect = &r; if ( !pdev->cmd( QPaintDevice::PdcDrawRect, this, param ) || !hd) { setRasterOp( old_rop ); |