root/trunk/qt4-gui/src/widgets/infofield.h

Revision 5849, 1.8 kB (checked in by flynd, 13 months ago)

Changed timestamps in info dialog to not cut year. Also moved the datetime handling to infofield class.

Line 
1/*
2 * This file is part of Licq, an instant messaging client for UNIX.
3 * Copyright (C) 1999-2006 Licq developers
4 *
5 * Licq 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 * Licq 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 Licq; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 */
19
20#ifndef INFOFIELD_H
21#define INFOFIELD_H
22
23#include <QColor>
24#include <QLineEdit>
25
26
27namespace LicqQtGui
28{
29
30/**
31 * LineEdit widget with a few convenience functions added
32 */
33class InfoField : public QLineEdit
34{
35  Q_OBJECT
36
37public:
38  /**
39   * Constructor
40   *
41   * @param ro Initial state of read only property
42   * @param parent Parent widget
43   */
44  InfoField(bool ro = false, QWidget* parent = NULL);
45
46  /**
47   * Set read only property
48   *
49   * @param ro False to make widget editable
50   */
51  void setReadOnly(bool ro);
52
53  /**
54   * Set field text from char string
55   *
56   * @param data New value for field
57   */
58  void setText(const char* data);
59
60  /**
61   * Set field text from numeral
62   *
63   * @param data New value for field
64   */
65  void setText(unsigned long data);
66
67  // Don't hide base setText which takes QString
68  using QLineEdit::setText;
69
70  /**
71   * Set field to a timestamp
72   *
73   * @param timestamp Timestamp in UTC to set
74   */
75  void setDateTime(uint timestamp);
76
77private:
78  QColor myBaseRo;
79  QColor myBaseRw;
80};
81
82} // namespace LicqQtGui
83
84#endif
Note: See TracBrowser for help on using the browser.