[Kde-java] Where is QMap

David Goodenough david.goodenough at btconnect.com
Sat Oct 2 21:46:13 CEST 2004


On Saturday 02 October 2004 18:52, Richard Dale wrote:
> On Saturday 02 October 2004 18:13, David Goodenough wrote:
> > On Saturday 02 October 2004 16:28, Richard Dale wrote:
> > > On Saturday 02 October 2004 16:14, David Goodenough wrote:
> > > > I realise that without the new features of Java-5 QMap may be of
> > > > little use, or rather will require lots of explicit casting, but
> > > > where it is?
> > > >
> > > > I am trying to go through all the Qt Designer manual examples, and to
> > > > convert them into Java, and I got to the main window example and
> > > > found that this class does not exist.  I could use a Java Map object,
> > > > but I am not quite sure where this is sufficiently the same.
> > >
> > > Currently that type isn't supported - it should be a java HashMap. The
> > > QtRuby bindings marshall it to a Ruby Hash. I'll add it if I've got
> > > time - the KDE 3.3.1 release doesn't get tagged until 8:00, so I've got
> > > an hour or two, but I still haven't built the KDE classes yet, just
> > > QtJava.
> > >
> > > BTW, I've fixed the QWidget::polish() loop bug.
> >
> > Wonderful.
> >
> > I don't mean to pile further detail on you, but have you given throught
> > to providing QString as well.  I ask because it seems to have rather more
> > capabilities than String, in particular some message arguement
> > substitution functions which seem to go beyond those in MessageFormat.  I
> > realise this could not reasonably be done for this drop, maybe the next
> > one?
>
> I'm not very keen on adding QString to the java api because it makes it
> very un-javalike. But that's the sort of thing we can discuss on this list.
> A more problematic example is the java Calendar class which is just awful
> compared with QDate. So should we provide alternative methods with QDate
> args in the api wherever we have a Calendar arg now? PerlQt and QtRuby have
> QDate in their apis, whereas QtJava doesn't.
>
> The java-gnome bindings have EventListeners, so they could be added to
> QtJava too. However, I personally regard them as a complete 'design
> disaster' and would be very reluctant to add them.
>
> -- Richard
> _______________________________________________
> Kde-java mailing list
> Kde-java at kde.org
> https://mail.kde.org/mailman/listinfo/kde-java
Perhaps what is needed (and I will try to do it over the next few days) is
to get my head around the differences, try to document them, and see
if there is another way to provide the functionality.  Obviously (at least 
to me) keeping it java-like is important, but where functionality is 
genuinely missing extension is useful.  Keeping it Qt/KDE like is also
important given that the majority of the documentation and books
for Qt/KDE are written in C++ not Java, so keeping the surprises to
a minimum is also good.

I have not even looked at QDate yet.

I am by the way, making good progress through the next example in the
Qt manual (having almost got the conversion form working properly) so
soon I will have working examples of the colour tool (sorry, I tend to spell
things in English not American) in Java.

I do intend to write up a HOWTO which will be aimed at use of Eclipse
and Qt Designer, but of more general interest as well as it will be a 
companion guide so that people can take the Qt manual examples and
produce the Java equivalent.  Initially this will be on one of my web sites
but if this is felt to be more useful it can be moved wherever anyone 
wants to put it.

David


More information about the Kde-java mailing list