pizzaentryimpl.cpp

来自「linux下运用QT进行编程的示例」· C++ 代码 · 共 37 行

CPP
37
字号
#include <qcheckbox.h>#include <qdatetime.h>#include <qmessagebox.h>#include "PizzaEntryImpl.h"/*  *  Constructs a PizzaEntryImpl which is a child of 'parent', with the  *  name 'name' and widget flags set to 'f'  * *  The dialog will by default be modeless, unless you set 'modal' to *  TRUE to construct a modal dialog. */PizzaEntryImpl::PizzaEntryImpl( QWidget* parent,  const char* name, bool modal, WFlags fl )    : PizzaEntry( parent, name, modal, fl ){  QDate date = QDate::currentDate();  if( date.dayOfWeek() == 2 ) CheckBox5->setChecked( true );  else CheckBox5->setChecked( false );}/*   *  Destroys the object and frees any allocated resources */PizzaEntryImpl::~PizzaEntryImpl(){    // no need to delete child widgets, Qt does it all for us}/*  * public slot */void PizzaEntryImpl::sendOrder(){  QMessageBox::information( this, "Pizza Entry Information","Your order has been sent. Your pizza will arrive in 30-45 minutes", QMessageBox::Ok );}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?