From 9910c8962ab813ab7d9a04609b689e1d9ae038e0 Mon Sep 17 00:00:00 2001 From: senator Date: Tue, 2 Oct 2007 10:08:09 +0000 Subject: selectable entries now uses xml items correctly --- client/widgets/combobox.cc | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'client/widgets/combobox.cc') diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc index 5499d09..22efc96 100644 --- a/client/widgets/combobox.cc +++ b/client/widgets/combobox.cc @@ -2,7 +2,7 @@ /*************************************************************************** * combobox.cc * - * Wed Jul 18 09:39:40 CEST 2007 + * Wed Jul 18 10:35:52 CEST 2007 * Copyright 2007 Bent Bisballe Nyeng, Lars Bisballe Jensen and Peter Skaarup * deva@aasimon.org, elsenator@gmail.com and piparum@piparum.dk ****************************************************************************/ @@ -25,14 +25,45 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include "combobox.h" +#include ComboBox::ComboBox(QDomNode node) : QComboBox(), Widget(node) { QDomElement elem = node.toElement(); + + if(elem.hasAttribute("width")) { + resize(elem.attribute("width").toInt(), height()); + } + + if(elem.hasAttribute("height")) { + resize(width(), elem.attribute("height").toInt()); + } + + QDomNodeList children = node.childNodes(); + int default_found = 0; + + for (int i=0; i