You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
85 lines
2.5 KiB
85 lines
2.5 KiB
15 years ago
|
/**********************************************************************
|
||
|
** Copyright (C) 2000 Trolltech AS. All rights reserved.
|
||
|
**
|
||
14 years ago
|
** This file is part of TQt Designer.
|
||
15 years ago
|
**
|
||
|
** This file may be distributed and/or modified under the terms of the
|
||
|
** GNU General Public License version 2 as published by the Free Software
|
||
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||
|
** packaging of this file.
|
||
|
**
|
||
14 years ago
|
** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
|
||
|
** licenses may use this file in accordance with the TQt Commercial License
|
||
15 years ago
|
** Agreement provided with the Software.
|
||
|
**
|
||
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||
|
**
|
||
|
** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
||
|
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
||
14 years ago
|
** information about TQt Commercial License Agreements.
|
||
15 years ago
|
**
|
||
|
** Contact info@trolltech.com if any conditions of this licensing are
|
||
|
** not clear to you.
|
||
|
**
|
||
|
**********************************************************************/
|
||
|
|
||
|
#include "defs.h"
|
||
|
|
||
15 years ago
|
int size_type_to_int( TQSizePolicy::SizeType t )
|
||
15 years ago
|
{
|
||
15 years ago
|
if ( t == TQSizePolicy::Fixed )
|
||
15 years ago
|
return 0;
|
||
15 years ago
|
if ( t == TQSizePolicy::Minimum )
|
||
15 years ago
|
return 1;
|
||
15 years ago
|
if ( t == TQSizePolicy::Maximum )
|
||
15 years ago
|
return 2;
|
||
15 years ago
|
if ( t == TQSizePolicy::Preferred )
|
||
15 years ago
|
return 3;
|
||
15 years ago
|
if ( t == TQSizePolicy::MinimumExpanding )
|
||
15 years ago
|
return 4;
|
||
15 years ago
|
if ( t == TQSizePolicy::Expanding )
|
||
15 years ago
|
return 5;
|
||
15 years ago
|
if ( t == TQSizePolicy::Ignored )
|
||
15 years ago
|
return 6;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
15 years ago
|
TQString size_type_to_string( TQSizePolicy::SizeType t )
|
||
15 years ago
|
{
|
||
15 years ago
|
if ( t == TQSizePolicy::Fixed )
|
||
15 years ago
|
return "Fixed";
|
||
15 years ago
|
if ( t == TQSizePolicy::Minimum )
|
||
15 years ago
|
return "Minimum";
|
||
15 years ago
|
if ( t == TQSizePolicy::Maximum )
|
||
15 years ago
|
return "Maximum";
|
||
15 years ago
|
if ( t == TQSizePolicy::Preferred )
|
||
15 years ago
|
return "Preferred";
|
||
15 years ago
|
if ( t == TQSizePolicy::MinimumExpanding )
|
||
15 years ago
|
return "MinimumExpanding";
|
||
15 years ago
|
if ( t == TQSizePolicy::Expanding )
|
||
15 years ago
|
return "Expanding";
|
||
15 years ago
|
if ( t == TQSizePolicy::Ignored )
|
||
15 years ago
|
return "Ignored";
|
||
15 years ago
|
return TQString();
|
||
15 years ago
|
}
|
||
|
|
||
15 years ago
|
TQSizePolicy::SizeType int_to_size_type( int i )
|
||
15 years ago
|
{
|
||
|
if ( i == 0 )
|
||
15 years ago
|
return TQSizePolicy::Fixed;
|
||
15 years ago
|
if ( i == 1 )
|
||
15 years ago
|
return TQSizePolicy::Minimum;
|
||
15 years ago
|
if ( i == 2 )
|
||
15 years ago
|
return TQSizePolicy::Maximum;
|
||
15 years ago
|
if ( i == 3 )
|
||
15 years ago
|
return TQSizePolicy::Preferred;
|
||
15 years ago
|
if ( i == 4 )
|
||
15 years ago
|
return TQSizePolicy::MinimumExpanding;
|
||
15 years ago
|
if ( i == 5 )
|
||
15 years ago
|
return TQSizePolicy::Expanding;
|
||
15 years ago
|
if ( i == 6 )
|
||
15 years ago
|
return TQSizePolicy::Ignored;
|
||
|
return TQSizePolicy::Preferred;
|
||
15 years ago
|
}
|