Results 1 to 4 of 4

Thread: Photoshop designed element to Qt

  1. #1
    Join Date
    Jan 2013
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Photoshop designed element to Qt

    Hi all,

    I've got a question concerning a design i made in photoshop and how I should best convert/implement it into Qt Creator.
    First, the photoshop design:


    (the icons are placeholders)

    What you see is a little list box with save games ordered on date.
    The dates (darkgrey boxes) are foldable with all it's contents below (light grey box).
    The developer currently uses a treeview-element as a placeholder and works as intended. Only problem is that the Treeview doesn't look remotely similar.

    We're now at the point that I should implement the design into Qt, but I don't really have an idea how to start with this list-box. Can I continue using the Treeview and style it till it looks the same? Or do i need other elements like a hierarchy of frames (which won't make the DEV team happy).

    Any tips on how i could start?


    TL;DR version ( i guess ):
    The Level 1 Items (including branch) need a different styling then the Level 2 (sub)items (including branch). How
    Last edited by Nyte; 6th February 2013 at 12:51.

  2. #2
    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: Photoshop designed element to Qt

    Quote Originally Posted by Nyte View Post
    Can I continue using the Treeview and style it till it looks the same?
    I don't think you can do that with just styling. But you can subclass QTreeView and provide your own painting and a custom delegate for items.

    Or do i need other elements like a hierarchy of frames (which won't make the DEV team happy).
    No, that's not a good idea.

    An alternative is to use QtQuick where you can implement the whole tree in less than 5 minutes once you learn the technology.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2013
    Posts
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Photoshop designed element to Qt

    I don't think you can do that with just styling. But you can subclass QTreeView and provide your own painting and a custom delegate for items.
    I'm not sure what the limitations are with styling a Treeview.
    Basically, what i need to know is how (with a stylesheet, i'm not a dev) i can style the first item, and how i can style the subitems. If i know the selectors (something that in my experience with Qt so far is sometimes really hard to find out, even with the documents), I can experiment a bit.


    -edit-

    So far i know you have to use

    QTreeWidget:item{ .. } to change the style of ALL the items in the Treeview, but the first level item and the 2nd level item needs to be different. Also, i need to draw the whole item, including the icon area....
    Last edited by Nyte; 6th February 2013 at 11:38.

  4. #4
    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: Photoshop designed element to Qt

    Quote Originally Posted by Nyte View Post
    I'm not sure what the limitations are with styling a Treeview.
    Basically, what i need to know is how (with a stylesheet, i'm not a dev) i can style the first item, and how i can style the subitems. If i know the selectors (something that in my experience with Qt so far is sometimes really hard to find out, even with the documents), I can experiment a bit.


    -edit-

    So far i know you have to use

    QTreeWidget:item{ .. } to change the style of ALL the items in the Treeview, but the first level item and the 2nd level item needs to be different. Also, i need to draw the whole item, including the icon area....
    The whole stylesheet reference is here: Qt Style Sheets Reference. If something is not there then it won't work.

    In general, as I said, what you want to do cannot be done without touching source code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 9
    Last Post: 23rd April 2012, 13:53
  2. Replies: 0
    Last Post: 21st February 2012, 02:45
  3. Photoshop filter plug-in
    By ExxEnos in forum Qt Programming
    Replies: 19
    Last Post: 13th April 2010, 15:17
  4. Tool bar as photoshop, where only one is selected.
    By ricardo in forum Qt Programming
    Replies: 6
    Last Post: 23rd June 2009, 15:09
  5. Photoshop-like palettes.
    By Valeriy in forum Qt Programming
    Replies: 4
    Last Post: 1st September 2008, 21:37

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.