[Qt-interest] Porting Qt 3 to Qt 4
Jake Colman
colman at ppllc.com
Fri Sep 3 14:29:33 CEST 2010
>>>>> "AS" == Andre Somers <andre at familiesomers.nl> writes:
AS> Op 2-9-2010 19:21, Jake Colman schreef:
>> The reason I am using a QCustomMenuItem is because a checked menu
>> item in Motif (at least in our configuration) is supposed to be
>> displayed with a box that is red when checked and cleared when
>> not. Qt's implementation, at least in Qt3, displayed a check
>> instead of this box. So I extended QPopupMenu with a
>> insertMotifCheckItem() method to create this custom menu item that
>> knows how to paint itself accordingly.
>>
>> Having explained all this, is there a better/different way to do
>> this in Qt4? Please remember that I am trying to change as little
>> code as possible (at least for now) as part of this port.
AS> Perhaps the easiest way to do this is to use a widget style
AS> sheet. You can customize the appearance of a menu or menu item
AS> using a widget style sheet. Drawing a red square instead of a
AS> checkmark should be easy. You can style the check mark using the
AS> ::indicator subcontrol. Though... one wonders what drives a
AS> person in this day and age to use a Motif style ;-)
The application is an old, but very much in production, Motif-based
application. Over the years we modernized the application by recreating
certain key screens and creating all new screens with Qt. Since the
application is not exclusively Qt, it is important that the Qt screens
fit into the overall look and feel of the Motif application.
--
Jake Colman | Director, Software Development
Principia Partners LLC
101 West Elm Street | Conshohocken | PA 19428 | +1 (610) 755 9770
t: +1 (610) 755 9786 | c: +1 (610) 348 2788 | f: +1 (201) 221 8929
e: colman at ppllc.com | w: www.principiapartners.com
Credit technology innovation awards winner 2008 and 2009
More information about the Qt-interest-old
mailing list