Code Monkey home page Code Monkey logo

qtawesome's People

Contributors

gamecreature avatar gsauthof avatar hanjianqiao avatar jihadist avatar joelnordell avatar jzsun avatar l-super avatar lazybobcat avatar leha-bot avatar martindelille avatar mbsanchez avatar msiedlarek avatar nthuemmel avatar stennie avatar w1res avatar wh201906 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtawesome's Issues

On windows 10, the an icon in QPushButton that is selected isn't shown

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.

Support for animation

Is there any way to make spinner spin? Font Awesome has the option to make icon animated. Thanks.

Problem with icon 4.7

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

It seems not work in the menu?

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

Qt5: Erroneous display of icons (codes >= 0xf196)

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?

qtawesome-qt4-qt5

QIcon::Mode and QIcon::State

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++11 => C++98

在C++98中, 单词‘linux’不可以作为变量,应该把fa::linux更改一下,就支持C++98了

Incompatibility with the new Qt 5.14

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...

macOS darkmode

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.

04dfe172-bec4-43c2-93d8-6492a0f4e7b2

Icon not showing

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" ));

}

not rendering properly

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);

qtfa

Any idea what could be wrong, or am I missing something?
Thanks

Adding custom icons to library

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

Typo in the docu

menuAction->setIcon( awesome->icon(fa::beer).pixmap(32,32) >>>)<<< );

Add qml support

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;`

Missing line in example code

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.

FontAwesome 5 branch works only with one font

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.

about options

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));

Take existing QPixmap/QImage/QIcon as source?

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

How to use QtAwesome directly in the Qt Designer

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

Singleton class

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.