Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Qt resource system #59

Open
ozmartian opened this issue Nov 22, 2016 · 1 comment
Open

Add support for Qt resource system #59

ozmartian opened this issue Nov 22, 2016 · 1 comment

Comments

@ozmartian
Copy link

Hi guys,

Just started using qtawesome as well as using qta.load_font() for some of my own custom made glyph font icons. This is when I realised load_font() will only work with physical files in a folder on the filesystem. Just throwing out the idea of enhancing this further to support the Qt resource system for bth the custom TTF font file and its corresponding charmap file. Along the lines of passing these two params as resource file paths via the ':' prefix. I'm currently getting around this limitation by copying the files out to a temp unique folder.

I realise this is no high priority suggestion as most people would be using thos for wat you're already bundling alone but if its quick and easy to do then I thought I should at least share the suggestion.

If no one is interested in doing this I can always fork and have a go at it myself to then share back for adoption.

Cheers!

@goanpeca goanpeca added this to the 0.4 milestone Nov 22, 2016
@ccordoba12 ccordoba12 modified the milestones: 0.4, v0.5 Dec 30, 2016
@ccordoba12 ccordoba12 removed this from the v0.5 milestone Sep 12, 2018
@goanpeca goanpeca added this to the future milestone Feb 10, 2020
@pedromorgan
Copy link

Am just browsing issues.... and this rings with me...

I've ended up with on almost all my apps in psuedo code

class Ico:
  open = "open.png"
  close = "mdi.this"
  favicon = "coprate.svg"

  @staticmethod
  def icon(name, color="#666666", scale=1.0):
     if name.endwith(".png|.svg|.jpg|.jpeg"):
        return QIcon.frompixmap .. << read file sys etc
    return qtawesome.icon(name, color, scale)
      
myWidget = QtWidgets.QToolButton()
myWidget.setIcon(Ico.icon(Ico.close)

At least Ico.close is on one place in python.. and dont use resource files for that reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants