I'm trying to build a Qt-based app on OSX (using CMake), but all the widgets (and text) that I'm creating look terrible.
For example, here is a screenshot of the checkbox and magnification text within the System Preferences app:
and here is a sample checkbox and text from my app:
My Info.plist file contains
<key>NSHighResolutionCapable</key>
<string>True</string>
but this doesn't seem to have an effect. I've also tried setting the render hint for fonts, but again, nothing changes. Is there something special that needs to be done to get simple things like checkboxes to render well on OSX when using Qt?
So the Info.plist tweak ended up being the correct fix, but OSX caches the .plist files. Deleting the entire generated bundle (including the .plist) fixed the issue. Hooray for good looking checkboxes.
Related
I just installed Qt creator (for the 10th time probably), and even when I follow the simple steps to create a new Qt Widget or Qt Console applications, I get this error. Extremely frustrated with various Qt Creator bugs. Help will be appreciate.
If you look closely at your workspace, you can see, that there are two projects. One project is called Sample, one project is called Widget. The active project is "Sample". You can tell that from the project browser as the Sample project is in bold letters. So building and debugging applies only to the Sample project.
The open file where you set your breakpoints in is "Widget/main.cpp", it belongs to the other non-active "Widget" project. So when you start the debugger, the environment warns you that this will not work. Completely correct behaviour.
Maybe try the following:
1- Ensure case sensitive typing of the file name and type the full path not just the name.
2- Delete configuration files that are automatically created.
3- Make sure the QT environment is setup correctly pointing to the required compilers, packages and resources.
4- Check if there are any missing environment variables on your machine.
The problem could be in the .pro
Check that you have the file into the source in the .pro
In my MFC dialog-based application, I'm using a subclassed CListCtrl that allows in-place modification of its subitems. I accomplished this with the great help of tips from here:
http://www.codeguru.com/cpp/controls/listview/editingitemsandsubitem/article.php/c4175/Simplified-Subitem-Editing.htm
This solution worked really great until recently when I wanted to give my application a more modern look by introducing a manifest file.
The problem I'm having now is that it behaves as expected only when I build with "/MANIFEST:NO" (project property: "Generate Manifest: No") linker option.
If I change that option to "/MANIFEST" (project property: "Generate Manifest: Yes"), the text from the first column disappears.
I've tried playing with the code to find the part that draws/clears the item's first column area - with no luck.
I've also made the project to generate the manifest as external file too. The behavior was the same and with the same generated executable it was depending on the presence of "manifest" file.
Below are 2 screenshots of the same app, built with manifest and without - the difference is clearly visible:
without manifest file created - all is fine:
with manifest created - dialog looks more modern but the "Name" text is gone:
In addition I've created a solution to demonstrate the problem:
clistctrl_problem.zip
I'd appreciate if anyone could provide a solution to this strange behavior.
I'm working with Visual Studio 2013, Version 12.0.40629.00 Update 5. Because of that "mfc120.dll" is used.
Following up on this answer to this question, I would like a clear, step-by-step set of instructions on how to set the application icon for a Qt application on OS X sufficient for distribution of the application via an installer and/or through the App Store.
The instructions should include how to set the four sizes of the icon, as referenced in the linked answer, above.
Please bear in mind that I have no experience in distributing OS X applications, building installers for OS X applications, or setting the icon that appears in the Finder bar for OS X applications. Rather, I am an experienced C++ programmer (mostly on Windows and Linux).
I especially seek a clear, step-by-step set of instructions.
You can automate icon creation by placing the following files in an icon.iconset directory:
icon_128x128.png
icon_128x128#2x.png
icon_16x16.png
icon_16x16#2x.png
icon_256x256.png
icon_256x256#2x.png
icon_32x32.png
icon_32x32#2x.png
icon_512x512.png
icon_512x512#2x.png
Then run the following command:
iconutil -c icns icon.iconset
It'll create the icons.icns that you'll reference with the ICON qmake variable.
First of all I'd like to mention that Icon Composer for XCode won't work here because it's not possible to create icns file with resolution 1024x1024 px.
To generate icns file I used iConvert Icons. The major drawback is that it's not free. To generate icns file all you need is png image with resolution 1024x1024 or more. The process is really simple so I won't cover it.
After that you'll have to include your icon in your project. To do that insert path to your icon in your Qt application's .pro file:
macx-clang {
ICON = osx.icns
}
I've been struggling with an issue regarding loading a local html file. I'm going off the assumption that a QWebView is the correct way to be trying to display this file. My issue is that while I have the .html file visible when running in Debug, when I attempt to run in Release it is not visible. I am including the file in the appropriate directories, so that's no the issue. Are there any additional settings, libs, dlls that I could be missing? I've got the file specified to the QWebView in Qt Creator in the URL field of the QWebView. It is displayed like below:
file:///C:/devel/projects/myProject/myProject/Resources/page.htm
I've changed the file to a .html as well, it doesn't seem to make a difference.
Thanks,
-K
Edit: I've changed it temporarily to:
waiver_webView_2->setUrl(QUrl::fromLocalFile("file:///C:/devel/projects/myProject/myProject/Resources/page.htm"));
Unfortunately this still does not work. I've verified and the file does actually exist there. When I provide that location to the URL via the Qt Creator it works on my developer machine in release but not on a machine I deploy to, DESPITE the folder structure being absolutely identical.
The best I could find was getting the absolute path of the file first and then using that path with QUrl. There's a qt forum post on this topic which I'll put as a source bellow. It can be adapted to your code like so:
waiver_webView->load(QUrl::fromLocalFile(QFileInfo("page.htm").absoluteFilePath()));
QFileInfo also needs to be included.
source https://forum.qt.io/topic/23653/qurl-fromlocalfile-and-relative-path/4
I have the same problem as that described in this post
I am using Eclipse 3.5.2 with CDT and have not installed this Color Theme Plugin. When I am editing C/C++ source files and placing the cursor over a defined method, the generated tooltip window shows a "black" background color so that I could not clearly see the text inside the tooltip window. I have tried to change settings in "C/C++/Editor/Syntax Coloring" preference but I have not found setting of background color for tooltip window.
The above post suggested that I may have to re-install the whole eclipse but this solution seems would cause many troubles to me. Does anyone know an easier solution for this apparently small problem.
Thanks for any suggestion.
The default UI prefs in CDT seems to be missing the "sourceHoverBackgroundColor" setting.
To fix this add a line like the following:
sourceHoverBackgroundColor=255,255,255
to the file
[workspace]/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.cdt.ui.prefs
(be sure to back-up the file before you make changes to it!)
you'll need to get eclipse to re-read that file by restarting eclipse.
Change this color in the Eclipse preferences (Window/Prefernces menu). Good color is rgb=255,255,225 (this is default for Java), or choose your own.
Credits to assifm.
Full re-installation of eclipse may not be needed. However, it's worth cleaning up the workspace / project related settings. You can follow below steps:
Go to the workspace folder and remove .metadata
Go to the projects whichever you created under this workspace and
remove, .cproject and .project
Now, start the eclipse from the scratch, you will see that all your
color combination you set are gone ... it's ok
Install the color themes plugin; don't be afraid of it, it's really cool (it doesn't cause such issues for
me);
Download a proper color theme preference file .epf (here is
mine)
Store this .epf file inside your workspace directory; so that you
know that this color theme is for this workspace; though you can
store this anywhere
Go to File -> Import -> General -> Preferences and select this
.epf file and install.
You will get the desired black background and grey text and the
auto-complete options would be unaffected
You can also think of installing the full screen plugin for eclipse, for better visibility.