Results 1 to 4 of 4

Thread: need the QIcon without borders in QStandardItem

  1. #1
    Join Date
    Feb 2011
    Location
    udaipur,Rajasthan
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60

    Question need the QIcon without borders in QStandardItem

    Hi,
    I need the QIcon without borders in QStandardItem. is it possible?
    I need the QIcon only without text in QStandardItem. is it possible?
    This QStandardItems I want to use them in QListView as Grid View .
    So I want only images to be visible in grid and the item should be selectable.
    Any help will be much appreciated. thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: need the QIcon without borders in QStandardItem

    I need the QIcon without borders in QStandardItem. is it possible?
    What do you mean with out borders?
    With a transparent background?
    Should be possible, as QPixmap supports png.

    I need the QIcon only without text in QStandardItem. is it possible?
    Try setting empty string?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2011
    Location
    udaipur,Rajasthan
    Posts
    27
    Qt products
    Qt3 Qt4
    Platforms
    Windows Symbian S60

    Question Re: need the QIcon without borders in QStandardItem

    [IMG]file://C:/Documents and Settings/CSingh/Desktop/img1.png[/IMG]- right now it is visible like this as in img1.png but we need like this as shown in img2.png
    [IMG]file://C:/Documents and Settings/CSingh/Desktop/img2.png[/IMG]

    we have already given blank text but it still had the placeholder below the image for text.

    Around the image(QIcon) is takes around 10 px left, right and in bottom 25 px for blank text,but I want only 1 px gaps in between images(QIcon).
    Attached Images Attached Images
    Last edited by chandantheracer; 15th April 2011 at 05:35.

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: need the QIcon without borders in QStandardItem

    I didn't do much coding with data aware widgets and Model/View with Qt.
    But as much as I know, the delegates are responsible for the visual representation of the item, so it makes sense to me that you need a delegate that will change the default visual representation.
    http://doc.trolltech.com/4.7/model-v...ogramming.html

    Maybe some more heavy users of Model/View can offer a better way.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. widget borders v4.2
    By dacrawler in forum Newbie
    Replies: 0
    Last Post: 24th January 2011, 19:08
  2. QGroupBox borders
    By onurozcelik in forum Qt Programming
    Replies: 0
    Last Post: 27th August 2010, 06:24
  3. Disable QGraphicsTextItem borders
    By RyogaH in forum Qt Programming
    Replies: 1
    Last Post: 28th July 2010, 13:06
  4. Groupbox has no borders ?
    By vieraci in forum Qt Programming
    Replies: 12
    Last Post: 30th April 2009, 12:46
  5. Replies: 2
    Last Post: 31st May 2006, 21:52

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.