How can I specify a default css file for a QML WebView in Qt 5.5? I am looking for a solution similar to the one provided by BlackBerry for their Cascades framework https://developer.blackberry.com/native/reference/cascades/bb__cascades__websettings.html#property-userstylesheetlocation
It seems like this is currently not supported by the APIs provide by Qt 5
Related
I am new to QML, so I wanted to ask .. is it possible to import/convert/use CSS templates in QT ?
because I found many stylish CSS component. more than QML templates.
QML by default allows CSS styling with limited options. The limitations are mentioned here.
But if your intention is to add a .css file into the project and make that as a style sheet then there is no default way.
Here is the out of the box project with GitHub, which allows direct integration of CSS style sheets into QML. You can refer to the examples in that project
I need to build a custom Style for a Qt VirtualKeyboard on a small screen to maximize its readability. I have built a custom layout into my project, and using the QT_VIRTUALKEYBOARD_LAYOUT_PATH it works great.
The problem I am having is that the documentation states that the custom style must be placed in the Qt Directory. I need this style to be portable, however, so storing this newly built style on my local machine, rather than in the project itself, will not be acceptable.
Is there any way to build a use a keyboard style within a project?
It doesn't have to be in the Qt directory, just in a directory that is under QtQuick/VirtualKeyboard/Styles/ and in the QML import path.
As an example, take a look at the auto test:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/tests/auto/styles/data
You can also put the style in a .qrc file under that folder structure:
http://code.qt.io/cgit/qt/qtvirtualkeyboard.git/tree/src/virtualkeyboard/virtualkeyboardsettings.cpp#n70
I've created a task to make this clearer: https://bugreports.qt.io/browse/QTBUG-66172
For a large project I have the following setup:
a content editor made with Flex SDK 3.5
a content viewer made with Flex SDK 4.1
Both need to work with dynamically loaded fonts as the user can use the fonts he wants.
So we used this approach:
convert the font files with Flash Professional to SWF-files (Creating a Font SWF)
editor: load the fonts with Loader (Loading a SWF font)
the fonts can then be perfectly used within the application to generate htmlText
viewer: the same approach to load the fonts + register them with Font.registerFont (Flex 4 Embed font from swf)
Now the problems: although the loaded fonts are listed when you trace Font.enumerateFonts(false), they are not used in the textarea. There the text is shown with the default font.
Maybe the problem is the fonts are loaded as embedAsCFF for the Text Layout Framework, and that way are not usable in an mx.controls.TextArea? But as I can not change that to a spark TextArea for multiple reasons, I need a solution to use the loaded fonts in that mx.controls.TextArea.
Any ideas? Thanks a lot in advance!
Frank
Apparantly the problem was located in the project properties.
In "Flex Compiler" settings, the checkbox "Use Flash Text Engine in MX components" must be unchecked!
I'm not sure why you're using Flash Pro to create a font swf. You could just as easily done it using CSS by embedding the fonts and compiling it as a themed swf which could be loaded on runtime.
This should work for both Flex 3 and Flex 4 (with TLF).
This CSS code effectively retrofits mx textarea to accept CFF fonts:
mx|global{
textFieldClass: ClassReference("mx.core.UIFTETextField");
}
from the docs: "When MX components use FTE, they can use the same embedded fonts as Spark components, which always use FTE. Otherwise, a font must be embedded with embedAsCFF="false" for use by TextField-based components, and with embedAsCFF="true" for use by FTE-based components." http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UIFTETextField.html
Is there a stylesheet available for use in Qt applications (through Qt Creator) that makes your GUI use the stylesheet you see in Qt Creator itself, as well as in AutoCAD and some other applications?
What is the name of that stylesheet or where can I get it? It looks much like the Vista stylesheet though...
And whenever you set a custom stylesheet to your Qt application, will it display the same style on all platforms, or will it still display native GUI parts?
To the people that may want to find out more: The style seems to be called manhattanstyle and extends QWindowsStyle. It is not a css-stylesheet and therefore not just copy and paste to set up. It seems to have some other dependencies in the source code, so I don't know how much it will take to adapt it.
The source is found in the [qt-creator source code]/src/plugins/coreplugin/manhattanstyle.cpp
And btw: if you are running debian/ubuntu: type apt-get source qt-creator to get the source ;)
I can't say as to how you would get style sheets that match Qt Creator or AutoCAD but to answer your other question: When you apply a style sheet, it applies to the object you applied it to, and the child hierarchy of that object. Any widget not addressed by the style sheet in some way will maintain the native look and feel that matches the Style (not style sheet) chosen by Qt as most appropriate for you application based on the user's platform and desktop environment.
yes, somebody has separated it out.
see this Manhattan style
I am developing for the first time using qt 4.5. I am developing a desktop app that will run on windows xp/vista.
The client would like to have a skin that assemblies a softphone, or something similar.
Does qt come with any skinning engine? Is it possible to create skins using qt?
Many thanks,
Yes, you can write style sheets to customize the look of your application. The syntax is like CSS and gives you many possibilities. If you just want all your buttons to be red, for example:
QPushButton {
color: red;
}
Yes. It's called styling.