Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Mac right-to-left issue
QtWS25 Last Chance

Mac right-to-left issue

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gtabares
    wrote on last edited by
    #1

    All,

    I'm seeing some different behavior on Mac OSX (when compared to Windows) with regards to right-to-left layout direction. It's hard to believe the following is broken:

    @
    #include <QtGui/QComboBox>
    #include <QtGui/QApplication>
    #include <QtGui/QVBoxLayout>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    a.setLayoutDirection(Qt::RightToLeft);

    QWidget w;
    QVBoxLayout *layout = new QVBoxLayout();
    QComboBox *comboBox = new QComboBox(&w);
            
    layout->addWidget(comboBox);
            
    w.setLayout(layout);
    w.setMinimumWidth(300);
    w.show();
    
    comboBox->insertItems(0, QStringList()
                      << "This is a test"
                    << "This is a second test");
    
    return a.exec&#40;&#41;;
    

    }
    @

    On Windows, the layout is right-to-left as expected. On Mac, the layout is still left-to-right. I'm using Qt 4.7.2 (Cocoa) on OSX Lion (10.7.2). I'm compiling with XCode 4.2.1. Is anyone seeing anything similar?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      fluca1978
      wrote on last edited by
      #2

      Does it change anything forcing the layout direction even on the vertical layout too? Could be a problem of layout parenting? Just thinking...

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        Is this the cause of your problem?

        bq. From "QWidget docs/layoutDirection":http://doc.qt.nokia.com/4.7/qwidget.html#layoutDirection-prop:
        This method no longer affects text layout direction since Qt 4.7.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gtabares
          wrote on last edited by
          #4

          [quote author="fluca1978" date="1322756049"]Does it change anything forcing the layout direction even on the vertical layout too? Could be a problem of layout parenting? Just thinking...[/quote]

          It doesn't change anything...

          [quote author="Volker" date="1322756776"]Is this the cause of your problem?

          bq. From "QWidget docs/layoutDirection":http://doc.qt.nokia.com/4.7/qwidget.html#layoutDirection-prop:
          This method no longer affects text layout direction since Qt 4.7.[/quote]

          I think that's for widgets. However in my code I'm setting it for the entire application. Not sure if there is a difference.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            The application setting is just the default for the widgets.

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved