Changeset 8 for trunk/src/widgets/qtextedit.cpp
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/widgets/qtextedit.cpp
r7 r8 1162 1162 case Key_Home: 1163 1163 case Key_End: 1164 #if defined (Q_WS_WIN) 1164 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1165 1165 case Key_Insert: 1166 1166 case Key_Delete: … … 1172 1172 } else { 1173 1173 switch ( ke->key() ) { 1174 #if defined (Q_WS_WIN) 1174 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1175 1175 case Key_Insert: 1176 1176 ke->accept(); … … 1276 1276 break; 1277 1277 case Key_Delete: 1278 #if defined (Q_WS_WIN) 1278 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1279 1279 if ( e->state() & ShiftButton ) { 1280 1280 cut(); … … 1294 1294 if ( e->state() & ShiftButton ) 1295 1295 paste(); 1296 #if defined (Q_WS_WIN) 1296 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1297 1297 else if ( e->state() & ControlButton ) 1298 1298 copy(); … … 1302 1302 break; 1303 1303 case Key_Backspace: 1304 #if defined (Q_WS_WIN) 1304 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 1305 1305 if ( e->state() & AltButton ) { 1306 1306 if (e->state() & ControlButton ) { … … 1517 1517 doKeyboardAction( ActionKill ); 1518 1518 break; 1519 #if defined(Q_WS_WIN) 1519 #if defined(Q_WS_WIN) || defined (Q_WS_PM) 1520 1520 case Key_Insert: 1521 1521 copy(); … … 2408 2408 emitLinkClicked( u.toString( FALSE, FALSE ) ); 2409 2409 } 2410 #ifndef QT_NO_TEXTBROWSER 2410 2411 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 2411 2412 QConnectionList *clist = receivers( … … 2418 2419 } 2419 2420 } 2421 #endif 2420 2422 2421 2423 // emitting linkClicked() may result in that the cursor winds … … 4724 4726 } 4725 4727 if (!doc->focusIndicator.name.isEmpty()) { 4728 #ifndef QT_NO_TEXTBROWSER 4726 4729 if (::qt_cast<QTextBrowser*>(this)) { // change for 4.0 4727 4730 QConnectionList *clist = receivers( … … 4736 4739 } 4737 4740 } 4741 #endif 4738 4742 } 4739 4743 #ifndef QT_NO_CURSOR … … 4749 4753 copy(); 4750 4754 break; 4751 #if def Q_WS_WIN4755 #if defined (Q_WS_WIN) || defined (Q_WS_PM) 4752 4756 case Key_Insert: 4753 4757 copy(); … … 5010 5014 } 5011 5015 } else { 5012 #if defined(Q_OS_WIN32) 5016 #if defined(Q_OS_WIN32) || defined (Q_OS_OS2) 5013 5017 // Need to convert CRLF to LF 5014 5018 t.replace( "\r\n", "\n" ); … … 6692 6696 int endLine = startLine + nLines; 6693 6697 6694 if ( startLine >= d->od->numLines ) 6695 return; 6698 if ( startLine >= d->od->numLines ) { 6699 #if defined (Q_WS_PM) 6700 // see below for more info 6701 p->eraseRect( clipx, clipy, clipw, cliph ); 6702 #endif 6703 return; 6704 } 6705 6696 6706 if ( (startLine + nLines) > d->od->numLines ) 6697 6707 nLines = d->od->numLines - startLine; … … 6842 6852 td->draw( p, r.x(), r.y(), r.width(), r.height(), colorGroup() ); 6843 6853 p->translate( 0, -(clipy - offset) ); 6854 6855 #if defined (Q_WS_PM) 6856 // QTextEdit has WResizeNoErase and WRepaintNoErase flags (actually applied 6857 // to the viewport()), so we must erase areas not covered by the text doc. 6858 // [Win32 version feels ok without this, because it doesn't actually 6859 // fully obey WResizeNoErase and WRepaintNoErase: WM_ERASEBKGND always 6860 // erases the background before WM_PAINT and after every resize]. 6861 6862 int tw = td->width(); 6863 // calculate the height the text doc will occupy starting with clipy 6864 int th = td->height() - offset; 6865 if ( clipx + clipw > td->width() ) { 6866 // erase background to the left of every line 6867 p->eraseRect( tw, clipy, clipx + clipw - tw, th ); 6868 } 6869 if ( cliph > th ) { 6870 // erase background under the text doc 6871 p->eraseRect( clipx, clipy + th, clipw, cliph - th ); 6872 } 6873 #endif 6874 6844 6875 delete td; 6845 6876 }
Note:
See TracChangeset
for help on using the changeset viewer.