Results 1 to 9 of 9

Thread: Best way to create Windows Explorer type UI

  1. #1
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Best way to create Windows Explorer type UI

    The app is used to display images as they come in from a camera. Similar to Windows Explorer, the main display area will be everything but the left hand side widget. Also this app is also a SDI apps, like Windows Explorer. The main area will simply display the current image. All the controls will be in a side panel on the left.

    Also similar to Windows Explorer, there needs to be a splitter between these two primary widgets which allow the left panel to be expanded and contracted, within reason, there does need to be a min and max on it.

    The QDockWidget doesn't seem to be the solution because the left panel should NOT have any of the docking/moving/hiding/title features of a docking control.

    What is the best way to implement this UI?

    Sam

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Best way to create Windows Explorer type UI

    I would go with QSpliter in the middle. place your gui elements on the form, layout it in 2 groups, left and right. Next select these 2 groups and press "layout .. in splitter", and do again layout on the form. I assume You are using QDesigner/QtCreator.
    From what You write I think splitter is in Your example good way to go, it has no features like i.e. dockwidget but you can save last state of it etc.
    Ofcourse you can change size of Your "left group", and when user pas minimal size point it simply hide "left group".
    I write here left and right group because You can place whatever You want in it, splitter is basically a container.
    Regards

  3. #3
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Best way to create Windows Explorer type UI

    Thank you for the reply.

    I am using Visual Studio 2008 and Qt Designer. When I look through the list of containers in Qt Designer, I see the following:

    Group Box
    Scroll Area
    Tool Box
    Tab Widget
    Frame
    Widget
    MdiArea
    Dock Widget

    I am *NOT* seeing a splitter. Looking through all the other sections, the closest thing I find to being part of a splitter is the Vertical Line (Line object) or Vertical Scroll Bar (QScrollBar).

    I don't see any QSplitter, what exactly is it called in the QT Designer?

    Sam

  4. #4
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Best way to create Windows Explorer type UI

    I see it now, I missed it the first two times I read through your post. Thank you!

  5. #5
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Best way to create Windows Explorer type UI

    I am not seeing any options within the Qt Designer to make a vertical bar appear so that it is clear that it can be resized. How does one go about doing that?

    Sam

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Best way to create Windows Explorer type UI

    This depends on your style. Each style paints the handler in a different way. If you want to customize, then you have to subclass your style and use QStyle::CE_Splitter in QStyle::drawControl().

  7. #7
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Best way to create Windows Explorer type UI

    Lykurg,

    Well, I don't rightfully know which style I am using. I am simply using the default and I am on Windows 7. Is there another style I could use that does indicate some how there is a splitter present? If so, how do I go about using it?

  8. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Best way to create Windows Explorer type UI

    You can set a style via QApplication::setStyle(). Right now I also remember that you can do it easier with style sheets. See "Customizing QSplitter" in the docs. It is
    css Code:
    1. QSplitter::handle {}
    To copy to clipboard, switch view to plain text mode 
    you can use.

  9. #9
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Best way to create Windows Explorer type UI

    Or You can also Use QStyle, without subclassing, and use something like this:
    Qt Code:
    1. QSplitter::handle:horizontal {
    2. width: 1px;
    3. }
    4.  
    5. QSplitter::handle:vertical {
    6. height: 10px;
    7. }
    8.  
    9. QSplitter::handle {
    10. image: url(:/resources/myQSpliterVImg.png);
    11. }
    To copy to clipboard, switch view to plain text mode 

    Edit. posted to late ...

Similar Threads

  1. Create windows explorer with QListView QTreeView
    By dima in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2012, 10:12
  2. how to create internet explorer toolbar using Qt?
    By live_07 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2011, 07:28
  3. Replies: 1
    Last Post: 15th August 2009, 11:23
  4. Replies: 7
    Last Post: 17th April 2006, 13:57
  5. windows explorer
    By denis in forum Newbie
    Replies: 1
    Last Post: 25th January 2006, 05:59

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.