Git Product home page Git Product logo

qfonticon's Introduction

QFontIcon

QFonticon is a simple Qt class that allows you to create QIcon from a font file like font Awesome.
QFontIcon is under MIT license

Usage

You just have to copy QFontIcon folder into your project. And add the following line in you project.pro file.

   include("QFontIcon/QFontIcon.pri")

You need a font file to use QFontIcon. You can for exemple download font Awesome and add it in your project as a resource file. Then use the class as follow:
Load first the font file only one time. In the main.cpp in the most of the case.

    QFontIcon::addFont(":/fontawesome.ttf");

Then you can get icon from unicode:

    QAction * action = new QAction(QFontIcon::icon(0xf501));
    // or using typedef FIcon definition 
    QAction * action = new QAction(FIcon(0x501));

QFontIcon::icon(QChar) takes the unicode of the icon's caracter. You can get unicode name from CharacterMap website.

## Exemple The following repository contains an exemple based on font awesome. Open QFontIcon.pro in QtCreator and run it. You should see the following results.

QFontIcon demo

qfonticon's People

Contributors

carlonluca avatar dridk avatar

Watchers

 avatar

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.