Hi, Just a short notice now that I resolved my initial problem.
I have: - a port of 2 SWT-Layouts (Grid-Layout and Fill-Layout) for QT [1] - a port of JFace-Viewers for Structured QT-Controls (Combo,List,Table,Tree) [2] - Eclipse-Databinding-Observables for QT-Widgets [3] The project provide all those features and much more is named UFacekit[4] and is proposed as an Project to the Eclipse Foundation. It would be great if we get feedback from the QT-Community about our work and if you think it is worth it. Please comment on the "UFacekit"-newsgroup [5]. Thanks for your attention and feeback Tom [1]http://uface.googlecode.com/svn/trunk/incubation/org.ufacekit.incubation/org.ufacekit.ui.qt/org.ufacekit.ui.qt.core/src/main/java/org/ufacekit/ui/qt/core/layouts/ [2]http://uface.googlecode.com/svn/trunk/incubation/org.ufacekit.incubation/org.ufacekit.ui.qt/org.ufacekit.ui.qt.jface/ [3]http://uface.googlecode.com/svn/trunk/incubation/org.ufacekit.incubation/org.ufacekit.ui.qt/org.ufacekit.ui.qt.databinding/ [4]http://www.eclipse.org/proposals/ufacekit/ [5]http://www.eclipse.org/newsportal/thread.php?group=eclipse.ufacekit Tom Schindl schrieb: > Hi, > > How stupied one can be :-) I didn't pass the parent when creating the > child widgets. > > Tom > > Tom Schindl schrieb: >> Hi, >> >> On the weekend I tried to write some custom layouts to match layouts I >> already know from SWT but I'm somehow failing miserably. >> >> Problem 1: The time of setting the layout to a QWidget >> ====================================================== >> >> ----------8<---------- >> QWidget center = new QWidget(); >> setCentralWidget(center); >> >> QTFillLayout layout = new QTFillLayout(); >> center.setLayout(layout); >> >> QWidget widget = new QWidget(); >> layout.addWidget(widget,""); >> >> QTFillLayout layout2 = new QTFillLayout(); >> widget.setLayout(layout2); >> >> QLabel label = new QLabel(); >> label.setText("BlaBla"); >> layout2.addWidget(label, ""); >> >> QPushButton button = new QPushButton(); >> button.setText("B1"); >> layout2.addWidget(button,""); >> ----------8<---------- >> >> Renderes an empty window but when I rearrange the setting of the layout >> like this: >> >> ----------8<---------- >> QWidget center = new QWidget(); >> setCentralWidget(center); >> >> QTFillLayout layout = new QTFillLayout(); >> >> QWidget widget = new QWidget(); >> layout.addWidget(widget,""); >> >> QTFillLayout layout2 = new QTFillLayout(); >> widget.setLayout(layout2); >> >> QLabel label = new QLabel(); >> label.setText("BlaBla"); >> layout2.addWidget(label, ""); >> >> QPushButton button = new QPushButton(); >> button.setText("B1"); >> layout2.addWidget(button,""); >> >> layout.addWidget(widget,""); >> center.setLayout(layout); >> ----------8<---------- >> >> The layout works. >> >> Problem 2: Using layout#addWidget(QWidget) >> ========================================== >> >> Fragment 1 from above gives: >> >> "Invalid memory access of location 00000000 eip=08d15e36" >> >> Fragment 2 from above gives: >> >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.sizeHint(QLayoutItem.java:70) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.sizeHint(QTFillLayout.java:78) >>> at com.trolltech.qt.gui.QWidget.__qt_show(Native Method) >>> at com.trolltech.qt.gui.QWidget.show(QWidget.java:2134) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:39) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.setGeometry(QLayoutItem.java:62) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.setGeometry(QTFillLayout.java:68) >>> at com.trolltech.qt.gui.QWidget.__qt_show(Native Method) >>> at com.trolltech.qt.gui.QWidget.show(QWidget.java:2134) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:39) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.setGeometry(QLayoutItem.java:62) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.setGeometry(QTFillLayout.java:68) >>> at com.trolltech.qt.gui.QWidget.__qt_show(Native Method) >>> at com.trolltech.qt.gui.QWidget.show(QWidget.java:2134) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:39) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.setGeometry(QLayoutItem.java:62) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.setGeometry(QTFillLayout.java:68) >>> at com.trolltech.qt.gui.QWidget.__qt_show(Native Method) >>> at com.trolltech.qt.gui.QWidget.show(QWidget.java:2134) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:39) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.setGeometry(QLayoutItem.java:62) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.setGeometry(QTFillLayout.java:68) >>> at com.trolltech.qt.gui.QWidget.__qt_show(Native Method) >>> at com.trolltech.qt.gui.QWidget.show(QWidget.java:2134) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:39) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.sizeHint(QLayoutItem.java:70) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.sizeHint(QTFillLayout.java:78) >>> at com.trolltech.qt.gui.QApplication.exec(Native Method) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:40) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.setGeometry(QLayoutItem.java:62) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.setGeometry(QTFillLayout.java:68) >>> at com.trolltech.qt.gui.QApplication.exec(Native Method) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:40) >>> QtJambi: Exception pending in native code >>> Exception in thread "main" com.trolltech.qt.QNoNativeResourcesException: >>> Function call on incomplete object of type: >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper >>> at >>> com.trolltech.qt.gui.QLayoutItem$ConcreteWrapper.sizeHint(QLayoutItem.java:70) >>> at >>> org.ufacekit.ui.qt.core.layouts.QTFillLayout.sizeHint(QTFillLayout.java:78) >>> at com.trolltech.qt.gui.QApplication.exec(Native Method) >>> at >>> org.ufacekit.ui.qt.example.TestFillLayout.main(TestFillLayout.java:40) >> The example i used is >> http://doc.trolltech.com/4.4/layouts-borderlayout.html, I don't know C++ >> but I think I translated this appropriately into Java. >> >> Tom >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Qt-jambi-interest mailing list >> [email protected] >> http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest > > _______________________________________________ > Qt-jambi-interest mailing list > [email protected] > http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
