examples/sql/drilldown/informationwindow.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    81     connect(descriptionEditor, SIGNAL(textChanged()),
    81     connect(descriptionEditor, SIGNAL(textChanged()),
    82             this, SLOT(enableButtons()));
    82             this, SLOT(enableButtons()));
    83     connect(imageFileEditor, SIGNAL(currentIndexChanged(int)),
    83     connect(imageFileEditor, SIGNAL(currentIndexChanged(int)),
    84             this, SLOT(enableButtons()));
    84             this, SLOT(enableButtons()));
    85 
    85 
    86     QGridLayout *layout = new QGridLayout;
    86     QFormLayout *formLayout = new QFormLayout;
    87     layout->addWidget(locationLabel, 0, 0, Qt::AlignLeft | Qt::AlignTop);
    87     formLayout->addRow(locationLabel, locationText);
    88     layout->addWidget(countryLabel, 1, 0, Qt::AlignLeft | Qt::AlignTop);
    88     formLayout->addRow(countryLabel, countryText);
    89     layout->addWidget(imageFileLabel, 2, 0, Qt::AlignLeft | Qt::AlignTop);
    89     formLayout->addRow(imageFileLabel, imageFileEditor);
    90     layout->addWidget(descriptionLabel, 3, 0, Qt::AlignLeft | Qt::AlignTop);
    90     formLayout->addRow(descriptionLabel, descriptionEditor);
    91     layout->addWidget(locationText, 0, 1);
    91 
    92     layout->addWidget(countryText, 1, 1);
    92     QVBoxLayout *layout = new QVBoxLayout;
    93     layout->addWidget(imageFileEditor, 2, 1);
    93     layout->addLayout(formLayout);
    94     layout->addWidget(descriptionEditor, 3, 1);
    94     layout->addWidget(buttonBox);
    95     layout->addWidget(buttonBox, 4, 0, 1, 2);
       
    96     setLayout(layout);
    95     setLayout(layout);
    97 
    96 
    98     locationId = id;
    97     locationId = id;
    99     displayedImage = imageFileEditor->currentText();
    98     displayedImage = imageFileEditor->currentText();
   100 
    99 
   101     setWindowFlags(Qt::Window);
   100     setWindowFlags(Qt::Window);
   102     enableButtons(false);
   101     enableButtons(false);
   103     setWindowTitle(tr("Office: %1").arg(locationText->text()));
   102     setWindowTitle(tr("Office: %1").arg(locationText->text()));
   104 #ifndef Q_OS_SYMBIAN
       
   105     resize(320, sizeHint().height());
       
   106 #endif
       
   107 }
   103 }
   108 //! [4]
   104 //! [4]
   109 
   105 
   110 //! [5]
   106 //! [5]
   111 int InformationWindow::id()
   107 int InformationWindow::id()
   152     connect(revertButton, SIGNAL(clicked()), this, SLOT(revert()));
   148     connect(revertButton, SIGNAL(clicked()), this, SLOT(revert()));
   153     connect(submitButton, SIGNAL(clicked()), this, SLOT(submit()));
   149     connect(submitButton, SIGNAL(clicked()), this, SLOT(submit()));
   154 //! [8]
   150 //! [8]
   155 
   151 
   156 //! [9]
   152 //! [9]
   157     buttonBox = new QDialogButtonBox;
   153     buttonBox = new QDialogButtonBox(this);
   158     buttonBox->addButton(submitButton, QDialogButtonBox::ResetRole);
   154     buttonBox->addButton(submitButton, QDialogButtonBox::AcceptRole);
   159     buttonBox->addButton(revertButton, QDialogButtonBox::ResetRole);
   155     buttonBox->addButton(revertButton, QDialogButtonBox::ResetRole);
   160     buttonBox->addButton(closeButton, QDialogButtonBox::RejectRole);
   156     buttonBox->addButton(closeButton, QDialogButtonBox::RejectRole);
   161 }
   157 }
   162 //! [9]
   158 //! [9]
   163 
   159