18 #include "base/PropertyContainer.h" 24 #include "base/Command.h" 33 #define DEBUG_PROPERTY_STACK 1 40 bar->setDrawBase(
false);
48 #if (QT_VERSION >= 0x0402) 49 setElideMode(Qt::ElideNone);
50 tabBar()->setUsesScrollButtons(
true);
51 tabBar()->setIconSize(QSize(16, 16));
56 connect(
this, SIGNAL(currentChanged(
int)),
87 #ifdef DEBUG_PROPERTY_STACK 88 cerr <<
"PropertyStack[" <<
this <<
"]::repopulate" << endl;
94 for (
size_t i = 0; i <
m_boxes.size(); ++i) {
102 QString name = container->getPropertyContainerName();
104 #ifdef DEBUG_PROPERTY_STACK 105 cerr <<
"PropertyStack[" <<
this <<
"]::repopulate: client " <<
m_client 106 <<
" returns container " << container <<
" (name " << name
107 <<
") at position " << i << endl;
116 Layer *layer = dynamic_cast<Layer *>(container);
121 QString shortName = name;
131 bool nameDiffers = (name != shortName);
132 shortName = QString(
"&%1 %2").arg(i + 1).arg(shortName);
134 QString iconName = container->getPropertyContainerIconName();
138 addTab(box, shortName);
140 setTabToolTip(i, name);
143 addTab(box, icon, QString(
"&%1").arg(i + 1));
144 setTabToolTip(i, name);
158 if (pc == container)
return true;
175 for (
size_t i = 0; i <
m_boxes.size(); ++i) {
176 PropertyContainer *container =
m_boxes[i]->getContainer();
177 if (pc == container) {
202 Layer *layer = dynamic_cast<Layer *>(pc);
203 for (
unsigned int i = 0; i <
m_boxes.size(); ++i) {
204 if (pc ==
m_boxes[i]->getContainer()) {
205 m_boxes[i]->propertyContainerPropertyChanged(pc);
207 m_boxes[i]->layerVisibilityChanged
217 for (
unsigned int i = 0; i <
m_boxes.size(); ++i) {
218 if (pc ==
m_boxes[i]->getContainer()) {
219 m_boxes[i]->propertyContainerPropertyRangeChanged(pc);
234 QObject *obj = sender();
236 for (
unsigned int i = 0; i <
m_boxes.size(); ++i) {
238 Layer *layer = dynamic_cast<Layer *>(
m_boxes[i]->getContainer());
242 tr(
"Change Layer Visibility")));
252 if (n >=
int(
m_boxes.size()))
return;
static LayerFactory * getInstance()
void propertyContainerPropertyChanged(PropertyContainer *)
virtual const PropertyContainer * getPropertyContainer(int i) const
The base class for visual representations of the data found in a Model.
void propertyContainerAdded(PropertyContainer *)
std::vector< PropertyBox * > m_boxes
void viewSelected(View *client)
void addCommand(Command *command)
Add a command to the command history.
void selectedContainerChanged(int)
PropertyStack(QWidget *parent, View *client)
QString getLayerPresentationName(LayerType type)
void layerVisibilityChanged(bool)
void contextHelpChanged(const QString &)
virtual int getPropertyContainerCount() const
void propertyContainerRemoved(PropertyContainer *)
static CommandHistory * getInstance()
void propertyContainerPropertyRangeChanged(PropertyContainer *)
int getContainerIndex(PropertyContainer *container) const
void propertyContainerNameChanged(PropertyContainer *)
bool containsContainer(PropertyContainer *container) const
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
virtual QString getLayerPresentationName() const
void mouseEnteredTabBar()
virtual bool isLayerDormant(const View *v) const
Return whether the layer is dormant (i.e.
void propertyContainerSelected(View *client, PropertyContainer *container)