//! [0] TextFinder::TextFinder(QWidget *parent) : QWidget(parent) { QWidget *formWidget = loadUiFile(); //! [1] ui_findButton = findChild<QPushButton*>("findButton"); ui_textEdit = findChild<QTextEdit*>("textEdit"); ui_lineEdit = findChild<QLineEdit*>("lineEdit"); //! [0] //! [1] //! [2] QMetaObject::connectSlotsByName(this); //! [2] //! [3a] loadTextFile(); //! [3a] //! [3b] QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(formWidget); setLayout(layout); //! [3b] //! [3c] setWindowTitle(tr("Text Finder")); isFirstTime = true; }
// FrmLocalizar_cls(const QString &title, QWidget *parent=0); FrmCompras_cls::FrmCompras_cls(const QString &title,QWidget *parent) : QDialog(parent) { QWidget *formWidget = loadUiFile(); ui_edt_idpro = qFindChild<QLineEdit*>(this, "edt_idpro"); ui_edt_qtdpro = qFindChild<QLineEdit*>(this, "edt_qtdpro"); ui_edt_nomepro = qFindChild<QLineEdit*>(this, "edt_nomepro"); ui_edt_vlrpro = qFindChild<QLineEdit*>(this, "edt_vlrpro"); ui_edt_vlrtotal = qFindChild<QLineEdit*>(this, "edt_vlrtotal"); ui_btn_calc = qFindChild<QPushButton*>(this, "btn_calc"); ui_btn_sair = qFindChild<QPushButton*>(this, "btn_sair"); ui_btn_ok = qFindChild<QPushButton*>(this, "btn_ok"); ui_btn_localizar = qFindChild<QPushButton*>(this, "btn_localizar"); ui_btn_comprar = qFindChild<QPushButton*>(this, "btn_comprar"); QMetaObject::connectSlotsByName(this); // connect( ui_edt_vlrpro, SIGNAL(textChanged(const QString&)), this, SLOT(keyPressEvent(QKeyEvent *event)) ); connect( ui_edt_vlrpro, SIGNAL(textChanged(const QString&)), this, SLOT(ui_edt_vlrpro_setText(const QString&)) ); connect( ui_edt_vlrtotal, SIGNAL(textChanged(const QString&)), this, SLOT(setText(const QString&)) ); ui_edt_vlrpro->setAlignment(Qt::AlignRight); ui_edt_vlrtotal->setAlignment(Qt::AlignRight); ui_edt_vlrpro->setMaxLength(9); local=0; //QVBoxLayout *layout = new QVBoxLayout; QGridLayout *layout = new QGridLayout; layout->setHorizontalSpacing (0); layout->setSizeConstraint(QLayout::SetMinAndMaxSize); setConfigDB(); layout->addWidget(formWidget); setLayout(layout); setWindowTitle(title); }
// FrmLocalizar_cls(const QString &title, QWidget *parent=0); FrmVendas_cls::FrmVendas_cls(const QString &title,QWidget *parent) : QDialog(parent) { QWidget *formWidget = loadUiFile(); ui_grd_vendas = qFindChild<QTableWidget*>(this, "grd_vendas"); ui_btn_findPro = qFindChild<QPushButton*>(this, "btn_findPro"); ui_btn_incluir = qFindChild<QPushButton*>(this, "btn_incluir"); ui_btn_excluir = qFindChild<QPushButton*>(this, "btn_excluir"); ui_edt_idpro = qFindChild<QLineEdit*>(this, "edt_idpro"); ui_edt_nomepro = qFindChild<QLineEdit*>(this, "edt_nomepro"); ui_edt_qtd = qFindChild<QLineEdit*>(this, "edt_qtd"); ui_edt_vlr_unit = qFindChild<QLineEdit*>(this, "edt_vlr_unit"); ui_edt_vlr_total = qFindChild<QLineEdit*>(this, "edt_vlr_total"); /*ui_edt_idpro = qFindChild<QLineEdit*>(this, "edt_idpro"); ui_edt_qtdpro = qFindChild<QLineEdit*>(this, "edt_qtdpro"); ui_edt_nomepro = qFindChild<QLineEdit*>(this, "edt_nomepro"); ui_edt_vlrpro = qFindChild<QLineEdit*>(this, "edt_vlrpro"); ui_edt_vlrtotal = qFindChild<QLineEdit*>(this, "edt_vlrtotal"); ui_btn_sair = qFindChild<QPushButton*>(this, "btn_sair"); ui_btn_ok = qFindChild<QPushButton*>(this, "btn_ok"); ui_btn_localizar = qFindChild<QPushButton*>(this, "btn_localizar"); ui_btn_comprar = qFindChild<QPushButton*>(this, "btn_comprar");*/ QMetaObject::connectSlotsByName(this); connect( ui_edt_idpro, SIGNAL(returnPressed ()), this, SLOT(on_btn_findPro_clicked() )); // ui_grd_localizar->horizontalHeader()->setResizeMode(1, QHeaderView::Stretch); // ui_grd_vendas ->horizontalHeader()->setResizeMode(1, QHeaderView::Stretch); //QVBoxLayout *layout = new QVBoxLayout; QGridLayout *layout = new QGridLayout; layout->setHorizontalSpacing (0); layout->setSizeConstraint(QLayout::SetMinAndMaxSize); layout->addWidget(formWidget); setLayout(layout); setWindowTitle(title); if (title=="Vendas"){ limpa_grd_vnd(); } ui_grd_vendas ->horizontalHeader()->setResizeMode(1, QHeaderView::Stretch); }