Ignore:
Timestamp:
Jul 27, 2016, 5:43:01 PM (5 years ago)
Author:
Thomas Fuhrmann
Message:

Default xml configuration is working with ListWidget?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/mavlink/tools/FlairGCS/src/Layout.cpp

    r48 r54  
    2323#include <QGridLayout>
    2424#include "ListWidget.h"
     25#include <QStringList>
    2526
    2627Layout::Layout(QWidget *parent, XmlWidget *xml, QString name, QString type)
     
    250251  }
    251252  if (type == "ListWidget") {
    252     widget = new ListWidget(this, row, col, name);
     253    // Parse the item list   
     254    QStringList items;
     255    int count = 0;
     256    while (dom.hasAttribute("item" + QString::number(count))) {
     257      QString item = dom.attribute("item" + QString::number(count));
     258      items.append(item);
     259      count++;
     260    }
     261    widget = new ListWidget(this, row, col, name, items);
    253262  }
    254263
Note: See TracChangeset for help on using the changeset viewer.