KPageWidgetItem* InlineWidgetView::resolvePage ( QWidget* content ) { KPageWidgetModel *m = static_cast<KPageWidgetModel*>(model()); int count = m->rowCount(); for (int i=0; i < count; i++) { KPageWidgetItem* it = m->item(m->index(i, 0)); Q_ASSERT(it); if (it->widget() == content) return it; } return 0; }
FormProgressDialog::FormProgressDialog(const QString& caption, const QString& labelText) : KPageDialog(), d(new Private) { d->gotCanceled = false; d->time.start(); setCaption(caption); KDialog::setButtons(KDialog::Ok|KDialog::Cancel); setFaceType(KPageDialog::Plain); enableButton(KDialog::Ok, false); //setWindowModality(Qt::WindowModal); setModal(false); //true); setMinimumWidth(540); setMinimumHeight(400); QWidget* widget = new QWidget( mainWidget() ); KPageWidgetItem* item = KPageDialog::addPage(widget, QString()); item->setHeader(labelText); //item->setIcon( KIcon(iconname) ); widget = item->widget(); QVBoxLayout* layout = new QVBoxLayout(widget); layout->setMargin(0); widget->setLayout(layout); d->browser = new QTextBrowser(this); d->browser->setHtml(labelText); layout->addWidget(d->browser); d->bar = new QProgressBar(this); //d->bar->setFormat("%v"); d->bar->setVisible(false); layout->addWidget(d->bar); setSizePolicy( QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding) ); show(); qApp->processEvents(); }