Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
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 ();
}