Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Create QIcon in source code?
Forum Updated to NodeBB v4.3 + New Features

Create QIcon in source code?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 260 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Calicoder
    wrote on last edited by
    #1

    Howdy QT folks, been checking the official docs and don't see this error mentioned. I have a class named App with app.h and app.cpp like this:

    app.h

    private:
        QIcon goSign;
        QIcon stopSign;
    

    app.cpp

    goSign = QIcon(":/res/images/goSign.png");
    stopSign = QIcon(":/res/images/stopSign.png");
    

    The error I get is:
    goSign uses undefined class QIcon
    stopSign uses undefined class QIcon

    Any ideas what is going on? Appreciate the help.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mchinand
      wrote on last edited by mchinand
      #2

      Did you include the QIcon header?

      #include <QIcon>
      

      Is your project configured to be a gui application? See the QIcon documentation

      C 1 Reply Last reply
      3
      • M mchinand

        Did you include the QIcon header?

        #include <QIcon>
        

        Is your project configured to be a gui application? See the QIcon documentation

        C Offline
        C Offline
        Calicoder
        wrote on last edited by
        #3

        @mchinand Brilliant, that was it. I feel silly :-) Thanks so much

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved