EditMyPosterHiring,h
#include "addAndEditPostersHiring.h"
#include "workWithTheTable.h"
class EditMyPosterHiring: public QDialog, public WorkWithTheTable<PosterHiring, AddAndEditPostersHiring>
{
Q_OBJECT
private slots:
void addPoster()
{
addObject();
}
void editPoster()
{
editObject();
}
void removePoster()
{
removeObject();
}
public:
EditMyPosterHiring()
{
stringTitleColumn << "city" << "area" << "number_phone" << "sum_room" << "price" << "furtiture" << "animal" << "who tetant" ;
tablePoster->setColumnCount( 8 );
tablePoster->setHorizontalHeaderLabels(stringTitleColumn);
QObject::connect( addButton, SIGNAL(clicked()), this, SLOT(addPoster()) );
QObject::connect( editButton, SIGNAL(clicked()), this, SLOT(editPoster()) );
QObject::connect( tablePoster, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(editPoster()) );
QObject::connect( removeButton,SIGNAL(clicked()) ,this, SLOT(removePoster()) );
mainLayout = new QHBoxLayout;
mainLayout->addWidget(tablePoster);
mainLayout->addLayout(buttonLayout);
setLayout(mainLayout);
setWindowTitle("My Poster Hiring");
}
};
Layout'ы в подключаемых, как и таблица...
WorkWithTheTable.h
template <class Obj, class AddAndEdit>
class WorkWithTheTable: public ButtonsEding, public TableSelection
{
protected:
Obj *top;
Obj *last;
void displayFullTable();
void setTop(Obj *topList);
Obj *getTop();
Obj *activeRow();
virtual void addObjectInTable(Obj *_obj, int row);
virtual void editRowTable(Obj *_insertedObj, int row );
void addObject();
void editObject();
void removeObject();
public:
WorkWithTheTable();
};
получаю

Пользователь решил продолжить мысль 19 Ноября 2012, 22:09:07:
как понял, шаблоны в разных файлах делать ай-яй-яй...
перенес все в один *.h
и заработало...
но если у кого есть идеи как можно было в разных сделать то... )