gamecreature / qtawesome Goto Github PK
View Code? Open in Web Editor NEWQtAwesome - Font Awesome for Qt Applications
License: Other
QtAwesome - Font Awesome for Qt Applications
License: Other
Hi there.
In latest versions of QtAwesome it seems that the painting fails somehow for a selected QPushButton.
If I make sure that the paint method sets modePostfix = "" and optionKeysForModeAndState() does the same, I at least get the paintings working as previously.
I haven't dug more into it since just skipping the two switch statements solved my issue for now.
Is there any way to make spinner spin? Font Awesome has the option to make icon animated. Thanks.
Not quite sure why, but I can't use the new (4.7) icons...
I updated & recompile the files, but when I use one of the new icons, the icon is just a small rectangle...
Thanks in advance for your help!
Olivier
This link does not exist :-< and is referenced everywhere.
http://fortawesome.github.com/Font-Awesome
Hi,
I was wondering if is it possible to use with QtQuick and QML?
Thanks.
I set it in the QAction,
ui->actionNew_From_Clipboard->setIcon(awesome->icon(fa::beer));
And it appears in toolbar, but in menu item, it just leave empty.
Mac OSX 10.10.2 / Qt 5.3.1
When I compile QtAwesome with Qt5 (Qt 5.2.1, Ubuntu 14.04), icons with a code index >= f196 (plussquareo) are rendered either empty or as some fancy asian characters. Icons with code index < f196 work fine. QtAwesome compiled with Qt4 (Qt 4.8.6, Ubuntu 14.04) has no problems displaying all icons correctly.
Any idea what's wrong?
Has anyone tried this with Qt5 lately? Does it still work?
Hey
So there seem to be 2 variants of "awesome" fonts out there.. .c++ and python... python seems to have a wee more of them > https://github.com/spyder-ide/qtawesome/tree/master/qtawesome/fonts
Will this reader be able to read them too ?
Also, PRO version on website states like 19k icons... are they all downloadable/usable here? I'm faily new/rough to the entire fontAwesome world... Used it lightly lately.
Thanks!
Hi,
Just to inform you, I created a more generic class to make icons from generic font file .
https://github.com/dridk/QFontIcon
One of the nice feature of QT is that we can set icon with different states.
For instance, a QToolButton that is checkable can have multiple icons regarding its state:
Normal On -> when checked -> fa:lock
Normal Off -> when unchecked -> fa:unlock
This avoid to set the QIcon manually each time the button is changing its state.
After study of the source code, QtAwesome is using an engine for generating the icon. Would it be possible to add multiple icon to a generator so it can handle different icons for each Mode/State?
Resources:
http://doc.qt.io/qt-5/qicon.html#Mode-enum
在C++98中, 单词‘linux’不可以作为变量,应该把fa::linux更改一下,就支持C++98了
First, thanks for the great software.
Do you plan to update to the latest version? ( Font awesome 5.x )
It think there might be a problem with the compilation/building of the QtAwesome library with the newest version of Qt (version 5.14.0), using MSVC_2015, 64bits.
I used to compile this library using Qt 5.7.1 and Qt 5.13.x (also with MSVC_2015, 64bits) and never run into a single problem. But today, I downloaded the newest Qt version (5.14.0) and with this kit, I always run into this error :
*** C1001 : An internal error has occured in the compiler.
C:\Qt\5.14.0\msvc2015_64\include\QtCore\qsrtring.h
and this error is linked to those lines of code in the qstring.h file :
#ifdef Q_CLANG_QDOC
QString
#else
typename std::enable_if<
sizeof...(Args) >= 2 && std::is_same<
QtPrivate::BoolList<is_convertible_to_view_or_qstring<Args>::value..., true>,
QtPrivate::BoolList<true, is_convertible_to_view_or_qstring<Args>::value...>
>::value,
QString
>::type
#endif
The error seems to be really related to QtAwesome since I'm able to build everything else in the project independently (excepted the parts using the QtAwesome library functions)
Hope I made my problem clear for you guys and hopefully someone will comes out with a fix or an idea on how to fix it because I'm pretty much out of idea myself...
The last release was in 2015.
first of all thanks for your work!
I am using another software openhantek that use your library. Unfortunately in macOS with darkmode the icons are nearly indistinguishable with the background (see the image at the end). Before patching openhantek I would like to ask you if that change could be fit on this library?
Just for test I did
iconFont->setDefaultOption( "color", QColor(255,100,100) );
iconFont->setDefaultOption( "color-disabled", QColor(155,60,10));
iconFont->setDefaultOption( "color-active", QColor(100,100,100));
iconFont->setDefaultOption( "color-selected", QColor(12,240,100));
iconFont->setDefaultOption( "color-off", QColor(255,100,100) );
iconFont->setDefaultOption( "color-disabled-off", QColor(155,60,10));
iconFont->setDefaultOption( "color-active-off", QColor(100,100,100));
iconFont->setDefaultOption( "color-selected-off", QColor(12,240,100));
and it works.
Default behaviour of QtAwesome in openhantek. The red icon that is visible is an svg file.
Hi,
I tried to compile your sample code and I got this error. Any idea?
/usr/include/qt4/QtCore/qmetatype.h:169:79: error: ‘qt_metatype_id’ is not a member of ‘QMetaTypeId<QtAwesomeAnimation*>’ static inline int qt_metatype_id() { return QMetaTypeId::qt_metatype_id(); }
I am using Qt 5.7 . Icon is not showing as expected.
Login::Login(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Login)
{
ui->setupUi(this);
ui->lineEdit_password->setEchoMode(QLineEdit::Password);
QtAwesome* awesome = new QtAwesome(this);
awesome->initFontAwesome();
ui->pushButton->setIcon(awesome->icon( "sign-in" ));
ui->pushButton_2->setIcon(awesome->icon( "user-plus" ));
}
Hello,
I'm using qt 4.8.6 with ubuntu 16.04 and I'm trying to insert an icon inside a button, but the result is not rendering properly.
QPushButton *deleteButton = new QPushButton();
deleteButton->setFlat(true);
deleteButton->setFixedWidth(32);
deleteButton->setFixedHeight(32);
deleteButton->setIcon(awesome->icon(fa::remove));
deleteButton->setIconSize(QSize(32, 32));
deviceLayout->addWidget(deleteButton);
Any idea what could be wrong, or am I missing something?
Thanks
Hey
Would it be possible to provide a parser/writer to let us write new icons to this library?
I'm using it more and more and would love to add more of my own icons in to it and benefit from the custom painter customizations/etc.
Regards
Dariusz
menuAction->setIcon( awesome->icon(fa::beer).pixmap(32,32) >>>)<<< );
Add support for using the library from Qml, for instance (Font Awesome 5 branch):
`{
Q_OBJECT
Q_ENUMS(FontStyle)
public:
enum FontStyle {
/// solid icons
Stfas = style::stfas,
/// regular icons
Stfar = style::stfar,
#ifdef FONT_AWESOME_PRO
/// light icons
Stfal = style::stfal,
/// duotone icons
Stfad = style::stfad,
#endif
/// brands icons
Stfab = style::stfab
};
Q_INVOKABLE QString getFontName(FontStyle fontStyle = Stfas) const;
Q_INVOKABLE QString getIcon(const QString &iconName, FontStyle fontStyle = Stfas) const;`
In the README.md file, in Example section, a line is missing where options are explained :
QVariantMap options;
options.insert( "color" , QColor(255,0,0) );
QPushButton* musicButton = new QPushButton( awesome->icon( icon_music ), "Music" );
The variable options is never used to set the icon color.
The branch with FontAwesome 5 support works only with one font on most platforms (e.g. iOS, macOS, Android) because the fonts are overwriting each other when registered in the QFontDatabase.
I set 3 colors for 3 widgets,but the pushbutton has no role
I don't know why..........
QtAwesome *awesome = new QtAwesome();
awesome->initFontAwesome();
QVariantMap vmapRed;
QVariantMap vmapBlue;
QVariantMap vmapGreen;
vmapRed.insert("color",QColor(Qt::red) );
vmapBlue.insert("color",QColor(Qt::blue));
vmapGreen.insert("color",QColor(Qt::darkGreen));
ui->action513->setIcon(awesome->icon(fa::stop, vmapRed));
ui->pushButton->setIcon(awesome->icon(fa::aligncenter, vmapBlue));
ui->toolButton->setIcon(awesome->icon(fa::yelp, vmapGreen));
Hey
Its an awesome engine that can colorize icons based on state/etc. It would be great if it could take any of the other 3 types of pixmaps and draw that + its states/etc logic.
Regards
Dariusz
it does not cause any harm, but...
Hi
As far as I understand, I should write some pieces of code in .cpp files to use QtAwesome fonts. How can I use QtAwesome directly in the Qt Creator (or designer) environment in the UI design step (through the property editor, for example)?
Thanks
Hi,
In your documentation, you said that QtAwesome should be initialized only once. In this case, why not creating a singleton class with static methods?
Thank you for this wonderful piece of code.
Edit: I can make a PR if you think it's a good idea.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.