00001 /* 00002 Copyright (C) 2008 Tim Fechtner < urwald at users dot sourceforge dot net > 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public License as 00006 published by the Free Software Foundation; either version 2 of 00007 the License or (at your option) version 3 or any later version 00008 accepted by the membership of KDE e.V. (or its successor approved 00009 by the membership of KDE e.V.), which shall act as a proxy 00010 defined in Section 14 of version 3 of the license. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #include "propertyvalue.h" 00022 00023 PropertyValue::PropertyValue() 00024 { 00025 type = unset; 00026 formatedValueAlignment = (Qt::AlignLeft | Qt::AlignVCenter); 00027 } 00028 00029 PropertyValue::PropertyValue (const PropertyValue &value) 00030 { 00031 helper_copyFromHere(value); 00032 } 00033 00034 PropertyValue::~PropertyValue () 00035 { 00036 } 00037 00038 PropertyValue & PropertyValue::operator=(const PropertyValue & value) 00039 { 00040 helper_copyFromHere(value); 00041 return *this; 00042 } 00043 00044 bool PropertyValue::operator==(const PropertyValue value) const 00045 { 00046 return ((internalValue == value.internalValue) && 00047 // see Qt documentation for comparation of QVariant... 00048 (type == value.type) && 00049 (formatedValue == value.formatedValue) && 00050 (formatedValueAlignment == value.formatedValueAlignment) && 00051 (toolTip == value.toolTip) && 00052 (whatsThis == value.whatsThis)); 00053 } 00054 00055 bool PropertyValue::operator!=(const PropertyValue value) const 00056 { 00057 return (!(*this == value)); 00058 } 00059 00060 PropertyValue::operator QString() const 00061 { 00062 return formatedValue; 00063 } 00064 00065 void PropertyValue::helper_copyFromHere (const PropertyValue &value) 00066 { 00067 internalValue = value.internalValue; 00068 type = value.type; 00069 formatedValue = value.formatedValue; 00070 formatedValueAlignment = value.formatedValueAlignment; 00071 toolTip = value.toolTip; 00072 whatsThis = value.whatsThis; 00073 }