Results 1 to 5 of 5

Thread: Floating toolbar window title

  1. #1
    Join Date
    Aug 2009
    Posts
    30
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Floating toolbar window title

    Hello,

    Is there a way to show a toolbar's window title when it's floating?

    I couldn't see anything in the QToolbar properties of the properties window, or any of the other properties for that matter.

    Thanks,

    PUK

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating toolbar window title

    You can set window title by passing the title in QToolBar constructor?
    Qt Code:
    1. QToolBar::QToolBar ( const QString & title, QWidget * parent = 0 )
    To copy to clipboard, switch view to plain text mode 
    This should be visible when toolbar is floating.

  3. #3
    Join Date
    Aug 2009
    Posts
    30
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Floating toolbar window title

    Thanks for the reply. I think I need to give a little more info...

    I'm using Designer and have a main window application that contains a mainToolBar (of type QToolBar). In the properties window, I set the windowTitle of this toolbar to something.

    I'm not constructing the toolbar explicitly in my code. The generated ui_mainwindow.h does this, and in the retranslateUi() method it calls setWindowTitle with the text I specified in the properties window.

    At runtime when the toolbar is dragged away from it's dock position to be made floatable, it floats but there is no title to it.

    Is it possible to make this title show?

    Thanks,

    PUK

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Floating toolbar window title

    I dont think so, that there is any title thing in QToolBar.
    You can work around like this:
    Create a widget, set the window flag Qt::Tool. Add your items to this widget.
    Add this widget to toolbar by addWidget.

  5. #5
    Join Date
    Aug 2009
    Posts
    30
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Floating toolbar window title

    I did try your suggestion. It didn't work. Title didn't show.

    I'm not sure there's a trivial solution to the behaviour I want (toolbars to work as they do in utlook, Visual Studio, etc: when docked no title bar, when undocked there's a title bar).

    For now I'm going to live with the toolbars as-is. It's not a big deal really. I just figured that the behaviour described above was fairly standard and it would just work as desired or have an option to make it do that.

    I appreciate a Windows convention/standard is not necessarily a cross-platform convention and this may the reason its not doable (or doesn't appear to me to be) out of the box in Qt.

    In the meantime, if anyone else knows of a quick way to do this, I'd like to hear it.

    Thanks,

    PUK

Similar Threads

  1. Replies: 4
    Last Post: 23rd December 2008, 20:41
  2. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  3. Window title bar and "X" button
    By markcole in forum Qt Programming
    Replies: 3
    Last Post: 20th December 2007, 20:58
  4. Remove window title
    By marcel in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2007, 05:06
  5. Remove Window title bar
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 12:56

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.