src/document.cpp

changeset 47
cd6704009eb9
parent 39
caac957e9834
child 51
1a9eac27698d
equal deleted inserted replaced
46:98645c8e7704 47:cd6704009eb9
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */ 17 */
18 18
19 #include <QMouseEvent>
19 #include "document.h" 20 #include "document.h"
20 #include "ui_document.h" 21 #include "ui_document.h"
21 #include "model.h" 22 #include "model.h"
22 23
23 Document::Document( 24 Document::Document(
27 QWidget* parent) : 28 QWidget* parent) :
28 QWidget{parent}, 29 QWidget{parent},
29 model{model}, 30 model{model},
30 documents{documents}, 31 documents{documents},
31 colorTable{colorTable}, 32 colorTable{colorTable},
32 renderer{new PartRenderer{model, documents, colorTable, this}}, 33 renderer{new Canvas{model, documents, colorTable, this}},
33 ui{*new Ui::Document} 34 ui{*new Ui::Document}
34 { 35 {
35 this->ui.setupUi(this); 36 this->ui.setupUi(this);
36 this->ui.listView->setModel(model); 37 this->ui.listView->setModel(model);
37 QVBoxLayout* layout = new QVBoxLayout; 38 QVBoxLayout* layout = new QVBoxLayout;
38 layout->addWidget(this->renderer); 39 layout->addWidget(this->renderer);
39 this->ui.viewportFrame->setLayout(layout); 40 this->ui.viewportFrame->setLayout(layout);
41 this->setMouseTracking(true);
40 connect(this->ui.splitter, &QSplitter::splitterMoved, this, &Document::splitterChanged); 42 connect(this->ui.splitter, &QSplitter::splitterMoved, this, &Document::splitterChanged);
43 connect(this->renderer, &Canvas::newStatusText, this, &Document::newStatusText);
41 } 44 }
42 45
43 Document::~Document() 46 Document::~Document()
44 { 47 {
45 delete &this->ui; 48 delete &this->ui;

mercurial