View Issue Details

IDProjectCategoryView StatusLast Update
0037270LazarusWidgetsetpublic2020-08-12 00:57
ReporterCudaText man Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.1 (SVN) 
Summary0037270: Qt5/Qt4: LCLIntf.MessageBox shows wrong icon
Descriptionhttps://github.com/Alexey-T/Lazarus_test_messageboxes
run this app on gtk2. see that all icons work OK for all kinds of msgboxes.
run on Qt5 (Qt4 - not tested). Linux x64.
LCLIntf.MsgBox shows wrong icon for all MB_ICON* choices

TagsNo tags attached.
Fixed in Revisionr63724
LazTarget-
WidgetsetQT5
Attached Files

Activities

Zeljan Rikalo

2020-07-01 13:10

developer   ~0123699

Is it Linux OS ?

CudaText man

2020-07-12 00:55

reporter   ~0123898

>run on Qt5 (Qt4 - not tested). Linux x64.

so yes, Linux OS.

CudaText man_

2020-08-04 13:05

reporter   ~0124540

Fix for qt4/5
qmsg.diff (1,765 bytes)   
Index: lcl/interfaces/qt/qtwinapi.inc
===================================================================
--- lcl/interfaces/qt/qtwinapi.inc	(revision 63686)
+++ lcl/interfaces/qt/qtwinapi.inc	(working copy)
@@ -5150,12 +5150,12 @@
 
   function IconToMessageType(AType: cardinal): QMessageBoxIcon;
   begin
-    Result := QMessageBoxNoIcon;
     case AType of
-      1: Result := QMessageBoxInformation;
-      2: Result := QMessageBoxQuestion;
-      3: Result := QMessageBoxCritical;
-      4: Result := QMessageBoxWarning;
+      1: Result := QMessageBoxCritical; // MB_ICONERROR = $00000010;
+      2: Result := QMessageBoxQuestion; // MB_ICONQUESTION = $00000020;
+      3: Result := QMessageBoxWarning; // MB_ICONWARNING = $00000030;
+      4: Result := QMessageBoxInformation; // MB_ICONINFORMATION = $00000040;
+      else Result := QMessageBoxNoIcon;
     end;
   end;
 
Index: lcl/interfaces/qt5/qtwinapi.inc
===================================================================
--- lcl/interfaces/qt5/qtwinapi.inc	(revision 63686)
+++ lcl/interfaces/qt5/qtwinapi.inc	(working copy)
@@ -5093,12 +5093,12 @@
 
   function IconToMessageType(AType: cardinal): QMessageBoxIcon;
   begin
-    Result := QMessageBoxNoIcon;
     case AType of
-      1: Result := QMessageBoxInformation;
-      2: Result := QMessageBoxQuestion;
-      3: Result := QMessageBoxCritical;
-      4: Result := QMessageBoxWarning;
+      1: Result := QMessageBoxCritical; // MB_ICONERROR = $00000010;
+      2: Result := QMessageBoxQuestion; // MB_ICONQUESTION = $00000020;
+      3: Result := QMessageBoxWarning; // MB_ICONWARNING = $00000030;
+      4: Result := QMessageBoxInformation; // MB_ICONINFORMATION = $00000040;
+      else Result := QMessageBoxNoIcon;
     end;
   end;
 
qmsg.diff (1,765 bytes)   

Juha Manninen

2020-08-12 00:57

developer   ~0124782

Applied, thanks.

Issue History

Date Modified Username Field Change
2020-06-26 19:03 CudaText man New Issue
2020-07-01 13:08 Zeljan Rikalo Assigned To => Zeljan Rikalo
2020-07-01 13:08 Zeljan Rikalo Status new => assigned
2020-07-01 13:10 Zeljan Rikalo Status assigned => feedback
2020-07-01 13:10 Zeljan Rikalo LazTarget => -
2020-07-01 13:10 Zeljan Rikalo Note Added: 0123699
2020-07-12 00:55 CudaText man Note Added: 0123898
2020-07-12 00:55 CudaText man Status feedback => assigned
2020-08-04 13:05 CudaText man_ Note Added: 0124540
2020-08-04 13:05 CudaText man_ File Added: qmsg.diff
2020-08-11 21:43 Juha Manninen Assigned To Zeljan Rikalo => Juha Manninen
2020-08-12 00:57 Juha Manninen Status assigned => resolved
2020-08-12 00:57 Juha Manninen Resolution open => fixed
2020-08-12 00:57 Juha Manninen Fixed in Revision => r63724
2020-08-12 00:57 Juha Manninen Widgetset QT5 => QT5
2020-08-12 00:57 Juha Manninen Note Added: 0124782