Results 1 to 11 of 11

Thread: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

  1. #1
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Lightbulb Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    I would like to implement the Qt's SideBar into my project:

    Did My Homework:

    I tried searching the web, found the following websites (only 2 results after many search):

    1- How do I add a QTCreator-like left bar to my program?

    I found fancytabwidget from DimanNe's answer, but I couldn't get the class to work.

    2- http://groups.google.com/group/qt-pr...b3bfe654&pli=1

    Still unanswered.

    Could someone help me out ?

    Thanks !

    MyQt : QtSDK (Latest) with QtSources 4.7.4 and QtCreator Sources.
    Last edited by xboxnissan; 20th December 2011 at 03:20.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    why dont to take a look into QtCreator source code?

  3. #3
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    Quote Originally Posted by nish View Post
    why dont to take a look into QtCreator source code?
    I allready tried, and need help using it : "Simplest way - is to use QtCreator's library libCorePlugin.so and corresponding includes (FancyTabBar.h) from QtCreator's srcs" => That is DimanNe's answer.

    I said the following : "but I couldn't get the class to work.".

    I'd need someone to assist me to make it work

  4. #4
    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: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    you don't need the library. Just copy the source and header file to your app. (plus additional files as they are included.)

  5. #5
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    Quote Originally Posted by Lykurg View Post
    you don't need the library. Just copy the source and header file to your app. (plus additional files as they are included.)
    I can't Lykurg, because I found that ModeManager and FancyTabWidget is with the MainWindow (QtCreator's main) in a namespace. I tried to modify the source, so that I could send a reference of my QMainWindow, but it failed, saying that 'undifened reference to struct ModeManager' or same result for FancyTabWidget.

    Could you help me out?

  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: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    in fancytabwidget.h: only Qt dependencies.
    in fancytabwidget.cpp: only utils/stylehelper.h (no dependencies except Qt) and utils/styledbar.h. And here also no further dependencies. So what is the problem?

    Simple include these sex files in your project and use them. They take normal QWidget's as parameters.

    What you have to do - if you like - is to remove the namespace.

  7. The following user says thank you to Lykurg for this useful post:

    xboxnissan (21st December 2011)

  8. #7
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    Quote Originally Posted by Lykurg View Post
    in fancytabwidget.h: only Qt dependencies.
    in fancytabwidget.cpp: only utils/stylehelper.h (no dependencies except Qt) and utils/styledbar.h. And here also no further dependencies. So what is the problem?

    Simple include these sex files in your project and use them. They take normal QWidget's as parameters.

    What you have to do - if you like - is to remove the namespace.
    I did what you said, got the following errors:
    Qt Code:
    1. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:103: undefined reference to `_imp___ZN5Utils11StyleHelper15sidebarFontSizeEv'
    2. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:280: undefined reference to `_imp___ZN5Utils11StyleHelper15sidebarFontSizeEv'
    3. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:287: undefined reference to `_imp___ZN5Utils11StyleHelper14panelTextColorEb'
    4. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:289: undefined reference to `_imp___ZN5Utils11StyleHelper14panelTextColorEb'
    5. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:312: undefined reference to `_imp___ZN5Utils11StyleHelper18drawIconWithShadowERK5QIconRK5QRectP8QPainterNS1_4ModeEiRK6QColorRK6QPoint'
    6. debug/fancytabwidget.o: In function `FancyTabWidget':
    7. C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:389: undefined reference to `_imp___ZN5Utils9StyledBarC1EP7QWidget'
    8. C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:389: undefined reference to `_imp___ZN5Utils9StyledBarC1EP7QWidget'
    9. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:465: undefined reference to `_imp___ZN5Utils11StyleHelper16verticalGradientEP8QPainterRK5QRectS5_b'
    10. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:466: undefined reference to `_imp___ZN5Utils11StyleHelper11borderColorEb'
    11. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/utils/stylehelper.h:64: undefined reference to `_imp___ZN5Utils11StyleHelper20m_requestedBaseColorE'
    12. debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:368: undefined reference to `_imp___ZN5Utils11StyleHelper12setBaseColorERK6QColor'
    13. collect2: ld returned 1 exit status
    14. mingw32-make.exe[1]: *** [debug\Test.exe] Error 1
    15. mingw32-make.exe: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 


    Added after 23 minutes:


    Quote Originally Posted by Lykurg View Post
    in fancytabwidget.h: only Qt dependencies.
    in fancytabwidget.cpp: only utils/stylehelper.h (no dependencies except Qt) and utils/styledbar.h. And here also no further dependencies. So what is the problem?

    Simple include these sex files in your project and use them. They take normal QWidget's as parameters.

    What you have to do - if you like - is to remove the namespace.
    Check out this https://rapidshare.com/files/2075171030/Test.zip
    Last edited by xboxnissan; 20th December 2011 at 19:43.

  9. #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: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    If you have trouble with that, then - no offense - you should be more concerned with your coding abilities than the gui of your application! Off course you have to extend SOURCES and HEADERS with the includes from fancytabwidget.cpp and so on since you don't use it as a library.

  10. #9
    Join Date
    Sep 2011
    Posts
    11
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    Quote Originally Posted by Lykurg View Post
    If you have trouble with that, then - no offense - you should be more concerned with your coding abilities than the gui of your application! Off course you have to extend SOURCES and HEADERS with the includes from fancytabwidget.cpp and so on since you don't use it as a library.
    Yes I decided to step foward in looking into C++ sources, and sucessfuly made it work. Still, I had to modify the background, because the two rgb returned black colors, resulting a black background for the fancytabwidget. I had to look into the StyleHelper Class to make my own Gradient, and sucessfuly made it work. Thanks Lykurg

  11. #10
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    The user can change the background color at any time. See: FancyColorButton::mousePressEvent()

  12. #11
    Join Date
    Dec 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)

    I've implemented the sidebar using empty widget and several pushbuttons styled with stylesheets:

    • layout widget vertically
    • all buttons are checkable
    • last button is disabled and its vertical size policy is set to 'expanding' and it contains no text (its role is to decorate sidebar)
    • implemented rules for QPushButton normal state and 'hover', 'checked', 'disabled' pseudo-classes


    And there is no icons in sidebar...

    Also I created function to make sure that only one of the buttons is checked:

    Qt Code:
    1. void MainWindow::switchButtons(QPushButton *b) { // called when button is clicked
    2. if (b != selectedButton) {
    3. selectedButton->setChecked(false);
    4. selectedButton = b;
    5. }
    6. else
    7. selectedButton->setChecked(true);
    8. }
    To copy to clipboard, switch view to plain text mode 

    x.png
    Last edited by rasufa; 28th December 2011 at 08:03.

Similar Threads

  1. Replies: 3
    Last Post: 15th November 2011, 11:42
  2. Build two programs in one project in creator
    By Gunnar in forum Qt Tools
    Replies: 1
    Last Post: 13th October 2010, 09:52
  3. Replies: 1
    Last Post: 28th February 2010, 07:31
  4. Duplicate a Qt Creator project
    By Coises in forum Newbie
    Replies: 5
    Last Post: 20th December 2009, 20:38
  5. Qt Creator project view
    By JohnToddSr in forum Qt Tools
    Replies: 3
    Last Post: 4th May 2009, 08:48

Tags for this Thread

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.