After a bit of research I wasn't really able to understand why this happens.
In a nutshell, I'm calling QWebView and feeding a .swf into it and it works. However it goes out of its frame/layout, and I'm not sure why.
For a representation, see:
As you may see, the dark greyish rectangle is where QWebView was placed, however the .swf going into it is represented out of it in the top left corner.
How to recreate this problem:
I literally just placed a QWebView using the designer, added all the includes needed etc. and added 3 lines of code to mainwindow.cpp :
QWebSettings *settings = ui->webView->settings();
settings->setAttribute(QWebSettings::PluginsEnabled, true);
ui->webView->load(QUrl("http://www.w3schools.com/html/bookmark.swf"));
I also tried opening an html file with the .swf wrapped in it, but the same problem occurs.
Am I doing something wrong? Is it a known bug? Thanks in advance.
Apparently this is a known bug with Qt, will be fixed next release.
Source: https://bugreports.qt-project.org/browse/QTBUG-33053
What I did to fix was basically compile QT again with the fix included.
Related
I started using the Atom Code editor recently. During my last project, I installed a couple of tools to make my coding more interactive.
One of the features added color to my code which makes it easier to read.
However, I started a new project today and the code is all white on a dark background. How do I color my code?
I have attached two screenshots of the colored code and the non colored code just to illustrate what I mean but its pretty straightforward.
Atom might not be recognizing the syntax of your code immediately. Check the bottom right corner of the screen to make sure atom has the correct language/file extension selected. You can manually select this if atom doesn't do it automatically. You might also need to install some new packages if atom isn't recognizing your code.
Use ctrl+shift+l to open the language selector, and select the auto-detect option.
I had the same problem. Try switching to HTML(Go) in the bottom right corner. It's between UTF-8 and Github.
Why isn't anybody mentioning the file extension?
Your "Project Greg.html" is HTML.
But "Random Quote Machine" has NO extension.
This is why the syntax isn't showing.
The current version of Atom I'm running as of Oct 2018 seems to identify code by tags. So even if I select HTML manually, unless the file has <html> tag, it still doesn't mark it as HTML. I just add redundant commented out <!-- <html> --> tag in the beginning of the file and it does the trick.
You may need to install a new package for Atom. You can find different language packages for Atom here: https://atom.io/packages
For example, for React.js, install the react package.
In your terminal, type this command: apm install react
More info for react packages:
https://atom.io/packages/react
https://orktes.github.io/atom-react/
Check the bottom right corner of the screen to make sure atom has the correct language/file extension selected
If your file has extension HTML or ejs (.html, .ejs) language-ejs package can 't recognize those file.In the bottom right corner of the screen, change the HTML to ejs or javascript, then the atom can recognize that the code your write is parts of ejs. NOte, you need to install language -ejs package first.
Follow the steps:-
File->Settings
Select 'Core' from left pane.
Change color profile to "Use sRGB color profile".
Restart 'Atom'.
Make sure the beginning identifies the file as a html document. I had this problem and just added <!DOCTYPE html> as the very first line and it worked.
Maybe this will helps for someone, but if you tab once this line: <!DOCTYPE html> and it will show coloured HTML code
If the langage set is already the right one,and the code stays grey unless you directly edit it, just try setting another langage then switch back. It worked for me after Atom refused to color an entire copy-pasted HTML page.
I am a very newbie but wanna share what worked for me. Please don't judge me strictly.
Since I work only in Python, it is very convenient to change the grammar to Python every time. How to make it automatic:
File->Settings (or use Ctrl+Comma)
Click Open config folder
Click on styles.less
After all the code, write exactly this source.python {
}
Save
Restart Atom.
You're all set.
Hope this was helpful, couldn't find this solution elsewhere.
The !DOCTYPE html did not change the color for me but in the bottom right is :
CRLF UTF-8 HTML GitHub Git(0) menu options. I selected HTML and in the popup window selected AUTO. The color returned instantly.
I am trying to chance the icon of the exe file created native bundling of javafx packaging but it still contains the default icon. Please suggest
primaryStage.getIcons().add(FileUtility.loadImage("icon.png"));
did not help, it only changes the title bar and task bar icon.
The ico file still gets generated and icon of the exe files remains the default one
I also tried to assign an icon in the project properties-> Deployment-> icon but did not help
I believe I have encountered the same issue and the solution is described in the following thread.
As a side note - neither specifying your icon in the build.xml file or via the project's options in the deployment section is going to work thus far, but it seems to be fixed in the upcoming release of 7u10.
I added response here How to set custom icon for javafx native package icon on Windows and thinks it is the same issue you started out with. However you seem to have moved on, but others might find it interesting...
I added src/main/deploy/package/windows/myapp.ico there and it finally worked :)
For you:
Create src/main/deploy/package/windows/ folder
Add icon with name ${project.build.finalName}.ico
Run mvn jfx:build-native
I haven't played with it extensively - just got it to work and wanted to share. So if you want to use icon with different name, I don't know how. Not yet at least. The ... section in the config section seems to be for webstart, so I haven't been using it. Hope you get it to work!
Answered at How to set custom icon for javafx native package icon on Windows
Only one error to go until I get to use this for my research!
Warning: Z-order assignment: " is not a valid widget.
FILE: qvvideoreaderblockwidget.ui
There's no line number that came with it. I tried finding but, failed to see an open-ended part.
What should I do to correctly compile this library?
Edit the ui file outside of Qt Creator. Delete the rows with 'zorder' tags. Then open in Qt Creator and compile again. It worked for me then perfectly, the warning did not appear any more.
OK, I had this, and it irked me too. I don't know what happened to cause this, but it is not serious. I suppose that breaking and remaking all the layouts might fix it. Other frameworks tend toward a lot of warnings, but tho I'm new to Qt, not a one yet. I went in another editor, and removed a line that said (as best I can remember):
<z-order>verticalSpacer</z-order>
which was among a lot of other lines which also were z-order tags. I deleted the line with this tag, and rebuilt all. Problem gone. Interestingly enough, all of the z-order tags had vanished from my file when I looked at it next. It must be a bug, but evidently one of little consequence; except those who hate to see the serene beauty of Qt spoiled.
Does the ui-file qvvideoreaderblockwidget.ui contain "Promoted widgets"? If so, use the "Promoted widgets" dialog of the (Qt4-) designer for ensuring that the header of the promoted widget-class is declared as "global include".
In case the custom widget class is named "MyWidget" and the header is named "mywidget.h" and the member widget shall be named "myWidget", the uic will generate the code of the ui-class as follows:
#include <mywidget.h>
class qvvideoreaderblockwidget
{
public:
MyWidget* myWidget;
// ...
};
It happened to me when I deleted a fairly large chunk of stuff in the designer. Investigation showed that the designer had failed to remove a zorder tag relating to the widget I deleted (which, incidentally contained a bunch of other widgets).
Deleting the line as suggested cleared the problem. If you do have a load of zorder tags you probably need to be careful to just delete the one that relates to the deleted item.
I had the same problem, and deleting the .exe file from the output folder (debug or release) before run/compile the source, solved the problem.
This problem arises due to a (presently) unfixed bug in Qt Creator's undo / delete mechanism.
The solution until the bug is fixed is to:
Close the .ui file in Qt Designer
Open the .ui file in an external editor
Delete the <zorder> line(s) that apply to the element with the problem. For example:
<zorder>groupBox_2</zorder>
Save the file
Re-open the file in Qt Designer
Re-compile in Qt
I would like to use SVGs in menus and buttons around a Qt-4.7 application. The images are rendered correctly across linux and windows platforms, however an obnoxious message reading...
couldn't create image from ""
...is printed to the console seemingly as soon as one of these images is loaded or changes state (like highlighting or disabling its container widget). Over the course of the run of the application, many of these lines are printed, leaving a lot of senseless output crufted around reasonable application output.
Poking around the Qt code a bit, this appears to be coming from svg/qsvghandler.cpp:2680 where the line contains the following.
qDebug()<<"couldn't create image from "<<filename;
From the documentation for qDebug, you would think that I could block this by defining QT_NO_DEBUG_OUTPUT at compiletime, but this will only block the application's compiled debug calls, not the one in Qt's SVG library.
So I guess my question is actually two-fold:
As in the title, why is Qt printing this even when rendering SVGs correctly?
Without recompiling Qt or its SVG library, how do I prevent Qt from printing this and crufting the application's output?
I've also posted this question on the QtCentre forums.
To #2: You can prevent qDebug output by using qIntallMsgHandler and writing a handler that just discard the message. Also see this question: How to redirect qDebug, qWarning, qCritical etc output?
Re #1: I'm no expert on SVG but from the Qt source code where that line appears, it looks like Qt is trying to load an image file referenced in an xlink:href attribute. The output you see would seem to indicate that either the value for that attribute is "" or the value is a bunch of white space characters enclosed in "" which is removed by a call to QString.trimmed() which is then used as the name of an image file to be loaded into a QImage. I can't quite discern if the filename is ending up as an empty string or two quotes :)
I would have to guess that either the SVG files you have are filled with empty string xlink:href attributes (probably links or filenames for texture images) or there is something about the SVG file causing Qt to incorrectly parse it. I would lean towards the former.
What is your criteria for concluding that they are being rendered correctly? Perhaps you could open the SVG files in a text editor and look at the xlink:href occurances in it?
I've had a similar issue, I used Adobe Illustrator to create images and then save as SVG. The problem is that hidden layers in Illustrator still gets written to the SVG file, but its display property is set to "none". In my case a hidden layer of a file I "placed" - to get an idea if the background I'm creating would look OK.
This causes your image to render correctly as you say, but Qt complains about the missing invisible layer in the SVG file. If you open the SVG file in a text viewer you might find the hidden layer looks something like this:
<g id="bglogo_x5F_splash" style="display:none;">
<image style="display:inline;overflow:visible;" width="1740" height="438" xlink:href="../logo_preview.png" transform="matrix(1 0 0 1 154 409)">
</image>
</g>
Qt will complain about the missing "../logo_preview.png" file.
Hope this helps
I have integrated seam and flex with FlamingoDS
I got html file from mxml file and I stored it in WebContent folder it's fine
then I want to create link named as 'Plan' in menu.xhtml
My aim is to get that html file when i clicked on this button I don't know what to do for that
so, I have created some test.xhtml in that top element is the
for the template attribute this element I have given the template.html
and I used
then for 'Plan' link I gave the view="/test.xhtml"
It's fine when I clicked on that link I am getting the test.seam file which includes our html file but this html file is coming in some fixed area with scroll bars only eventhough there is a lot of space to fit
Please help...... me
First of all, it is very difficult to read your post. Please format it more readable.
Secondly, we can only guess what's wrong when we cannot see any code. But my hunch is that you are using s:decorate that includes some formating you are not aware of. This comes in standard seam-gen. Try removing that s:decorate stuff or point to another style you wish to use.