Qt-jambi-interest Archive, June 2007
java/juic- compiler and final release ?
Message 1 in thread
Hello
another problem with the juic - compiler
after installing the final release every(!) of my Ui_dialogxxx.java
files shows an error.
for instance:
AkteAblegenDialog.setOrientation(
com.trolltech.qt.core.Qt.Orientation.Horizontal);
error:
"the method setOriantation(Qt.Orientation) is undefined for
the type QDialog"
or
com.trolltech.qt.QtJambiUtils.connectSlotsByName(AktenAnzahlDialog);
error:
"com.trolltech.qt.QtJambiUtils cannot be resolved to a type"
both *.java files were freshly build by the (new) juic-compiler. Is
there a change of the qtjambi - api ?
and next, the eclipse designer is unable to open the existing *.jui
files. The following message was
/*************************************************************************
org.eclipse.swt.SWTException: Failed to create Ole Client. result =
-2147221164
at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302)
at org.eclipse.swt.ole.win32.OleControlSite.<init>(OleControlSite.java:101)
at com.trolltech.qtdesigner.views.FormWindowW.<init>(FormWindowW.java:25)
at
com.trolltech.qtdesigner.qtjambi.JambiUiEditor.createPartControl(JambiUiEditor.java:21)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:596)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:372)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:214)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2595)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2528)
at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2520)
at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2505)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2500)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2485)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:388)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:350)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:275)
at
org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:139)
at
org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:190)
at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:174)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:306)
at
org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:653)
at
org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:817)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:843)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
at
org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:815)
at
org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1069)
at
org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1168)
at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:249)
at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:243)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:283)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1930)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1894)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:422)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
/*******************************************************************************
is there any hint I have to follow by upgrading from final beta II to
final realease
best regards
Arne
PS.: I'm using the commercial version
qtjambi-win32-commercial-4.3.0_01
PPS.: there was no eclipse-integration in that package, so I used the
qtjambi-eclipse-integration-win32-4.3.0_01.zip
from the free download
PPS.: I got a License key, but I found no way to enter it anywhere
Message 2 in thread
Arne Stocker wrote:
> Hello
>
> another problem with the juic - compiler
>
> after installing the final release every(!) of my Ui_dialogxxx.java
> files shows an error.
>
> for instance:
>
> AkteAblegenDialog.setOrientation(
> com.trolltech.qt.core.Qt.Orientation.Horizontal);
>
> error:
> "the method setOriantation(Qt.Orientation) is undefined for
> the type QDialog"
Hi Arne,
We removed functions that were documented as obsoleted from the API for
the final release. setOrientation() was one such function. You can look
in the Qt 4.3 C++ docuemntation under obsolete members for how to
replace properties:
http://doc.trolltech.com/4.3/qdialog-obsolete.html#setOrientation
We don't take care of these things in the .jui files, but Designer has
been updated to also not show these obsolete functions.
> com.trolltech.qt.QtJambiUtils.connectSlotsByName(AktenAnzahlDialog);
>
> error:
> "com.trolltech.qt.QtJambiUtils cannot be resolved to a type"
This function was moved for the final release, and juic was updated
accordingly. I suspect you didn't properly rebuild your .jui files. Juic
only updates files where the .jui file has changed since the UI_*.java
file was created. You can override this timestamp check by supplying the
-a command line option.
> /*************************************************************************
>
> org.eclipse.swt.SWTException: Failed to create Ole Client. result =
> -2147221164
> at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302)
> at
> org.eclipse.swt.ole.win32.OleControlSite.<init>(OleControlSite.java:101)
> at
> com.trolltech.qtdesigner.views.FormWindowW.<init>(FormWindowW.java:25)
Did you register the plugin using the supplied .bat file?
-
Gunnar
Message 3 in thread
Hello Gunnar
thank you for response. I forgot to call the 'eclipse_integration.bat'.
After that, the plugin designer works properly
> uic only updates files where the .jui file has changed since the UI_*.java file was created.
I deleted the Ui_xxx.java File and the juic builds an invalid file (as
described).
After the run of 'eclipse_integration.bat' the juic-compiler builds a
valid Ui_xxx.java File.
thank you for help
best regards
Arne
Message 4 in thread
Arne Stocker wrote:
> I deleted the Ui_xxx.java File and the juic builds an invalid file (as
> described).
>
> After the run of 'eclipse_integration.bat' the juic-compiler builds a
> valid Ui_xxx.java File.
You need to also update the jambipath in the settings page in eclipse to
the new location of Qt Jambi. Otherwise, you'll still be generating code
using the old version of Juic.
-
Gunnar
Message 5 in thread
Hello Gunnar
I deletet the content of the old folder and copied the content of the
new folder into it. The PropertyPage of QtJambi tells me that it located
the (new) juic-compiler well
best regards
Arne
Message 6 in thread
the juic seems to obsess me ... :-)
juic was the on build on 05.06.07 as I checked that manually in the
qtjambi directory
there is an error if I set the property of a (Horizontal) spacer to any
value. The error ouccurs in the Ui_xxx.java File at the following line
spacerItem = new QSpacerItem(40,20,QSizePolicy::Fixed,
com.trolltech.qt.gui.QSizePolicy.Policy.Minimum)
that seems me to be c++ code. After deleting any value (that means click
on the right button with the roundet arrow), the Ui_xxx.java File was
valid.
It could have nothing to do with old *.ui or *.jui Files because if I
create a new Dialog, and change the property of a spacer in the
descripted way, the behavior continue.
could you reproduce this error ?
thank you
Arne
-------------------- Form.jui --------------------------
<ui version="4.0" language="jambi" >
<class>Form</class>
<widget class="QWidget" name="Form" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QHBoxLayout" >
<item>
<widget class="QPushButton" name="pushButton" >
<property name="text" >
<string>PushButton</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
--------------------Ui_Form.java --------------------------
/********************************************************************************
** Form generated from reading ui file 'Test.jui'
**
** Created: Do 14. Jun 16:38:50 2007
** by: Qt User Interface Compiler version 4.3.0
**
** WARNING! All changes made in this file will be lost when recompiling
ui file!
********************************************************************************/
package fenster;
import com.trolltech.qt.core.*;
import com.trolltech.qt.gui.*;
public class Ui_Form
{
public QHBoxLayout hboxLayout;
public QPushButton pushButton;
public QSpacerItem spacerItem;
public Ui_Form() { super(); }
public void setupUi(QWidget Form)
{
Form.setObjectName("Form");
Form.resize(new QSize(400,
300).expandedTo(Form.minimumSizeHint()));
hboxLayout = new QHBoxLayout(Form);
hboxLayout.setObjectName("hboxLayout");
pushButton = new QPushButton(Form);
pushButton.setObjectName("pushButton");
hboxLayout.addWidget(pushButton);
spacerItem = new QSpacerItem(40, 20, QSizePolicy::Fixed,
com.trolltech.qt.gui.QSizePolicy.Policy.Minimum);
hboxLayout.addItem(spacerItem);
retranslateUi(Form);
Form.connectSlotsByName();
} // setupUi
void retranslateUi(QWidget Form)
{
Form.setWindowTitle("Form");
pushButton.setText("PushButton");
} // retranslateUi
}
Message 7 in thread
Arne Stocker wrote:
> the juic seems to obsess me ... :-)
>
> juic was the on build on 05.06.07 as I checked that manually in the
> qtjambi directory
>
> there is an error if I set the property of a (Horizontal) spacer to any
> value. The error ouccurs in the Ui_xxx.java File at the following line
>
> spacerItem = new QSpacerItem(40,20,QSizePolicy::Fixed,
> com.trolltech.qt.gui.QSizePolicy.Policy.Minimum)
>
>
> that seems me to be c++ code. After deleting any value (that means click
> on the right button with the roundet arrow), the Ui_xxx.java File was
> valid.
>
> It could have nothing to do with old *.ui or *.jui Files because if I
> create a new Dialog, and change the property of a spacer in the
> descripted way, the behavior continue.
>
> could you reproduce this error ?
Hi Arne,
There is a bug here with the spacer items in juic. The applied patch
should fix the problem. You can apply it to the source package and
rebuild juic only and you should be in good shape.
-
Gunnar
==== //depot/qtjambi/4.3/juic/javawriteinitialization.cpp#2 (text) ====
==== //depot/qtjambi/4.3/juic/javawriteinitialization.cpp#2 (text) ====
@@ -424,6 +424,17 @@
bool isVspacer = orientation.endsWith(QLatin1String("Vertical"));
+ if (sizeType.contains(QLatin1String("::"))) {
+ QStringList lst = sizeType.split(QLatin1String("::"));
+ if (lst.size() == 2 && lst.at(0) == QLatin1String("QSizePolicy")) {
+ sizeType = QLatin1String("com.trolltech.qt.gui.QSizePolicy.Policy.") + lst.at(1);
+ } else {
+ fprintf(stderr, "Malformed enum value %s, C++ syntax not allowed\n",
+ qPrintable(sizeType));
+ return;
+ }
+ }
+
output << option.indent << varName << " = new QSpacerItem(";
if (sizeHint)
@@ -431,11 +442,6 @@
QString minimum = QLatin1String("com.trolltech.qt.gui.QSizePolicy.Policy.Minimum");
- if (minimum.contains(QLatin1String("::")))
- fprintf(stderr, "Malformed enum value %s, C++ syntax not allowed\n", qPrintable(minimum));
- if (sizeType.contains(QLatin1String("::")))
- fprintf(stderr, "Malformed enum value %s, C++ syntax not allowed\n", qPrintable(sizeType));
-
if (isVspacer)
output << minimum << ", " << sizeType << ");\n";
else