Skip to content
Permalink
Browse files

Don't add preview to native file dialogs, use C++11 with Qt5

  • Loading branch information...
rkfg committed Jan 2, 2017
1 parent b368c83 commit bc0324a6d32999b26c5ab44cad0f1fe482b50d7b
@@ -1,5 +1,8 @@
#CONFIG += release
QT += network
greaterThan(QT_MAJOR_VERSION, 4) {
CONFIG += c++11
}
isEmpty(PSISDK) {
include(../../psiplugin.pri)
} else {
@@ -4,6 +4,11 @@
PreviewFileDialog::PreviewFileDialog(QWidget* parent, const QString & caption, const QString & directory,
const QString & filter, int previewWidth) :
QFileDialog(parent, caption, directory, filter) {
QGridLayout *layout = (QGridLayout*) this->layout();
if (!layout) {
// this QFileDialog is a native one (Windows/KDE/...) and doesn't need to be extended with preview
return;
}
setObjectName("PreviewFileDialog");
QVBoxLayout* box = new QVBoxLayout();

@@ -18,10 +23,7 @@ PreviewFileDialog::PreviewFileDialog(QWidget* parent, const QString & caption, c
box->addStretch();

// add to QFileDialog layout
{
QGridLayout *layout = (QGridLayout*) this->layout();
layout->addLayout(box, 1, 3, 3, 1);
}
layout->addLayout(box, 1, 3, 3, 1);
connect(this, SIGNAL(currentChanged(const QString&)), this, SLOT(onCurrentChanged(const QString&)));
}

0 comments on commit bc0324a

Please sign in to comment.
You can’t perform that action at this time.