Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-9534

setSizePolicy ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • 4.7.0
    • 4.5.2
    • None
    • Linux: Ubuntu 9.10; GNU/Linux 2.6.31-20-generic x86_64
      Mac OS X: 10.5, Darwin 9.8.0 i386

    Description

      The use of setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Fixed) in a QDialog subclass is ignored - the dialog may be resized both horizontally and vertically - on Linux, but is correctly honored -the dialog may only be resized horizontally - on Mac OS X. The content of the QDialog widget uses setLayout with a QGridLayout.

      Example:

      Dialog.hh -

      #include <QDialog>

      class Dialog : public QDialog
      {
      Q_OBJECT
      public:
      Dialog (QWidget *parent = 0);
      };

      Dialog.cc -

      #include "Dialog.hh"
      #include <QGridLayout>
      #include <QLabel>

      Dialog::Dialog (QWidget *parent) : QDialog (parent)
      {
      setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Fixed);

      QGridLayout *layout = new QGridLayout;
      layout->addWidget (new QLabel ("Dialog"), 0, 0);
      setLayout (layout);
      }

      main.cc -

      #include <QApplication>
      #include "Dialog.hh"

      int main (int argc, char** argv)
      {
      QApplication application (argc, argv);
      Dialog *dialog = new Dialog;
      dialog->show ();
      return application.exec ();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            monsen Marius Bugge Monsen
            castalia Bradford Castalia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes