Where is template for "Qt Widgets application" in Qt Creator? - qt-creator

I want to customize this template and I cann't find it. qtcreator/templates/wizards/projects folder contains only cpp and c plain projects, qtquick templates, and some other templates.

For historical reasons the Qt Widgets Application wizard template is located in share/qtcreator/templates/qt4project/ (or Qt Creator.app/Contents/Resources/templates/qt4project/ if you happen to be on macOS).

Related

How to support Xcode Templates for SwiftPM?

I have Xcode Template that generate a bunch of files (not project) with some predefined repetitive code (for example classes for MVVM pattern). When I try to create these files in Xcode Project all works fine (I can find and create my templates in New File… menu), but when I try to do the same thing in SwiftPM I can't find my templates in the New File… menu.
All my templates are leaving in ~/Library/Developer/Xcode/Templates/**/*.xctemplate.
What should I do to show templates for SwiftPM as well?
After some research of /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/ folder I found that some default templates have the property SupportsSwiftPackage that set to YES. I added it to my templates and it finally works.

Can Qt3 designed UI can be converted to Qt5 UI form?

is it possible to convert Qt3 designed UI to Qt5 UI form?
I have a huge quantities of forms that must be transfered. The only way out I can see for now, is to make a brand new ones.
I tried to open .ui file via Qt5, it returned error:
This file was created using Designer from Qt-3.3 and cannot be read.
Do you want to update the file location or generate a new form?
Qt 4 came with a tool called uic3. This allows you to convert them to the Qt 4 uic format, which might help in using them with Qt5. Though, if deprecated widgets from Qt 3 were used, you'll probably need manual editing.

Xcode 8.3: how to install multiple custom "Project Templates" in Xcode 8.3?

I am trying to install two custom "project templates" in Xcode 8.3.3.
To be more specific, I'm trying to install Cocos2D-obj templates for v2.1 and v2.2. (Cocos2D v3 or higher no longer use Xcode templates, but v2.x does.)
During the installation, each Cocos2D v2.1 and v2.2 creates its own Xcode template folders and those folders are simply copied into the Xcode's custom template folder:
~User/Library/Developer/Xcode/Templates/cocos2d v2.2
~User/Library/Developer/Xcode/Templates/cocos2d v2.1
I was hoping to see that there are two separated templates (cocos2d v2.2 and cocos2d v2.1) available in the template menu when a new Xcode project is being created. However only one (either v2.2 or v2.1) appears in the template menu. (Interesting thing is that the last modified one appears.)
Basically it seems like Xcode doesn't allow to have more than one custom template in its menu.
(However, "File template" menu shows both v2.2 and v2.1 "file template" correctly in Xcode, so only the project template doesn't.)
As far as I know this is something related to Xcode's custom template related behavior, but I cannot find any official document regarding custom template from Apple's document depository.
So the question is, how can I have two custom project templates (v2.1 & v2.2) appear in the template menu when new project is being created?
Any good answers or helpful comments are appreciated.
Thanks in advance.
Finally I have figured it out how it goes.
When it comes to "project template", Xcode looks like tracing the "identifier string" in the plist files of each templates. And when there are more than one template files exist under the same "identifier string", it chooses only one template randomly(?) among them and shows that in its template menu when an new project is being created.
After manually modifying those identifier strings from the templates (in v2.1) not to have same ones against templates in other package (v2.2), Xcode brings them all in its template menu correctly. So I manually modified all cocos2d-v2.1 templates not to have same identifier strings against v2.2. Also, it is worth to be noted that some templates have "ancestors" in its fields such that those ancestors are also needed to be updated accordingly when the entire template package is modified for this reason. I wish I could see any official documents from Apple regarding how to handle Xcode's templates, (for the latest version of Xcode).

Qt Creator color scheme

I like the dark "FakeVim" color scheme in Qt Creator. However it only makes the editor part dark while everything else stays normal, which is a bit disturbing. Is there any way to make such dark scheme global for Qt Creator?
Vim (dark) Color Scheme
Color scheme is applied solely to text editor (as this is the only option), and not the environment.
Simple in two line
Go to "Tools" -> "Options" -> "Environment" -> "General" tab,
Change "Theme" to dark
I found some trick for your problem!
Here you can see it: Habrahabr -- Redesigning Qt Creator by your hands (russian lang.)
According to that article, that trick is kind of not so dirty, but "hack" (probably it wouldn't harm your system, but it can leave some artifacts on your interface).
You don't need to patch something (there is possibility, but I don't recommend).
Main idea is to use stylesheet like this stylesheet.css:
// on Linux
qtcreator -stylesheet='.qt-stylesheet.css'
// on Windows
[pathToQt]\QtCreator\bin\qtcreator.exe -stylesheet [pathToStyleSheet]
To get such effect:
To customize by your needs, you may need to read documentation: Qt Style Sheets Reference, Qt Style Sheets Examples and so on.
This wiki page is dedicated to custom Qt Creator styling.
P.S. If you'll got better stylesheet, share it, I'll be happy! :)
UPD (10.12.2014): Hopefully, now we can close this topic. Thanks, Simon G., Things have changed once again. Users may use custom themes since QtCreator 3.3. So hacky stylesheets are no longer needed.
Everyone can take a look at todays update: Qt 5.4 released. There you can find information that Qt 5.4, also comes with a brand new version of Qt Creator 3.3. Just take a look at official video at Youtube.
So, to apply dark theme you need go to "Tools" -> "Options" -> "Environment" -> "General" tab, and there you need to change "Theme".
See more information about its configuring here: Configuring Qt Creator.
In newer versions of Qt Creator (Currently using 4.4.1), you can follow these simple steps:
Tools > Options > Environment > Interface
Here you can change the theme to Flat Dark.
It will change the whole Qt Creator theme, not just the editor window.
Here is my dark theme (based on Darcula IntelliJ Theme):
https://github.com/mervick/Qt-Creator-Darcula
QTcreator obeys your kde-wide configurations.
If you choose "obsidian-coast" as the system-wide color scheme qt creator will be all dark as well.
I know it is a partial solution but it works.
My Dark Color scheme for QtCreator is at:
https://github.com/borzh/qt-creator-css/blob/master/qt-creator.css
To use with Vim (dark) scheme.
Hope it is useful for someone.
I found a way to change the Application Output theme and everything that can't be edited from .css.
If you use osX:
Navigate to your Qt install directory.
Right click Qt Creator application and select "Show Package Contents"
Copy the following file to your desktop> Contents/Resources/themes/dark.creatortheme
or /default.creatortheme. Depending on if you are using dark theme or default theme.
Edit the file in text editor.
Under [Palette], there is a line that says error=ffff0000.
Set a new color, save, and override the original file.
Linux, Qt Creator >= 3.4:
You could edit theese themes:
/usr/share/qtcreator/themes/default.creatortheme
/usr/share/qtcreator/themes/dark.creatortheme
Here is a theme that I copied all the important parts of the Visual Studio 2013 dark theme.
**Update 08/Sep/15 - Qt Creator 3.5.1/Qt 5.5.1 might have fixed the rest of Qt not being dark properly and hard to read.

how to call the c static library in a cocoa app?

I have two projects, a Cocoa application and a static c library which it uses.
Then didn't in the same folder.For example:the name of c static library is libXXX.a,it in the XXXcore folder.the cocoa application in another folder that is the same level with the XXXcore folder. When I try to compile the cocoa application,I have the link error result.It is seem to change the search path in the cocoa app info(General panel).But it is not work,why?
If you're using Xcode, you can add a link to static library by adding the library to Frameworks folder in the project.
ok. I have the answer:
add the .a library to your cocoa project
edit the path of Header Search paths and Library Search paths in the project info panel(build panel)
don't forget the copy option while adding the library to your project.
Thanks Mehrdad Afshari for your help!

Resources