This file is indexed.

/usr/include/qgis/qgsdatetimeedit.h is in libqgis-dev 2.18.17+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/***************************************************************************
    qgsdatetimeedit.h
     --------------------------------------
    Date                 : 08.2014
    Copyright            : (C) 2014 Denis Rouzaud
    Email                : denis.rouzaud@gmail.com
 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef QGSDATETIMEEDIT_H
#define QGSDATETIMEEDIT_H

#include <QDateTimeEdit>

class QToolButton;
class QLineEdit;

/** \ingroup gui
 * @brief The QgsDateTimeEdit class is a QDateTimeEdit with the capability of setting/reading null date/times.
 */
class GUI_EXPORT QgsDateTimeEdit : public QDateTimeEdit
{
    Q_OBJECT
    Q_PROPERTY( bool allowNull READ allowNull WRITE setAllowNull )

  public:
    explicit QgsDateTimeEdit( QWidget *parent = nullptr );

    //! determines if the widget allows setting null date/time.
    void setAllowNull( bool allowNull );
    bool allowNull() const {return mAllowNull;}

    /**
     * @brief setDateTime set the date time in the widget and handles null date times.
     * @note since QDateTimeEdit::setDateTime() is not virtual, setDateTime must be called for QgsDateTimeEdit.
     */
    void setDateTime( const QDateTime &dateTime );

    /**
     * @brief dateTime returns the date time which can eventually be a null date/time
     * @note since QDateTimeEdit::dateTime() is not virtual, dateTime must be called for QgsDateTimeEdit.
     */
    QDateTime dateTime() const;

    //! Set the current date as NULL
    //! @note if the widget is not configured to accept NULL dates, this will have no effect
    virtual void clear() override;

    /** Resets the widget to show no value (ie, an "unknown" state).
     * @note added in QGIS 2.16
     */
    void setEmpty();

  protected:
    virtual void resizeEvent( QResizeEvent* event ) override;
    void mousePressEvent( QMouseEvent*event ) override;
    void focusOutEvent( QFocusEvent *event ) override;
    void wheelEvent( QWheelEvent *event ) override;
    void showEvent( QShowEvent *event ) override;


  private slots:
    void changed( const QDateTime &dateTime );

  private:
    int spinButtonWidth() const;
    int frameWidth() const;

    void displayNull( bool updateCalendar = false );

    //! reset the value to current date time
    void resetBeforeChange( int delta );

    bool mAllowNull;
    bool mIsNull;
    bool mIsEmpty;

    QLineEdit* mNullLabel;
    QToolButton* mClearButton;
    QString mOriginalStyleSheet;
};

#endif // QGSDATETIMEEDIT_H