Results 1 to 7 of 7

Thread: The direction of the showing of windows.

  1. #1
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default The direction of the showing of windows.

    I would like to know which language the application uses this moment (I mean to which directed: left-to-right or right-to-left). Is there a way to know it?
    Last edited by Mad Max; 12th January 2007 at 06:48. Reason: spelling error

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: The direction of the showing of windows.

    try:
    QApplication::layoutDirection() to get the enumeration describing this. Check the Class Documentation for QApplication for more on this.

  3. #3
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The direction of the showing of windows.

    Unfortunately this is for Qt4 only, but I need a solution for Qt3. Thanks for the answer none the less.

  4. #4
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The direction of the showing of windows.

    I found a solution. Perhaps it is slightly awry, but none the less it's works .
    Qt Code:
    1. QLocale locale( getenv("LANG") );
    2. QTranslator * translator = new QTranslator( this );
    3. translator->load( QString("qt_%1.qm").arg( locale.name().section('_', 0, 0) ), "." );
    4. qApp->installTranslator( translator );
    5. QApplication::setReverseLayout( QApplication::tr( "QT_LAYOUT_DIRECTION" ) == "RTL" );
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    258
    Thanks
    22
    Thanked 19 Times in 16 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: The direction of the showing of windows.

    Qt3 seems to offer this:
    QApplication::reverseLayout()

    http://doc.trolltech.com/3.3/qapplic...#reverseLayout


    cheers
    momesana

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The direction of the showing of windows.


  7. #7
    Join Date
    Jan 2006
    Location
    Russia
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: The direction of the showing of windows.

    This method indicates current state. Unfortunately Qt does not set this flag automatically and each application should install the flag itself. The condition for the installation can be found only in the file of localization, reading a tag "QT_LAYOUT_DIRECTION". If you will look at qapplication.cpp then you can to see, how Trolls done this trouble themselves. They solved it by the same way .

Similar Threads

  1. converting unix exe to windows binary
    By deekayt in forum General Programming
    Replies: 2
    Last Post: 17th September 2006, 01:00
  2. Experience using KDevelop with Cygwin under windows
    By high_flyer in forum General Discussion
    Replies: 4
    Last Post: 11th September 2006, 16:50
  3. qt and mingw can not run on windows 98?
    By evewei in forum Installation and Deployment
    Replies: 4
    Last Post: 26th June 2006, 09:22
  4. MDI windows without QWorkspace
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 16th June 2006, 17:15
  5. Qt and windows vista
    By munna in forum General Discussion
    Replies: 8
    Last Post: 11th January 2006, 22:33

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.