Results 1 to 5 of 5

Thread: QPushButton problem

  1. #1
    Join Date
    Apr 2007
    Posts
    117
    Thanks
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QPushButton problem

    Is there a way to determine if a QPushButton already has an icon, there seems to be no getIcon method.

    Also how do you code that?
    Image Analysis Development Framework Using Qt (IADFUQ)

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QPushButton problem

    QPushButton is a QAbstractButton. QAbstractButton has a property icon. And QIcon has a method to see whether it's "null" or not.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    sincnarf (20th August 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QPushButton problem

    QAbstractButton::icon()
    Edit: Great... lost another race to J-P...

  5. The following user says thank you to wysota for this useful post:

    sincnarf (20th August 2007)

  6. #4
    Join Date
    Apr 2007
    Posts
    117
    Thanks
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton problem

    In general, how do will I know what the parent class of widget is, I also would like to know what the parent class of QIcon is because there is not method for getting the file path of the image of the QIcon. Thanks to both of you as always, jpn and wysota
    Image Analysis Development Framework Using Qt (IADFUQ)

  7. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QPushButton problem

    Quote Originally Posted by sincnarf View Post
    In general, how do will I know what the parent class of widget is
    It's mentioned at the beginning of class docs. For example at the beginning of QPushButton docs it says "Inherits QAbstractButton". One can also see a "list of all members, including inherited members" (link to this page is also at the beginning of class docs).

    I also would like to know what the parent class of QIcon is because there is not method for getting the file path of the image of the QIcon.
    Actually QIcon doesn't inherit anything. An image can be loaded from a file, but once it has been added to QIcon, it has nothing to do with the file. QIcon can contain several images anyway.

    Quote Originally Posted by wysota View Post
    Great... lost another race to J-P...
    You're watching too much Formula 1
    J-P Nurmi

Similar Threads

  1. Replies: 2
    Last Post: 19th May 2007, 18:25
  2. Replies: 3
    Last Post: 26th September 2006, 12:16
  3. QPushbutton problem
    By amulya in forum Qt Programming
    Replies: 5
    Last Post: 30th August 2006, 08:11
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.