Subversion Repositories Scribus

Rev

Rev 13809 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
13809 pierre 1
/***************************************************************************
2
 *   Copyright (C) 2009 by Pierre Marchand                                 *
3
 *   pierre@oep-h.com                                                      *
4
 *                                                                         *
5
 *   This program is free software; you can redistribute it and/or modify  *
6
 *   it under the terms of the GNU General Public License as published by  *
7
 *   the Free Software Foundation; either version 2 of the License, or     *
8
 *   (at your option) any later version.                                   *
9
 *                                                                         *
10
 *   This program is distributed in the hope that it will be useful,       *
11
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13
 *   GNU General Public License for more details.                          *
14
 *                                                                         *
15
 *   You should have received a copy of the GNU General Public License     *
16
 *   along with this program; if not, write to the                         *
17
 *   Free Software Foundation, Inc.,                                       *
18122 mrdocs 18
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
13809 pierre 19
 ***************************************************************************/
20
 
21
#include "openpaletteview.h"
22
#include "openpalettemodel.h"
23
 
24
OpenPaletteView::OpenPaletteView(QWidget * parent)
25
                :QTreeView(parent)
26
{
27
        setModel(new OpenPaletteModel(parent));
28
        connect(model(), SIGNAL(layoutChanged()), this, SLOT(adjustView()));
29
}
30
 
31
OpenPaletteView::~OpenPaletteView()
32
{
33
        delete model();
34
}
35
 
36
void OpenPaletteView::adjustView()
37
{
38
        int cCount(model()->columnCount());
39
        for(int i(0); i < cCount; ++i)
40
                resizeColumnToContents(i);
41
}