Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]how is the sidebar in Qt Creator created?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]how is the sidebar in Qt Creator created?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 4.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dhott
    wrote on last edited by
    #1

    I'm not asking for code, just what was used. I'm wondering how the Welcome, Edit, Design, etc. sidebar was created. Was it default widgets, or was something subclassed to create that layout?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #2

      Well I have used QTabWidget to make a selection bar type thing like is in Qt Creator. It doesn't look like the Qt Creator one but it could easily be changed to look like it.

      I used a class derived from QTabWidget, and basically used style sheets for 99% of the looks.

      Here is a pic of the bar:

      !http://www.ambershark.com/snap.png(snapshot)!

      You wouldn't even really need to subclass QTabWidget if you didn't want to. I found it was easier since I had view control stuff I had to deal with as well as icon rotation for the side bar look, etc.

      The style sheets I used are:

      @
      #if (defined Q_OS_WIN32 || defined Q_OS_MAC)
      setStyleSheet("QTabWidget#PackageWidgetBar::pane {"
      "border: 1px solid #fbdf93;"
      "}"

                    "QTabWidget#PackageWidgetBar::tab-bar {"
                    "alignment: center;"
                    "}" 
      
                    "QTabBar#PackageBar::tab {"
                    "background: qlineargradient(x1: 1, y1: 0, x2: 0, y2: 0,"
                    "stop: 0 #e2e2e2, stop: 0.4 #dbdbdb,"
                    "stop: 0.5 #d1d1d1, stop: 1.0 #fefefe);"
                    "padding-bottom: 8px;"
                    "padding-top: -4px;"
                    "min-width: 38px;"
                    "}" 
      
                    "QTabBar#PackageBar::tab::selected, QTabBar::tab::hover {"
                    "background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
                    "stop: 0 #fceabb, stop: 0.4 #fccd4d,"
                    "stop: 0.5 #f8b500, stop: 1.0 #fbdf93);"
                    "}" 
                    );  
      

      #else
      setStyleSheet("QTabWidget#PackageWidgetBar::pane {"
      "border: 1px solid #fbdf93;"
      "}"

                    "QTabWidget#PackageWidgetBar::tab-bar {"
                    "alignment: center;"
                    "}" 
      
                    "QTabBar#PackageBar::tab {"
                    "background: qlineargradient(x1: 1, y1: 0, x2: 0, y2: 0,"
                    "stop: 0 #e2e2e2, stop: 0.4 #dbdbdb,"
                    "stop: 0.5 #d1d1d1, stop: 1.0 #fefefe);"
                    "}" 
      
                    "QTabBar#PackageBar::tab::selected, QTabBar::tab::hover {"
                    "background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,"
                    "stop: 0 #fceabb, stop: 0.4 #fccd4d,"
                    "stop: 0.5 #f8b500, stop: 1.0 #fbdf93);"
                    "}" 
                    );  
      

      #endif
      @

      Due to rendering issues in different OSes (linux/osx/windows/etc) I had to do some different css for each. OSX and Windows played well together with this one (for a change), but linux needed some custom stuff.

      Anyway, hope that gives you some ideas for your own stuff.

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andreyc
        wrote on last edited by
        #3

        It is not standard widget.
        Take a look on QtCreator sources and search for FancyActionBar class if I'm not mistaken.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dhott
          wrote on last edited by
          #4

          Wow, not sure how I missed TabWidget. Thank you very much for the quick response, that should take care of my needs perfectly.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ambershark
            wrote on last edited by
            #5

            No problem. :) Make sure to mark the post as [SOLVED] for future people.

            My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dhott
              wrote on last edited by
              #6

              [quote author="andreyc" date="1405038351"]It is not standard widget.
              Take a look on QtCreator sources and search for FancyActionBar class if I'm not mistaken.[/quote]

              will do, thank you for the great response as well.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved