1、dialog.h
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QRadioButton>
#include <QPushButton>
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
~Dialog();
private:
enum ESinceEpochType {
EN_Secs = 0,
EN_MSecs,
};
void init();
void initLayout();
private slots:
void onConvertToSinceEpoch();
void onConvertToDtime();
private:
QLabel *m_lblYear = nullptr;
QLineEdit *m_edtYear = nullptr;
QLabel *m_lblMonth = nullptr;
QLineEdit *m_edtMonth = nullptr;
QLabel *m_lblDay = nullptr;
QLineEdit *m_edtDay = nullptr;
QLabel *m_lblHour = nullptr;
QLineEdit *m_edtHour = nullptr;
QLabel *m_lblMinute = nullptr;
QLineEdit *m_edtMinute = nullptr;
QLabel *m_lblSecond = nullptr;
QLineEdit *m_edtSecond = nullptr;
ESinceEpochType m_eSinceEpochType = EN_Secs;
QRadioButton *m_rbtnSecsSinceEpoch = nullptr;
QRadioButton *m_rbtnMSecsSinceEpoch = nullptr;
QPushButton *m_btnConvert = nullptr;
QLabel *m_lblTimestamp = nullptr;
QLineEdit *m_edtTimestamp = nullptr;
QPushButton *m_btn
Qt时间转换对话框

最低0.47元/天 解锁文章
5949

被折叠的 条评论
为什么被折叠?



