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.
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
why dont to take a look into QtCreator source code?
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
Quote:
Originally Posted by
nish
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
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.)
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
Quote:
Originally Posted by
Lykurg
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?
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.
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
Quote:
Originally Posted by
Lykurg
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:
Code:
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:103: undefined reference to `_imp___ZN5Utils11StyleHelper15sidebarFontSizeEv'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:280: undefined reference to `_imp___ZN5Utils11StyleHelper15sidebarFontSizeEv'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:287: undefined reference to `_imp___ZN5Utils11StyleHelper14panelTextColorEb'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:289: undefined reference to `_imp___ZN5Utils11StyleHelper14panelTextColorEb'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:312: undefined reference to `_imp___ZN5Utils11StyleHelper18drawIconWithShadowERK5QIconRK5QRectP8QPainterNS1_4ModeEiRK6QColorRK6QPoint'
debug/fancytabwidget.o: In function `FancyTabWidget':
C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:389: undefined reference to `_imp___ZN5Utils9StyledBarC1EP7QWidget'
C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:389: undefined reference to `_imp___ZN5Utils9StyledBarC1EP7QWidget'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:465: undefined reference to `_imp___ZN5Utils11StyleHelper16verticalGradientEP8QPainterRK5QRectS5_b'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:466: undefined reference to `_imp___ZN5Utils11StyleHelper11borderColorEb'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/utils/stylehelper.h:64: undefined reference to `_imp___ZN5Utils11StyleHelper20m_requestedBaseColorE'
debug/fancytabwidget.o:C:\Users\[MyComp]\Desktop\MainProject\Test\Test/fancytabwidget.cpp:368: undefined reference to `_imp___ZN5Utils11StyleHelper12setBaseColorERK6QColor'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [debug\Test.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
Added after 23 minutes:
Quote:
Originally Posted by
Lykurg
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
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.
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
Quote:
Originally Posted by
Lykurg
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 :)
Re: Qt Project to implement Qt Creator's SideBar (FrancyTabBar)
The user can change the background color at any time. See: FancyColorButton::mousePressEvent()
1 Attachment(s)
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:
Code:
void MainWindow
::switchButtons(QPushButton *b
) { // called when button is clicked if (b != selectedButton) {
selectedButton->setChecked(false);
selectedButton = b;
}
else
selectedButton->setChecked(true);
}
Attachment 7207