Hi Frank

if the children are the same type and it's like a table, I would recommend the following alternative:

don't inherit from it QScrollArea but instantiate as many child widget's as visible. bind now the child-widgets depending of the position of the scrollbar with the object.

> widgets horizontally
my example is vertical, but you could adapt it...

+- ListView ------------------------------------+
| +- Viewport ----------------------------+ +-+ |
| | +- 1. ItemView ---------------------+ | |s| |
| | + Edit Label or whatever            | | |c| |
| | +-----------------------------------+ | |r| |
| | +- 2. ItemView ---------------------+ | |o| |
| | + Edit Label or whatever            | | |l| |
| | +-----------------------------------+ | |l| |
| | +- 3. ItemView ---------------------+ | |b| |
| | + Edit Label or whatever            | | |a| |
| | +-----------------------------------+ | |r| |
| | +- 4. ItemView ---------------------+ | | | |
| | + Edit Label or whatever            | | | | |
| | +-----------------------------------+ | | | |
| +---------------------------------------+ +-+ |
+-----------------------------------------------+

class ListView : QWidget{
  QWidget* _viewport; // the parent for the ItemView's
  QScrollBar* _scrollbar;
  QList<ItemView*> _items;
  int _scrollPosition;
  QList<Object*> _objects;
}
class ItemView : QWidget{
  Object* _object;
  QLineEdit* _someEdits;
  void bind( Object* object );
}

> smooth vertical scrolling
Of course, the child-widgets could be also pixel accuracy moved.

> QListView in icon mode
replace the QLineEdit with a Icon-Widget or Label or paint it in ItemView directly.

good luck
Reto

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to