Now wxTimePickerCtrl is a native control under wxQt
This commit is contained in:
parent
e20d8ba2cc
commit
032fc66cea
9 changed files with 219 additions and 13 deletions
|
|
@ -70,10 +70,14 @@ inline QColor wxQtConvertColour(const wxColour &colour)
|
|||
|
||||
class WXDLLIMPEXP_FWD_BASE wxDateTime;
|
||||
class QDate;
|
||||
class QTime;
|
||||
|
||||
wxDateTime wxQtConvertDate(const QDate& date);
|
||||
QDate wxQtConvertDate(const wxDateTime& date);
|
||||
|
||||
wxDateTime wxQtConvertTime(const QTime& Time);
|
||||
QTime wxQtConvertTime(const wxDateTime& time);
|
||||
|
||||
#endif // wxUSE_DATETIME
|
||||
|
||||
inline wxSize wxQtConvertSize( const QSize &size )
|
||||
|
|
|
|||
57
include/wx/qt/timectrl.h
Normal file
57
include/wx/qt/timectrl.h
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/qt/timectrl.h
|
||||
// Purpose: wxTimePickerCtrl for Qt.
|
||||
// Author: Ali Kettab
|
||||
// Created: 2023-10-13
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_QT_TIMECTRL_H_
|
||||
#define _WX_QT_TIMECTRL_H_
|
||||
|
||||
class QTimeEdit;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTimePickerCtrl
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_ADV wxTimePickerCtrl : public wxTimePickerCtrlBase
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxTimePickerCtrl() { }
|
||||
|
||||
wxTimePickerCtrl(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& dt = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTP_DEFAULT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTimePickerCtrlNameStr)
|
||||
{
|
||||
Create(parent, id, dt, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxDateTime& dt = wxDefaultDateTime,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTP_DEFAULT,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTimePickerCtrlNameStr);
|
||||
|
||||
// Override this one to add time-specific (and date-ignoring) checks.
|
||||
virtual void SetValue(const wxDateTime& dt) override;
|
||||
virtual wxDateTime GetValue() const override;
|
||||
|
||||
virtual QWidget *GetHandle() const override;
|
||||
|
||||
private:
|
||||
QTimeEdit* m_qtTimeEdit;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl);
|
||||
};
|
||||
|
||||
#endif // _WX_QT_TIMECTRL_H_
|
||||
|
|
@ -101,6 +101,10 @@ typedef wxTimePickerCtrlCommonBase<wxDateTimePickerCtrl> wxTimePickerCtrlBase;
|
|||
#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__)
|
||||
#include "wx/osx/timectrl.h"
|
||||
|
||||
#define wxHAS_NATIVE_TIMEPICKERCTRL
|
||||
#elif defined(__WXQT__) && !defined(__WXUNIVERSAL__)
|
||||
#include "wx/qt/timectrl.h"
|
||||
|
||||
#define wxHAS_NATIVE_TIMEPICKERCTRL
|
||||
#else
|
||||
#include "wx/generic/timectrl.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue