Gunnar Sletta escribió:
Jose Arcangel Salazar Delgado wrote:
Hi.
Look at this code that is generated by de JUIC when I set an Icon to a
QAction in the Designer using the Resource system:
actionNuevo = new QAction(Ui_MainWindow);
actionNuevo.setObjectName("actionNuevo");
actionNuevo.setIcon(new QIcon(new
QPixmap("classpath:file:/home/arcangel/workspace/carniceria/src#com/linuxsoluciones/carniceria/resources/add.png")));
QFont font = new QFont();
Hi Jose,
This is indeed the wrong behaviour. The classpath files should be
referenced relativly. How did you create this .jui file? When I try to
select resources in designer and save the jui file I only get relative
paths. Both for resources in the file system and resources located in
.jars.
Best regards,
Gunnar
Hi Gunnar.
Unfortunately I cannot reproduce the bug easily. This is my environment:
Eclipse ganymede+ qt jambi integration 4.4+ qt jambi 4.4
The .jui is generated through the designer inside the eclipse and the
resources are in the classpath. Today I discover a trick. If you click
in the three dots to set the Icon, the Choose Resource dialog is show,
but this wrong behavior is exposed. If you click in the arrow and
manually select the Choose Resource.. the correct behavior is used in
the Juic.
This happens when you have more that one resource, and the wrong
behavior is show in the non changed resources.
I append a .jui that is broken because this bug.
Thanks for the help
<ui version="4.0" language="jambi" >
<class>Ui_MainWindow</class>
<widget class="QMainWindow" name="Ui_MainWindow" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>779</width>
<height>579</height>
</rect>
</property>
<property name="windowTitle" >
<string>MainWindow</string>
</property>
<property name="styleSheet" >
<string notr="true" />
</property>
<property name="toolButtonStyle" >
<enum>com.trolltech.qt.core.Qt.ToolButtonStyle.ToolButtonTextUnderIcon</enum>
</property>
<widget class="QWidget" name="centralwidget" >
<property name="geometry" >
<rect>
<x>0</x>
<y>88</y>
<width>779</width>
<height>468</height>
</rect>
</property>
<property name="styleSheet" >
<string notr="true" >QWidget#centralwidget{
background-image:
url(classpath:com/linuxsoluciones/app_ref/resources/fondo_principal.png);
}
</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3" >
<property name="spacing" >
<number>0</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<widget class="QScrollArea" name="scrollArea" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Expanding" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>55</width>
<height>16777215</height>
</size>
</property>
<property name="styleSheet" >
<string notr="true" />
</property>
<property name="frameShadow" >
<enum>com.trolltech.qt.gui.QFrame.Shadow.Sunken</enum>
</property>
<property name="horizontalScrollBarPolicy" >
<enum>com.trolltech.qt.core.Qt.ScrollBarPolicy.ScrollBarAlwaysOff</enum>
</property>
<property name="widgetResizable" >
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>64</width>
<height>464</height>
</rect>
</property>
<property name="styleSheet" >
<string notr="true" >QWidget#scrollAreaWidgetContents{
background-image:
url(classpath:com/linuxsoluciones/app_ref/resources/fondo_opciones.png);
}
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" >
<property name="spacing" >
<number>0</number>
</property>
<property name="sizeConstraint" >
<enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetDefaultConstraint</enum>
</property>
<property name="leftMargin" >
<number>9</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>9</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="clientePushButton" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>40</width>
<height>40</height>
</size>
</property>
<property name="font" >
<font>
<family>MS Shell Dlg 2</family>
<pointsize>20</pointsize>
<weight>50</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="focusPolicy" >
<enum>com.trolltech.qt.core.Qt.FocusPolicy.StrongFocus</enum>
</property>
<property name="styleSheet" >
<string notr="true" >background-color: transparent;
font: 20pt "MS Shell Dlg 2";
color: rgb(255, 255, 255);
border-image: url(classpath:com/linuxsoluciones/app_ref/resources/opcion.png);
</string>
</property>
<property name="text" >
<string>1</string>
</property>
<property name="flat" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label" >
<property name="styleSheet" >
<string notr="true" >background-color: transparent;
color: rgb(255, 255, 255);
font: 10pt "Arial";</string>
</property>
<property name="text" >
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style
type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Arial'; font-size:10pt;
font-weight:400; font-style:normal;">
<p align="center" style=" margin-top:0px; margin-bottom:0px;
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;
font-size:12pt;"><span style="
font-size:9pt;">Clientes</span></p></body></html></string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>com.trolltech.qt.core.Qt.Orientation.Vertical</enum>
</property>
<property name="sizeType" >
<enum>com.trolltech.qt.gui.QSizePolicy.Policy.Expanding</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>25</width>
<height>398</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout" >
<property name="spacing" >
<number>0</number>
</property>
<item>
<widget class="QWidget" native="1" name="headWidget" >
<property name="minimumSize" >
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="autoFillBackground" >
<bool>false</bool>
</property>
<property name="styleSheet" >
<string notr="true" >QWidget#headWidget{
background-image:
url(classpath:com/linuxsoluciones/app_ref/resources/fondo_header.png);
}
QPushButton{
font: 10pt "Arial Black";
color: rgb(0, 71, 107);
background-color: transparent;
margin-bottom: 6px;
border: none;
}
QPushButton:disabled{
color: rgb(121, 121, 121);
}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<property name="spacing" >
<number>0</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer" >
<property name="orientation" >
<enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum>
</property>
<property name="sizeType" >
<enum>com.trolltech.qt.gui.QSizePolicy.Policy.MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="mainWidget" >
<property name="styleSheet" >
<string notr="true" >QLabel{
font: 75 9pt "Bitstream Vera Sans Mono";
color: rgb(0, 71, 107);
border-right-width: 2px;
border-style: solid;
border-color: rgb(0, 36, 105);
}
QLabel:disabled{
color: rgb(121, 121, 121);
}
QLineEdit {
margin-left: 5px;
border: 0px;
}
QPushButton{
font: 10pt "Arial Black";
color: rgb(0, 71, 107);
background-color: transparent;
margin-bottom: 6px;
border: none;
}
QPushButton:disabled{
color: rgb(121, 121, 121);
}</string>
</property>
</widget>
</item>
<item>
<widget class="QWidget" native="1" name="footerWidget" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize" >
<size>
<width>16777215</width>
<height>40</height>
</size>
</property>
<property name="styleSheet" >
<string notr="true" >background-color: transparent;</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" >
<property name="spacing" >
<number>0</number>
</property>
<property name="sizeConstraint" >
<enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetDefaultConstraint</enum>
</property>
<property name="margin" >
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer_2" >
<property name="orientation" >
<enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>536</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="atrasPushButton" >
<property name="focusPolicy" >
<enum>com.trolltech.qt.core.Qt.FocusPolicy.StrongFocus</enum>
</property>
<property name="styleSheet" >
<string notr="true" >QPushButton:flat {
border: none;
}</string>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="flat" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="adelantePushButton" >
<property name="focusPolicy" >
<enum>com.trolltech.qt.core.Qt.FocusPolicy.StrongFocus</enum>
</property>
<property name="styleSheet" >
<string notr="true" >QPushButton:flat {
border: none;
}</string>
</property>
<property name="text" >
<string/>
</property>
<property name="iconSize" >
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="flat" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3" >
<property name="orientation" >
<enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum>
</property>
<property name="sizeType" >
<enum>com.trolltech.qt.gui.QSizePolicy.Policy.Minimum</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>70</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>779</width>
<height>30</height>
</rect>
</property>
</widget>
<widget class="QStatusBar" name="statusbar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>556</y>
<width>779</width>
<height>23</height>
</rect>
</property>
<property name="styleSheet" >
<string notr="true" >QStatusBar{
background-image:
url(classpath:com/linuxsoluciones/app_ref/resources/fondo_principal.png);
}
</string>
</property>
</widget>
<widget class="QToolBar" name="toolBar" >
<property name="geometry" >
<rect>
<x>0</x>
<y>30</y>
<width>779</width>
<height>58</height>
</rect>
</property>
<property name="windowTitle" >
<string>toolBar</string>
</property>
<property name="styleSheet" >
<string notr="true" >QToolBar {
spacing: 0px;
background-color: qlineargradient(spread:pad, x1:0.525424, y1:1, x2:0.503,
y2:0, stop:0.502825 rgba(217, 227, 233, 255), stop:1 rgba(255, 255, 255, 255));
}
QToolButton {
color: rgb(0, 71, 107);
}</string>
</property>
<property name="movable" >
<bool>false</bool>
</property>
<property name="toolButtonStyle" >
<enum>com.trolltech.qt.core.Qt.ToolButtonStyle.ToolButtonTextUnderIcon</enum>
</property>
<attribute name="toolBarArea" >
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak" >
<bool>false</bool>
</attribute>
<addaction name="actionNuevo" />
<addaction name="actionActualizar" />
<addaction name="actionEliminar" />
</widget>
<action name="actionNuevo" >
<property name="icon" >
<iconset>
<normaloff>classpath:com/linuxsoluciones/app_ref/resources/nuevo.png</normaloff>classpath:com/linuxsoluciones/app_ref/resources/nuevo.png</iconset>
</property>
<property name="text" >
<string>Nuevo</string>
</property>
<property name="font" >
<font/>
</property>
<property name="iconVisibleInMenu" >
<bool>true</bool>
</property>
</action>
<action name="actionActualizar" >
<property name="icon" >
<iconset>
<normaloff>classpath:file:/home/arcangel/workspace/app_ref_qt/src#com/linuxsoluciones/app_ref/resources/actualizar.png</normaloff>classpath:file:/home/arcangel/workspace/app_ref_qt/src#com/linuxsoluciones/app_ref/resources/actualizar.png</iconset>
</property>
<property name="text" >
<string>Actualizar</string>
</property>
</action>
<action name="actionEliminar" >
<property name="icon" >
<iconset>
<normaloff>classpath:file:/home/arcangel/workspace/app_ref_qt/src#com/linuxsoluciones/app_ref/resources/eliminar.png</normaloff>classpath:file:/home/arcangel/workspace/app_ref_qt/src#com/linuxsoluciones/app_ref/resources/eliminar.png</iconset>
</property>
<property name="text" >
<string>Eliminar</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest