mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2024-11-15 13:35:44 +08:00
Fix for non-commercial version and markdown style changes
This commit is contained in:
parent
787c8f1226
commit
caf78c4429
@ -1,7 +1,7 @@
|
|||||||
MIT License
|
MIT License
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Copyright 2013-2015 [Reliable Bits Software by Blommers IT](http://blommersit.nl). All Rights Reserved.
|
Copyright 2013-2019 [Reliable Bits Software by Blommers IT](http://blommersit.nl). All Rights Reserved.
|
||||||
Author [Rick Blommers](mailto:rick@blommersit.nl)
|
Author [Rick Blommers](mailto:rick@blommersit.nl)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||||
|
@ -252,11 +252,11 @@ QtAwesome::~QtAwesome()
|
|||||||
if(_namedCodepoints.contains(style::stfas))
|
if(_namedCodepoints.contains(style::stfas))
|
||||||
delete _namedCodepoints[style::stfas];
|
delete _namedCodepoints[style::stfas];
|
||||||
#else
|
#else
|
||||||
if(_namedCodepoints.contains(style::fas))
|
if(_namedCodepoints.contains(style::stfas))
|
||||||
delete _namedCodepoints[style::fas];
|
delete _namedCodepoints[style::stfas];
|
||||||
|
|
||||||
if(_namedCodepoints.contains(style::far))
|
if(_namedCodepoints.contains(style::stfar))
|
||||||
delete _namedCodepoints[style::far];
|
delete _namedCodepoints[style::stfar];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2425,13 +2425,13 @@ bool QtAwesome::initFontAwesome( )
|
|||||||
for (unsigned i = 0; i < sizeof(faCommonIconArray)/sizeof(FANameIcon) && i < FREE_REGULAR_ICON_SIZE; ++i) {
|
for (unsigned i = 0; i < sizeof(faCommonIconArray)/sizeof(FANameIcon) && i < FREE_REGULAR_ICON_SIZE; ++i) {
|
||||||
farMap->insert(faCommonIconArray[i].name, faCommonIconArray[i].icon);
|
farMap->insert(faCommonIconArray[i].name, faCommonIconArray[i].icon);
|
||||||
}
|
}
|
||||||
_namedCodepoints.insert(style::far, farMap);
|
_namedCodepoints.insert(style::stfar, farMap);
|
||||||
|
|
||||||
QHash<QString, int> *fasMap = new QHash<QString, int>();
|
QHash<QString, int> *fasMap = new QHash<QString, int>();
|
||||||
for (unsigned i = 0; i < sizeof(faCommonIconArray)/sizeof(FANameIcon); ++i) {
|
for (unsigned i = 0; i < sizeof(faCommonIconArray)/sizeof(FANameIcon); ++i) {
|
||||||
fasMap->insert(faCommonIconArray[i].name, faCommonIconArray[i].icon);
|
fasMap->insert(faCommonIconArray[i].name, faCommonIconArray[i].icon);
|
||||||
}
|
}
|
||||||
_namedCodepoints.insert(style::fas, fasMap);
|
_namedCodepoints.insert(style::stfas, fasMap);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
@ -19,8 +19,8 @@ HEADERS += \
|
|||||||
|
|
||||||
|
|
||||||
# only one option must be enabled
|
# only one option must be enabled
|
||||||
CONFIG += fontAwesomePro
|
#CONFIG += fontAwesomePro
|
||||||
#CONFIG += fontAwesomeFree
|
CONFIG += fontAwesomeFree
|
||||||
include(../QtAwesome/QtAwesome.pri)
|
include(../QtAwesome/QtAwesome.pri)
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
121
README.md
121
README.md
@ -1,8 +1,6 @@
|
|||||||
QtAwesome - Font Awesome support for Qt applications
|
# QtAwesome - Font Awesome support for Qt applications
|
||||||
====================================================
|
|
||||||
|
|
||||||
Description
|
## Description
|
||||||
-----------
|
|
||||||
|
|
||||||
QtAwesome is a simple library that can be used to add [Font Awesome](http://fortawesome.github.io/Font-Awesome/) icons to your [Qt application](http://qt-project.org/).
|
QtAwesome is a simple library that can be used to add [Font Awesome](http://fortawesome.github.io/Font-Awesome/) icons to your [Qt application](http://qt-project.org/).
|
||||||
|
|
||||||
@ -10,62 +8,53 @@ NOTE: Though the name is QtAwesome and currently it's very Font Awesome based, y
|
|||||||
|
|
||||||
The class can also be used to manage your own dynamic code-drawn icons, by adding named icon-painters.
|
The class can also be used to manage your own dynamic code-drawn icons, by adding named icon-painters.
|
||||||
|
|
||||||
Changes in FontAwesome 5.10.2
|
## Changes in FontAwesome 5.10.2
|
||||||
----------------------------
|
|
||||||
|
|
||||||
New version of this library added support to Font Awesome version **5.10.2**.
|
New version of this library added support to Font Awesome version **5.10.2**.
|
||||||
|
|
||||||
* This library supports Free and Pro versions of Font Awesome, however only the pro font files are included in this repository, but if you have a pro license of the icons you can use it.
|
* This library supports Free and Pro versions of Font Awesome, however only the pro font files are included in this repository, but if you have a pro license of the icons you can use it.
|
||||||
* It support all icons styles (solid, regular, brand, light, duotone), including the duotone icons in pro version.
|
* It support all icons styles (solid, regular, brand, light, duotone), including the duotone icons in pro version.
|
||||||
|
|
||||||
Changes in FontAwesome 4.7.0
|
## Changes in FontAwesome 4.7.0
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Previous version of this library added support to Font Awesome version **4.7.0**.
|
Previous version of this library added support to Font Awesome version **4.7.0**.
|
||||||
|
You can find the font-aweomse 4 version in the branch. (https://github.com/gamecreature/QtAwesome/tree/fontawesome-4)
|
||||||
|
|
||||||
* In the 4.5.0 version the _linux name has been changed to fa_linux. (Makes the naming of conflicting/invalid names more consistent, like fa_try and fa_500px)
|
* In the 4.5.0 version the _linux name has been changed to fa_linux. (Makes the naming of conflicting/invalid names more consistent, like fa_try and fa_500px)
|
||||||
* You can find the previous FontAwesome 4 c++11 library in the [c++11 branch](https://github.com/gamecreature/QtAwesome/tree/c++11).
|
* You can find the previous FontAwesome 4 c++11 library in the [c++11 branch](https://github.com/gamecreature/QtAwesome/tree/c++11).
|
||||||
* You can find the previous FontAwesome 3 library in the [fontawesome-3 branch](https://github.com/gamecreature/QtAwesome/tree/fontawesome-3).
|
* You can find the previous FontAwesome 3 library in the [fontawesome-3 branch](https://github.com/gamecreature/QtAwesome/tree/fontawesome-3).
|
||||||
|
|
||||||
|
|
||||||
**Note about previous c++11**
|
**Note about previous c++11**
|
||||||
|
|
||||||
I removed the C++11 requirement. And moved the c++11 code to a c++11 branch.
|
I removed the C++11 requirement. And moved the c++11 code to a c++11 branch.
|
||||||
It's not that I don't like c++11, but the typed enum made the code less flexible then it is now.
|
It's not that I don't like c++11, but the typed enum made the code less flexible then it is now.
|
||||||
Just integers it is. Simpler is better.
|
Just integers it is. Simpler is better.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
|
||||||
Installation
|
|
||||||
------------
|
|
||||||
|
|
||||||
The easiest way to include QtAweome **5.10.2** in your project is to copy the QtAwesome directory to your
|
The easiest way to include QtAweome **5.10.2** in your project is to copy the QtAwesome directory to your
|
||||||
project tree and add the following `include()` to your Qt project file:
|
project tree and add the following `include()` to your Qt project file:
|
||||||
|
|
||||||
|
```bash
|
||||||
CONFIG+=fontAwesomeFree #or CONFIG+=fontAwesomePro for pro version
|
CONFIG+=fontAwesomeFree #or CONFIG+=fontAwesomePro for pro version
|
||||||
include(QtAwesome/QtAwesome.pri)
|
include(QtAwesome/QtAwesome.pri)
|
||||||
|
```
|
||||||
|
|
||||||
Now you are good to go!
|
Now you are good to go!
|
||||||
|
|
||||||
|
## Usage
|
||||||
Usage
|
|
||||||
-----
|
|
||||||
|
|
||||||
You probably want to create a single QtAwesome object for your whole application:
|
You probably want to create a single QtAwesome object for your whole application:
|
||||||
|
|
||||||
````
|
```c++
|
||||||
QtAwesome* awesome = new QtAwesome( qApp )
|
QtAwesome* awesome = new QtAwesome( qApp )
|
||||||
awesome->initFontAwesome(); // This line is important as it loads the font and initializes the named icon map
|
awesome->initFontAwesome(); // This line is important as it loads the font and initializes the named icon map
|
||||||
|
```
|
||||||
````
|
|
||||||
|
|
||||||
* Add an accessor to this object (i.e. a global function, member of your application object, or whatever you like).
|
* Add an accessor to this object (i.e. a global function, member of your application object, or whatever you like).
|
||||||
* Use an icon name from the [Font Awesome Cheatsheet](http://fortawesome.github.io/Font-Awesome/cheatsheet/).
|
* Use an icon name from the [Font Awesome Cheatsheet](http://fortawesome.github.io/Font-Awesome/cheatsheet/).
|
||||||
|
|
||||||
|
## Example
|
||||||
Example
|
|
||||||
--------
|
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
// You should create a single object of QtAwesome.
|
// You should create a single object of QtAwesome.
|
||||||
@ -95,8 +84,7 @@ label->setFont( awesome->font(style::fab, 16) );
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Example custom painter
|
## Example custom painter
|
||||||
----------------------
|
|
||||||
|
|
||||||
This example registers a custom painter for supporting a duplicate icon (it draws 2 "plus marks"):
|
This example registers a custom painter for supporting a duplicate icon (it draws 2 "plus marks"):
|
||||||
|
|
||||||
@ -125,9 +113,7 @@ public:
|
|||||||
awesome->give("duplicate", new DuplicateIconPainter() );
|
awesome->give("duplicate", new DuplicateIconPainter() );
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Default options
|
||||||
Default options:
|
|
||||||
----------------
|
|
||||||
|
|
||||||
The following options are default in the QtAwesome class.
|
The following options are default in the QtAwesome class.
|
||||||
|
|
||||||
@ -146,6 +132,7 @@ setDefaultOption( "scale-factor", 0.9 );
|
|||||||
```
|
```
|
||||||
|
|
||||||
In pro version
|
In pro version
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
setDefaultOption( "duotone-color", QColor(50,50,50,127) );
|
setDefaultOption( "duotone-color", QColor(50,50,50,127) );
|
||||||
setDefaultOption( "duotone-color-disabled", QColor(70,70,70,50));
|
setDefaultOption( "duotone-color-disabled", QColor(70,70,70,50));
|
||||||
@ -171,42 +158,41 @@ And iconstate On is off.
|
|||||||
|
|
||||||
So the list of items used is:
|
So the list of items used is:
|
||||||
|
|
||||||
- color
|
* color
|
||||||
- color-disabled
|
* color-disabled
|
||||||
- color-active
|
* color-active
|
||||||
- color-selected
|
* color-selected
|
||||||
- color-off
|
* color-off
|
||||||
- color-disabled-off
|
* color-disabled-off
|
||||||
- color-active-off
|
* color-active-off
|
||||||
- color-selected-off
|
* color-selected-off
|
||||||
- duotone-color (only in pro mode)
|
* duotone-color (only in pro mode)
|
||||||
- duotone-color-disabled (only in pro mode)
|
* duotone-color-disabled (only in pro mode)
|
||||||
- duotone-color-active (only in pro mode)
|
* duotone-color-active (only in pro mode)
|
||||||
- duotone-color-selected (only in pro mode)
|
* duotone-color-selected (only in pro mode)
|
||||||
- duotone-color-off (only in pro mode)
|
* duotone-color-off (only in pro mode)
|
||||||
- duotone-color-disabled-off (only in pro mode)
|
* duotone-color-disabled-off (only in pro mode)
|
||||||
- duotone-color-active-off (only in pro mode)
|
* duotone-color-active-off (only in pro mode)
|
||||||
- duotone-color-selected-off (only in pro mode)
|
* duotone-color-selected-off (only in pro mode)
|
||||||
- text
|
* text
|
||||||
- text-disabled
|
* text-disabled
|
||||||
- text-active
|
* text-active
|
||||||
- text-selected
|
* text-selected
|
||||||
- text-off
|
* text-off
|
||||||
- text-disabled-off
|
* text-disabled-off
|
||||||
- text-active-off
|
* text-active-off
|
||||||
- text-selected-off
|
* text-selected-off
|
||||||
- style
|
* style
|
||||||
- style-disabled
|
* style-disabled
|
||||||
- style-active
|
* style-active
|
||||||
- style-selected
|
* style-selected
|
||||||
- style-off
|
* style-off
|
||||||
- style-disabled-off
|
* style-disabled-off
|
||||||
- style-active-off
|
* style-active-off
|
||||||
- style-selected-off
|
* style-selected-off
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
License
|
|
||||||
-------
|
|
||||||
|
|
||||||
MIT License. Copyright 2013 - Reliable Bits Software by Blommers IT. [http://blommersit.nl/](http://blommersit.nl)
|
MIT License. Copyright 2013 - Reliable Bits Software by Blommers IT. [http://blommersit.nl/](http://blommersit.nl)
|
||||||
|
|
||||||
@ -214,17 +200,14 @@ The Font Awesome font is licensed under the SIL Open Font License - [http://scri
|
|||||||
The Font Awesome pictograms are licensed under the CC BY 3.0 License - [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)
|
The Font Awesome pictograms are licensed under the CC BY 3.0 License - [http://creativecommons.org/licenses/by/3.0/](http://creativecommons.org/licenses/by/3.0/)
|
||||||
"Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
|
"Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome"
|
||||||
|
|
||||||
Contact
|
## Contact
|
||||||
-------
|
|
||||||
|
|
||||||
* email: <rick@blommersit.nl>
|
* email: <rick@blommersit.nl>
|
||||||
* twitter: [https://twitter.com/gamecreature](https://twitter.com/gamecreature)
|
* twitter: [https://twitter.com/gamecreature](https://twitter.com/gamecreature)
|
||||||
* website: [http://blommersit.nl](http://blommersit.nl) (warning Dutch content ahead)
|
* website: [http://blommersit.nl](http://blommersit.nl) (warning Dutch content ahead)
|
||||||
* github: [https://github.com/gamecreature/QtAwesome](https://github.com/gamecreature/QtAwesome)
|
* github: [https://github.com/gamecreature/QtAwesome](https://github.com/gamecreature/QtAwesome)
|
||||||
|
|
||||||
|
## Known issues and workarounds
|
||||||
Known issues and workarounds
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
On Mac OS X, placing an qtAwesome icon in QMainWindow menu, doesn't work directly.
|
On Mac OS X, placing an qtAwesome icon in QMainWindow menu, doesn't work directly.
|
||||||
See the following issue: [https://github.com/gamecreature/QtAwesome/issues/10]
|
See the following issue: [https://github.com/gamecreature/QtAwesome/issues/10]
|
||||||
@ -236,9 +219,7 @@ QAction* menuAction = new QAction("test");
|
|||||||
menuAction->setIcon( awesome->icon(fa::beer).pixmap(32,32) );
|
menuAction->setIcon( awesome->icon(fa::beer).pixmap(32,32) );
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Remarks
|
||||||
Remarks
|
|
||||||
-------
|
|
||||||
|
|
||||||
I've created this project because I needed some nice icons for my own Qt project. After doing a lot of
|
I've created this project because I needed some nice icons for my own Qt project. After doing a lot of
|
||||||
css/html5 work and being spoiled by the ease of twitter bootstrap with Font Awesome,
|
css/html5 work and being spoiled by the ease of twitter bootstrap with Font Awesome,
|
||||||
|
Loading…
Reference in New Issue
Block a user