I know how to set in a programm, but I want to set it in ui files. When I will generate code from ui, icons will have set.
I have decided this problem.
You need to add in ui files:
<item>
<widget class="QPushButton" name="pushButton_Main_Connect_1">
<property name="icon">
<iconset theme=":/icons/icons/idc_connect.ico"/>
</property>
</widget>
</item>
and in the end ui files:
</widget>
<resources>
<include location="icons.qrc"/>
</resources>
<connections/>
</ui>
and create qrc files(for example icons.qrc)
<RCC>
<qresource prefix="icons">
<file>icons/idc_connect.ico</file>
</qresource>
</RCC>
I am using python, because then need to use
pyrcc5 icons.qrc -o icons_rc.py
pyuic5 design.ui -o design.py
Related
Currently I've Custom Components in / prefix. I want to store all Custom Components in another prefix. Here's how I tried to create a prefix.
but nothing appears under qml.qrc
Open your qml.qrc file in a text editor and you should see something like this:
<RCC>
<qresource prefix="/">
<file>Components/PathButton.qml</file>
...
Change that to this:
<RCC>
<qresource prefix="/MyPrefix/">
<file>Components/PathButton.qml</file>
...
Now you will have to use import "MyPrefix/Components in your qml file.
I have deleted an action in the Qt Creator GUI, but it still appears in the "ui" file:
<action name="actionFoo">
<property name="text">
<string>Foo</string>
</property>
</action>
Do I have to remove it from the file too? Or is there a way to rebuild the file?
Removing an action from a menu doesn't delete that action. You need to delete it yourself.
In Qt Designer there is an Action Editor (in menu View) where you can delete any action from the context menu.
In Qt Creator it can be found in Window -> Views -> Action Editor (that's a guess! I'm using the german version.)
At last, you can always edit your .ui file manually (sometimes neccessary if Qt Creator isn't flexible enough). You can't do that from Qt Creator, but with any external text editor. Just make sure to delete the complete XML node and don't create invalid XML...
I am working on a JSF Primefaces project with the omega theme. The look of the selectOneMenu dropdowns are not correct (missing line).
It looks like this:
It should look like:
Andy ideas?
<p:selectOneMenu id="systemRoleMenu" value="#{configuration.systemRole}">
<f:selectItems value="#{configuration.systemRoles}"/>
</p:selectOneMenu>
Web.xml:
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>omega</param-value>
</context-param>
Pom.xml:
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>http://repository.primefaces.org</url>
<layout>default</layout>
</repository>
..some more...
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>6.0</version>
</dependency>
<!-- Primefaces Version 6 Extensions -->
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>6.0.0</version>
</dependency>
<!-- Primefaces All Themes -->
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>1.0.10</version>
</dependency>
...some more...
Additional information:
I already removed my own CSS to check if this is the problem. It's not.
Now due to more trying I found out that the root problem was, that I nested html documents by using<ui:include>. With this approach the stylesheets somehow confuse each other.
Solution: Adding <ui:composition> inside my included xhtml's. So everything outside the tag is ignored when included. Thus there were no more multiple html tags and stylsheet includes by primefaces. The problem was gone.
I have a series of CSS files that I am concatenating and minfying (using the YUI Compressor) with an Ant build script. The CSS files are:
Reset.css
Formalize.css
Typography.css
Site.css
There are other CSS files like ie.css and editor.css that I don't want to include in the minification. I have my build script working with the following code, but the problem now is that the files need to be concatenated in the order posted above.
<target name="minifycss">
<!-- Combine all CSS files except for ones specified for IE or the content editor -->
<concat destfile="css/e123-1.css">
<fileset dir="css" includes="*.css" excludes="ie.css editor.css print.css" />
</concat>
<!-- Minify the css -->
<java fork="true" jar="${yuicompressor.lib}" dir="css" output="css/e123-1.min.css">
<arg value="e123-1.css" />
</java>
</target>
I assume that the files are added alphabetically, but I was wondering if there was a way to tell Ant what order to concatenate the files without renaming them to 1reset.css, 2formalize.css, etc.
Use a filelist, as shown in the ant concat documentation.
If using wro4j, you can control the order of the resources to concatenate like this:
<groups>
<group name="all">
<css>/static/reset.css</css>
<css>/static/fonts.css</css>
<css>/wildcard/*.css</css>
<js>/static/js/lib/core.js</js>
</group>
</groups>
It allows you to use wildcards and also can be used for javascript resources (not only css)
This is a biased answer, because i'm working on wro4j project.
I have an about box that I'm trying to display an icon inside.
Here is my code:
QMessageBox about_box(this);
about_box.setText("...");
about_box.setIconPixmap(QPixmap("qrc:/images/logo.png"));
about_box.setParent(this);
about_box.exec();
Here is my resource file:
<RCC>
<qresource prefix="/images">
<file>logo.png</file>
</qresource>
</RCC>
You don't need the qrc prefix:
about_box.setIconPixmap(QPixmap(":/images/logo.png"));
You will need this function
EDIT: I didn't see that the OP had already used this.
Are you sure you're running qmake (and thus rcc) when compiling?