PDA

View Full Version : Qtabbar on the main window title bar like in crome, firefox 4 or IE9



wambagilles
4th May 2011, 07:23
hi every body, iam writing a small web browser, and i will like to know how to implement a qtabwidget with the tab bar right in the window title bar, just like google chrome firefox4 or IE9, please help!

nish
4th May 2011, 12:03
for windows Vista and above you can use the new windows api, but ofcourse it will not work on WinXP and linux. Other way is to write your own custom skin by using Qt::FrameLessWindowHint

wambagilles
5th May 2011, 06:36
i can guess going into that windows api will not be as chocolate like Qt is! i also saw your class, http://qt-apps.org/content/show.php?content=138161 , is it possible using it to implement such a title bar, or similar?

nish
5th May 2011, 06:51
yes it is possible.. use the setContentsMargin() function of the class to increase the area at the top, and do some custom painting to look like a title bar. I may implement a full function like that in future :)

wambagilles
5th May 2011, 11:58
i did not find the setContentsMargin() function in the header file of your file, also this is what i did



int main(int argc, char *argv[])
{

QApplication app(argc, argv);

MainPage *fenetre=new MainPage;
NcFramelessHelper *frame = new NcFramelessHelper;
frame->activateOn( fenetre );
return app.exec();
}

what i get is just a windows tha i cannot resize, with the default windows7 title bar, i event compiled the example, same thing, no customm title bar as i can see in the prview here http://qt-apps.org/CONTENT/content-m2/m138161-2.png
please help! iam also impatient that you implement that function

nish
6th May 2011, 10:46
i did not find the setContentsMargin() function in the header file of your file,
yes.. i half implemented that function and later did not got time time to complete it. As i have not worked on it for quite some time
now, i was under impression that its already there.





MainPage *fenetre=new MainPage;
NcFramelessHelper *frame = new NcFramelessHelper;
frame->activateOn( fenetre );

what i get is just a windows tha i cannot resize, with the default windows7 title bar, i event compiled the example, same thing, no customm title bar as i can see in the prview here http://qt-apps.org/CONTENT/content-m2/m138161-2.png
please help! iam also impatient that you implement that function

it should work, i have just tested it on ubuntu. I dont have Win7 rite now so i can test it on that. But i had tested it on Windows before and it seem to work well.
What does the status functions like widgetMovable() returns? And do you set any other flags inside your MainPage?

wambagilles
8th May 2011, 18:52
sorry which functions?

anyway, i am waiting impatiently that you implement that!