Results 1 to 3 of 3

Thread: Aligning message displayed on QStatusbar

  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Aligning message displayed on QStatusbar

    Hi all,

    I want to display message on QStatusBar with right alignment.

    is there any way to do this?

    Thanks in advance.

    regards,
    ~Sanjay
    Last edited by sanjayshelke; 20th November 2008 at 07:32. Reason: spelling error

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Aligning message displayed on QStatusbar

    you can try to do something like this
    Qt Code:
    1. Test::Test(QWidget *parent)
    2. : QMainWindow(parent)
    3. {
    4. QLabel *stat = new QLabel("Hello");
    5. stat->setAlignment(Qt::AlignRight);
    6.  
    7. statusBar()->addWidget(stat, 1);
    8. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. The following 2 users say thank you to spirit for this useful post:

    cic (18th July 2013), sanjayshelke (20th November 2008)

  4. #3
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Smile Re: Aligning message displayed on QStatusbar

    Hi,

    Its working.

    Thank u sir.

    regards,
    ~Sanjay

Similar Threads

  1. treewidget and a message system
    By alisami in forum Qt Programming
    Replies: 7
    Last Post: 27th July 2008, 18:05

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.