Results 1 to 19 of 19

Thread: HTML and QStandardItem ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Posts
    139
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 59 Times in 52 Posts

    Default Re: HTML and QStandardItem ?

    It turns out that I left out the last (supposedly optional) argument to drawControl. The line should be:
    Qt Code:
    1. options.widget->style()->drawControl(QStyle::CE_ItemViewItem, &options, painter, options.widget);
    To copy to clipboard, switch view to plain text mode 
    which fixes everything on my computer.

  2. #2
    Join Date
    Jul 2009
    Posts
    125
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    16

    Default Re: HTML and QStandardItem ?

    ROFL! xD
    This was sooooo annoying :/ I'm really glad that we finally made it =P.
    That code was dryving me insane uff...

    One more thing, could you tell me if style sheet works for you? I'm trying to draw the items with custom background his way:

    Qt Code:
    1. QTreeView::item:hover {
    2. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
    3. }
    4.  
    5. QTreeView::item:selected:active{
    6. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
    7. }
    8.  
    9. QTreeView::item:selected:!active {
    10. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf);
    11. }
    To copy to clipboard, switch view to plain text mode 

    But I get the default blue/dark-blue when selected or mouse-over.

  3. #3
    Join Date
    Jul 2009
    Posts
    139
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    13
    Thanked 59 Times in 52 Posts

    Default Re: HTML and QStandardItem ?

    I get the following, which is not the default on my machine.
    Attached Images Attached Images

  4. #4
    Join Date
    Jul 2009
    Posts
    125
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    16

    Default Re: HTML and QStandardItem ?

    Yeah, I get that too! But I have my own stylesheet and it's not like that, so... What's the problem? Why is not rendering my stylesheet?

  5. #5
    Join Date
    Jul 2009
    Posts
    125
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    16

    Default Re: HTML and QStandardItem ?

    Ok, nm... I'm stupid. It was actually showing the stylesheet, but I had the stylesheet almost exactly the same colors as the default (+I'm a little bit daltonic) ...

    Really thanks I can finally rip xD

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
  •  
Qt is a trademark of The Qt Company.