Subversion Repositories Scribus

Rev

Rev 10244 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10242 subik 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
#include <QPushButton>
8
 
9
#include "scfilewidget.h"
10
 
11
 
12
ScFileWidget::ScFileWidget(QWidget * parent)
13
        : QFileDialog(parent, Qt::Widget)
14
{
15
        setSizeGripEnabled(false);
16
        setModal(false);
17
        setViewMode(QFileDialog::List);
18
        setWindowFlags(Qt::Widget);
19
 
20
        QList<QPushButton *> b = findChildren<QPushButton *>("QPushButton");
21
        QListIterator<QPushButton *> i(b);
22
        while (i.hasNext())
23
                i.next()->setVisible(false);
24
 
25
        setMinimumSize(QSize(480, 310));
26
        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
27
}
28
 
29
QString ScFileWidget::selectedFile()
30
{
31
        QStringList l(selectedFiles());
32
        if (l.count() == 0)
33
                return QString();
34
        return l.at(0);
35
}