Gtk skip_taskbar_hint (seen in Glade-ui-Designer) äquivalent in Qt - qt

With Glade Designer that lets you set up Gtk-Ui's you can check the option that windows are not shown in the taskbar (unter linux, e.g. in Ubuntu this is the launcher on the left hand side). If I take a look at the ui-file generated by Glade, it says <property name="skip_taskbar_hint">True</property> However I believe that this option is not Gtk-specific, and want to apply this one on my PyQt4-app.
Right now I can only disable the window in the taskbar if i set the hint with the programm devilspie (that communicates with EWMH-standard) to skip_tasklist, which is too much for me.
Does anybody know such an option?

It seems that Qt::SplashScreen does the same effect. You can add this flag to your widget using the following code:
setWindowFlags(windowFlags() & Qt::SplashScreen);
Source

Related

Can I globally switch to native text rendering in Qt Quick Controls 2?

I would like to use native rendering for all the text in my application. For each Text, Label, etc. element I can do this
Text {
renderType: Text.NativeRendering
}
to trigger native rendering. I can also use the software renderer for the whole application:
QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software);
However due to some bugs with the software renderer and some performance issues, I would like to avoid that.
Is there a global switch to change the render type?
Since Qt 5.7, you can change the default Qt Quick text render type, but unfortunately only at build time. In order to change the default, you would have to rebuild libQt5Quick.so with QT_QUICK_DEFAULT_TEXT_RENDER_TYPE set to NativeRendering. For more details, see https://codereview.qt-project.org/#/c/121748/ .
If you have installed Qt using an installer from qt.io, install the source packages using the maintenance tool if you already haven't done so, navigate to qtdeclarative/src/quick, run qmake with the define, and build. Something along the lines:
cd path/to/Qt/Sources/5.8/qtdeclarative/src/quick
# NOTE: make sure to run qmake from the same/correct Qt installation
path/to/Qt/5.8/<spec>/qmake "DEFINES+=QT_QUICK_DEFAULT_TEXT_RENDER_TYPE=NativeRendering"
make -jN
If you have a self-built Qt installation, invoke make clean (or if you want to save time, just delete qquicktext*.o) before make to rebuild the library.
EDIT: Since Qt 5.10, it is also possible to specify the default text render type in C++ via QQuickWindow::setTextRenderType(). Just notice to set it before loading the QML content.
The environment variable QML_DISABLE_DISTANCEFIELD controls this.
If you put
qputenv("QML_DISABLE_DISTANCEFIELD", "1");
at the beginning of your main, you will get a nice and sharp text rendering everywhere.
Source: http://www.kdab.com/~thomas/stuff/distancefield.html
Add this line first in c++ main function : QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);

How to change JavaFx native Bundle exe icon

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

How to change an initial size of qtcreator's qtcreator_process_stub window (on Ubuntu)?

I have an application being developed in QT Creator on Ubuntu. I need to run some tests and to see their results I use console — qtcreator_process_stub window is opened. And now comes my question: how to set its initial size? (especially the width to make results more readable). Setting the width by mouse each time I run my app is quite annoying.
I found a simple solution:
Go to Tools->Options->General->Environment: System->Terminal. There is a command used to invoke a terminal. In my case I needed to change the command to:
xterm -geometry 250 -e
That's all;)
Maybe it will be useful for Windows users:
You can right click on the console title bar (when running your program), select properties and change the font size (or other properties) in the font tab. It will be remembered for the future sessions.
For changing console size from command starts console use cmd.exe "/k mode con: cols=150 lines=50" (not working from Qt for me, changing COMSPEC do nothing).
In more recent versions of Qt Creator (2.6.2 and up) this can be changed in
Projects
Run (from the top of the window)
In the run environment edit the COMSPEC field
On Linux Mint you can do the following:
Open Terminal
Edit -> Profile Preferences -> General -> Use custom default terminal size
Set the Default size to a value which fit your needs.

How can I get a QFileDialog to prompt for overwrite?

I have a QDialog that opens a QFileDialog like so:
QFileDialog fd(this);
fd.setFileMode(QFileDialog::AnyFile);
if (fd.exec()) {
// save data to a file
}
Unfortunately, the default behavior doesn't seem to be quite so default, and the file dialog doesn't prompt me about overwriting if I select a file that already exists. Calling setConfirmOverwrite(true) or setOption(QFileDialog::DontConfirmOverwrite, false) first doesn't help either. I've tested this both on Qt 4.7.3 and 4.7.4 on both Ubuntu 11.04 and Windows XP.
I looked around and found this bug report. QFileDialog::getSaveFileName() had this issue, but it was specific to Maemo and fixed well before Qt 4.7.3 came out. If I use that method in my application it works just fine, I get prompted about overwriting the file. (I don't want to use getSaveFileName() for unrelated reasons.)
I can't find anyone else complaining about this not working for them. Am I doing something wrong, or is this a bug? I think it might be due to the dialog not knowing whether it's just a simple Open dialog where prompting wouldn't make sense, but I don't see a way to tell it it's a Save dialog (beyond setting the confirm-overwrite option, which fails), and the documentation does say it should prompt by default.
You should also be sure that the dialog is in save mode, as it will not think you are overwriting a file when in open mode. You can do this by calling fd.setAcceptMode(QFileDialog::AcceptSave); in your code example. See QFileDialog::acceptMode.

Adobe AIR: Controls flipped (mirrored) in certain build environments

I'm having an issue where certain controls are flipped, depending on the machine that I'm building my project on. On my development machine, when I build it, everything is okay. However, when I build it on our build server, some things are flipped. It seems to be things that are on a higher layer - for instance, options in the select control (see first image below), alerts/overlays (see second image below), etc. It's not just the text, either - the entire content is flipped, images and all.
I have verified that the code is exactly the same in both instances, so it must have something to do with settings or the flex SDK version. On my development machine, the Flex SDK version is 4.0.0.14159, and on the build server, the Flex SDK version is 4.1.0.16076. I can downgrade the SDK on the build server if needed - but could it really be an issue with the SDK? Any ideas?
Thanks!
It looks like this will be fixed in the 4.5 SDK--see SDK-26473 for workarounds.
I was able to fix the mirroring by turning off Flex 3 Compatibility Mode in the Flex compiler settings (if using mxmlc, -compatibility-version=4.0).
Your build machine must be set to a locale which uses right-to-left text, such as Hebrew or Arabic keyboard setting.
Oops - hadn't read all of dpstone's answer before I posted my comment to the question.
The answer to this problem is in the bug he linked to. You need to explicitly set the layout direction. You can do this in one of two ways.
1) in a .css file that you import into your main application file:
global
{
layoutDirection: "ltr";
}
OR
2) you can set it in a <style> tag in your main application file.
<mx:Style>
global
{
layoutDirection: "ltr";
}
</mx:Style>

Resources