comparison widgets/LayerTreeDialog.cpp @ 639:bf9ef624aadf qt5

Make it possible to build with qt4 as well
author Chris Cannam
date Tue, 14 May 2013 12:26:48 +0100
parents d632a1e87018
children d39db4673676
comparison
equal deleted inserted replaced
638:6d38e9b15a78 639:bf9ef624aadf
49 49
50 m_modelView = new QTableView; 50 m_modelView = new QTableView;
51 subgrid->addWidget(m_modelView); 51 subgrid->addWidget(m_modelView);
52 52
53 m_modelView->verticalHeader()->hide(); 53 m_modelView->verticalHeader()->hide();
54 #if (QT_VERSION >= 0x050000)
54 m_modelView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); 55 m_modelView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
56 #else
57 m_modelView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
58 #endif
55 m_modelView->setShowGrid(false); 59 m_modelView->setShowGrid(false);
56 60
57 m_modelModel = new ModelMetadataModel(m_paneStack, true); 61 m_modelModel = new ModelMetadataModel(m_paneStack, true);
58 m_modelView->setModel(m_modelModel); 62 m_modelView->setModel(m_modelModel);
59 63
67 71
68 subgrid->setSpacing(0); 72 subgrid->setSpacing(0);
69 subgrid->setMargin(5); 73 subgrid->setMargin(5);
70 74
71 m_layerView = new QTreeView; 75 m_layerView = new QTreeView;
76 #if (QT_VERSION >= 0x050000)
72 m_layerView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); 77 m_layerView->header()->setSectionResizeMode(QHeaderView::ResizeToContents);
78 #else
79 m_layerView->header()->setResizeMode(QHeaderView::ResizeToContents);
80 #endif
73 subgrid->addWidget(m_layerView); 81 subgrid->addWidget(m_layerView);
74 82
75 m_layerModel = new LayerTreeModel(m_paneStack); 83 m_layerModel = new LayerTreeModel(m_paneStack);
76 m_layerView->setModel(m_layerModel); 84 m_layerView->setModel(m_layerModel);
77 m_layerView->expandAll(); 85 m_layerView->expandAll();