namespace Ui { class qtPMK;}class qtPMK : public QMainWindow{ Q_OBJECTpublic: explicit qtPMK(QWidget *parent = 0); ~qtPMK(); Q_INVOKABLE void GoInSystem(QString,QString); Q_INVOKABLE QVariantMap GetCategoryes(); Q_INVOKABLE int GetWidth(){ return QApplication::desktop()->width(); } Q_INVOKABLE int GetHeight(){ return QApplication::desktop()->height(); } Q_INVOKABLE void createOrder();private slots: void authorized(); void showMessageBox(const Error &e); void on_lineEditAuthEnterPassword_returnPressed();private: enum { AUTH, CULINARY, SHOP, SYSTEM }; DriverKkm *kassa; QRegExpValidator *passwordValidator; QDeclarativeView *ui; Config config; Cashier cashier; OrderSaver currentOrder; QList<Order*> orders; Module::DB::Abstract *db; Module::Auth::LoginPassword *loginPasswordAuth; QObject *Root;//корневой элемент QML модели void installValidators(); void installData(); void installSignalSlots();};
DriverKkm::DriverKkm(QString port,KKM type,QByteArray passwordBytes){ switch(type) { case FPRINT5200: kkm = new Fprint5200(port,passwordBytes);break; }}
QString kkm_port = config.getOption<QString>("kkm_port");kassa = new DriverKkm(kkm_port,FPRINT5200);
qtPMK::qtPMK{QString kkm_port = config.getOption<QString>("kkm_port");kassa = new DriverKkm(kkm_port,FPRINT5200);// либо можно вообще так kassa = new DriverKkm("/dev/ttyUSB0",FPRINT5200);}
class Test{Test(){}Test(QString str){QDebug()<<str;}};qtPMK::qtPMK{Test *testOut = new Test("Hello");}