void ImageMetaInfoDialog::setMetaInfo(ImageMetaInfoModel* model, const QStringList& list) { if (model) { d->mModel.reset(new PreferredImageMetaInfoModel(model, list)); connect(d->mModel.get(), SIGNAL(preferredMetaInfoKeyListChanged(QStringList)), this, SIGNAL(preferredMetaInfoKeyListChanged(QStringList))); } else { d->mModel.reset(0); } d->mTreeView->setModel(d->mModel.get()); d->mTreeView->header()->resizeSection(0, sizeHint().width() / 2 - KDialog::marginHint() * 2); }
void ImageMetaInfoDialog::setMetaInfo(ImageMetaInfoModel* model, const QStringList& list) { if (model) { d->mModel.reset(new PreferredImageMetaInfoModel(model, list)); connect(d->mModel.get(), SIGNAL(preferredMetaInfoKeyListChanged(QStringList)), this, SIGNAL(preferredMetaInfoKeyListChanged(QStringList))); } else { d->mModel.reset(0); } d->mTreeView->setModel(d->mModel.get()); const int marginSize = QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin); d->mTreeView->header()->resizeSection(0, sizeHint().width() / 2 - marginSize * 2); }
void FullScreenContent::showImageMetaInfoDialog() { if (!mImageMetaInfoDialog) { mImageMetaInfoDialog = new ImageMetaInfoDialog(mInformationLabel); // Do not let the fullscreen theme propagate to this dialog for now, // it's already quite complicated to create a theme mImageMetaInfoDialog->setStyle(QApplication::style()); mImageMetaInfoDialog->setAttribute(Qt::WA_DeleteOnClose, true); connect(mImageMetaInfoDialog, SIGNAL(preferredMetaInfoKeyListChanged(QStringList)), SLOT(slotPreferredMetaInfoKeyListChanged(QStringList))); connect(mImageMetaInfoDialog, SIGNAL(destroyed()), SLOT(slotImageMetaInfoDialogClosed())); } if (mCurrentDocument) { mImageMetaInfoDialog->setMetaInfo(mCurrentDocument->metaInfo(), GwenviewConfig::fullScreenPreferredMetaInfoKeyList()); } mAutoHideContainer->setAutoHidingEnabled(false); mImageMetaInfoDialog->show(); }