busquedaperiodo.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tomeu Borras Riera                              *
00003  *   tborras@conetxia.com                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include "busquedaperiodo.h"
00022 
00023 
00025 
00028 QString BusquedaPeriodo::periodo() {
00029   _depura("BusquedaPeriodo::periodo", 0);
00030   _depura("END BusquedaPeriodo::periodo", 0);
00031     return m_valores[currentIndex()];
00032 }
00033 
00034 
00036 
00039 QString BusquedaPeriodo::valorCampo() {
00040   _depura("BusquedaPeriodo::valorCampo", 0);
00041   _depura("END BusquedaPeriodo::valorCampo", 0);
00042     return m_valores[currentIndex()];
00043 }
00044 
00045 
00047 
00050 void BusquedaPeriodo::s_activated(int index) {
00051     _depura("Activado el combo box.", 0);
00052     if (index > 0) {
00053         emit(valueChanged(m_valores[currentIndex()]));
00054     } else {
00055         emit(valueChanged(""));
00056     } // end if
00057 }
00058 
00059 
00061 
00064 BusquedaPeriodo::BusquedaPeriodo(QWidget *parent) : QComboBox2(parent) {
00065     _depura("BusquedaPeriodo::BusquedaPeriodo", 0);
00066     m_textos[0] = tr("Semanal");
00067     m_textos[1] = tr("Quincenal");
00068     m_textos[2] = tr("Mensual");
00069     m_textos[3] = tr("Trimestral");
00070     m_textos[4] = tr("Semestral");
00071     m_textos[5] = tr("Anual");
00072     m_textos[6] = tr("Bienal");
00073     m_textos[7] = "";
00074 
00075     m_valores[0] = "@ 7 days";
00076     m_valores[1] = "@ 15 days";
00077     m_valores[2] = "@ 1 mon";
00078     m_valores[3] = "@ 3 mons";
00079     m_valores[4] = "@ 6 mons";
00080     m_valores[5] = "@ 1 year";
00081     m_valores[6] = "@ 2 year";
00082     m_valores[7] = "";
00083 
00084     int i = 0;
00085     while (m_textos[i] != "") {
00087         insertItem(this->count() + 1, m_textos[i]);
00088         i++;
00089     } // end while
00090 
00091     connect(this, SIGNAL(activated(int)), this, SLOT(s_activated(int)));
00092     _depura("END BusquedaPeriodo::BusquedaPeriodo", 0);
00093 }
00094 
00095 
00097 
00099 BusquedaPeriodo::~BusquedaPeriodo() {
00100   _depura("BusquedaPeriodo::~BusquedaPeriodo", 0);
00101   _depura("END BusquedaPeriodo::~BusquedaPeriodo", 0);
00102 }
00103 
00104 
00106 
00109 void BusquedaPeriodo::setperiodo(QString periodo) {
00110     _depura("BusquedaPeriodo::setperiodo", 0);
00111     int i = 0;
00112     while (m_valores[i] != periodo && m_valores[i] != "") {
00113 //      _depura(m_valores[i]+" "+periodo, 2);
00114         i++;
00115     } // end while
00116     if (m_valores[i] != "")
00117         setCurrentIndex(i);
00118     else
00119         setCurrentIndex(0);
00120     _depura("END BusquedaPeriodo::setperiodo", 0);
00121 }
00122 
00123 
00125 
00128 void BusquedaPeriodo::setValorCampo(QString periodo) {
00129   _depura("BusquedaPeriodo::setValorCampo", 0);
00130         setperiodo(periodo);
00131   _depura("END BusquedaPeriodo::setValorCampo", 0);
00132 }
00133 
00134 
00135 
00136 

Generated on Sat Dec 15 00:01:20 2007 for BulmaGes by  doxygen 1.5.1