.
.
.
#include "ui/ui_MainWindow.h"
#include "MainWindow.h"
#include <Q3Table>
#include <QRegExp>
#include <QSpinBox>
#include <vector>
.
.
.
#include "ui/ui_Tab.h"
#include "Tab.h"
#include "Tab.cpp"
using namespace std;
vector <osoba> people;
.
.
.
MainWindow::MainWindow(QWidget *parent
) {
setupUi(this);
.
.
.
count=people.size();
connectSlots();
}
void MainWindow::show_table()
{
Tab *my_table = new Tab;
my_table->table->setNumRows(people.size());
my_table->table->setColumnWidth ( 0, 115 );
my_table->table->setColumnWidth ( 1, 115 );
my_table->table->setColumnWidth ( 2, 70 );
for( int row= 0; row < count ; row++)
{
my_table->table->setText(row,0,people[row].sur_name);
my_table->table->setText(row,1,people[row].first_name);
my_table->table->setText(row,2,people[row].number);
my_table->table->sortColumn(0,TRUE,TRUE);
}
my_table->table->setReadOnly(TRUE);
my_table->show();
}
.
.
.
void MainWindow::quit()
{
qApp->closeAllWindows();
}
.
.
.
#include "ui/ui_MainWindow.h"
#include "MainWindow.h"
#include <Q3Table>
#include <QRegExp>
#include <QSpinBox>
#include <vector>
.
.
.
#include "ui/ui_Tab.h"
#include "Tab.h"
#include "Tab.cpp"
using namespace std;
vector <osoba> people;
.
.
.
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
setupUi(this);
.
.
.
count=people.size();
connectSlots();
}
void MainWindow::show_table()
{
Tab *my_table = new Tab;
my_table->table->setNumRows(people.size());
my_table->table->setColumnWidth ( 0, 115 );
my_table->table->setColumnWidth ( 1, 115 );
my_table->table->setColumnWidth ( 2, 70 );
for( int row= 0; row < count ; row++)
{
my_table->table->setText(row,0,people[row].sur_name);
my_table->table->setText(row,1,people[row].first_name);
my_table->table->setText(row,2,people[row].number);
my_table->table->sortColumn(0,TRUE,TRUE);
}
my_table->table->setReadOnly(TRUE);
my_table->show();
}
.
.
.
void MainWindow::quit()
{
qApp->closeAllWindows();
}
To copy to clipboard, switch view to plain text mode
Bookmarks