Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Mac right-to-left issue

    General and Desktop
    3
    5
    1827
    Loading More Posts
    • 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
      gtabares last edited by

      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 Reply Quote 0
      • F
        fluca1978 last edited by

        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 Reply Quote 0
        • G
          goetz last edited by

          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 Reply Quote 0
          • G
            gtabares last edited by

            [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 Reply Quote 0
            • G
              goetz last edited by

              The application setting is just the default for the widgets.

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

              1 Reply Last reply Reply Quote 0
              • First post
                Last post