-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
executable file
·81 lines (70 loc) · 2.26 KB
/
Copy pathmainwindow.cpp
File metadata and controls
executable file
·81 lines (70 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
model = new tempTableModel;
ui->tableView->setModel(model);
ui->tableView->resizeColumnsToContents();
ui->tableView->setColumnWidth(0, 70);
ui->tableView->setColumnWidth(1, 400);
ui->tableView->setColumnWidth(2, 100);
ui->tableView->setColumnWidth(3, 100);
ui->tableView->setColumnWidth(4, 100);
ui->tableView->setColumnWidth(5, 150);
ui->tableView->setItemDelegate(new vendorDelegate);
ui->tableView->verticalHeader()->setDefaultSectionSize(50);
QObject::connect(ui->addPriceButton, SIGNAL(clicked()), this, SLOT(SLOTaddPrice()));
QObject::connect(ui->getClipboardButton, SIGNAL(clicked()), model, SLOT(SLOTgetItems()));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::SLOTaddPrice()
{
QString fileName;
fileName = QFileDialog::getOpenFileName(this, QString::fromLocal8Bit("Укажите файл с прайсом"),"","csv (*.csv)");
if(fileName != ""){
emit SIGNALaddPrice(fileName);
}
}
void MainWindow::SLOTgetArts()
{
QClipboard *clipboard = QApplication::clipboard();
}
void MainWindow::SLOTrepaint()
{
ui->tableView->repaint();
}
void MainWindow::SLOTerrorMsg(const QString &str)
{
ui->msgList->append("<font color='RED'><b>" + str + "</b></font>");
}
void MainWindow::SLOTmsg(const QString &str)
{
ui->msgList->append(str);
}
void MainWindow::SLOTuodateLabelCount(int n, int N)
{
QString str = QString::fromUtf8("Колличество обработанных записей %1 из %2");
str = str.arg(n).arg(N);
ui->recordCountLabel->setText(str);
}
void MainWindow::SLOTupDateProgressBar()
{
ui->parserProgressBar->setValue(ui->parserProgressBar->value() + 1);
}
void MainWindow::SLOTstartParsing(int n)
{
ui->parserProgressBar->setValue(1);
QString str = QString::fromUtf8("Колличество обработанных записей %1 из %2");
str = str.arg(0).arg(n);
ui->recordCountLabel->setText(str);
}
void MainWindow::SLOTfinalParsing()
{
ui->parserProgressBar->setValue(0);
}