Results 1 to 6 of 6

Thread: status bar dispaly

  1. #1
    Join Date
    Jan 2009
    Posts
    33
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Post status bar dispaly

    hi,
    i would like to display coordinates of window at right side corner of statusbar as mouse is moving.
    but
    [qt code:]statusBar()->showMesssage()[/QUOTE]

    showmessage() will take only string. how can i pass float values.
    please give me hint so that i'll be thankful to u.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: status bar dispaly

    Have a look at QString::arg. One of the overloaded method takes double as argument .
    Hope this helps

  3. #3
    Join Date
    Jan 2009
    Posts
    33
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: status bar dispaly

    thnks for ur's quick reply, it's working now. but it is dispalying at leftcorner. i want ar right bottom corner.

  4. #4
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    507
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: status bar dispaly

    Hi, try to set LayoutDirection to RightToLeft:
    Qt Code:
    1. statusBar ()->setLayoutDirection (Qt::RightToLeft);
    To copy to clipboard, switch view to plain text mode 

    Ginsengelf

    addition: you could also add a spacer widget and a label with your text.

  5. #5
    Join Date
    Jan 2009
    Posts
    33
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Post Re: status bar dispaly

    i want to display only latitude and longitude at right corner . some status at middle and some at left corner. could u please send me sample code how to add widgets like labels to status bar.

  6. #6
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: status bar dispaly

    You can make your own widget in Designer and then put it in the status bar. I don't know if it's the best way but I did so in my app and its working good :]
    I made my widget as on the attached first picture, and then added it in code like this:
    Qt Code:
    1. statusWidget = new StatusWidget(this);
    2. statusBar()->addPermanentWidget(statusWidget);
    To copy to clipboard, switch view to plain text mode 
    in my main window, and it looks like on the second picture.
    Attached Images Attached Images
    Last edited by faldzip; 30th January 2009 at 17:35.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

Similar Threads

  1. "Normal" Status Bar Message doesn't look right...
    By codeslicer in forum Qt Programming
    Replies: 4
    Last Post: 19th January 2009, 23:50
  2. Change cursor & status during Drag & Drop
    By ronlongo in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2008, 16:56
  3. Updating Status Bar Icon
    By nbkhwjm in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2008, 04:22
  4. Status Bar in a SUB WINDOW.
    By Cutey in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2008, 07:42
  5. Status Widget
    By user_mail07 in forum Qt Programming
    Replies: 4
    Last Post: 18th June 2008, 07:51

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.