Results 1 to 7 of 7

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

  1. #1
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    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!

  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: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    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

  3. #3
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    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?

  4. #4
    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: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    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

  5. #5
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    i did not find the setContentsMargin() function in the header file of your file, also this is what i did

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3.  
    4. QApplication app(argc, argv);
    5.  
    6. MainPage *fenetre=new MainPage;
    7. NcFramelessHelper *frame = new NcFramelessHelper;
    8. frame->activateOn( fenetre );
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 

    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
    please help! iam also impatient that you implement that function

  6. #6
    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: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    Quote Originally Posted by wambagilles View Post
    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.

    Qt Code:
    1. MainPage *fenetre=new MainPage;
    2. NcFramelessHelper *frame = new NcFramelessHelper;
    3. frame->activateOn( fenetre );
    To copy to clipboard, switch view to plain text mode 
    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
    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?

  7. #7
    Join Date
    Feb 2011
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qtabbar on the main window title bar like in crome, firefox 4 or IE9

    sorry which functions?

    anyway, i am waiting impatiently that you implement that!

Similar Threads

  1. Replies: 2
    Last Post: 17th February 2011, 13:30
  2. Replies: 3
    Last Post: 23rd December 2010, 07:55
  3. Replies: 9
    Last Post: 16th May 2010, 17:21
  4. Replies: 11
    Last Post: 11th August 2008, 10:14
  5. Replies: 15
    Last Post: 23rd March 2007, 17:16

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.