I have been messing around with it and may have found a problem. Since QListWidgetItem is not a derived from QWidget, I cannot seem to create a custom UI for it. Is this the right container to use? I wish vboxLayout had a scrollbar feature because that would work perfectly.

Note: this does not work because QLabel constructor only accepts a QWidget as it's argument, where "this" does not work for that.

Here is my code so far:

Qt Code:
  1. #include <QListWidget>
  2. #include <QListWidgetItem>
  3.  
  4. //#include "ui_NameEntry.h"
  5.  
  6. class NameEntry : public QListWidgetItem {
  7.  
  8. public:
  9. QLabel *lblName;
  10.  
  11. NameEntry(const QString & text, QListWidget * parent = 0) :
  12. QListWidgetItem(text, parent, 1001) {
  13. lblName = new QLabel(this);
  14. lblName->setObjectName(QString::fromUtf8("lblName"));
  15. lblName->setGeometry(QRect(80, 10, 221, 31));
  16. QFont font;
  17. font.setPointSize(14);
  18. lblName->setFont(font);
  19. }
  20.  
  21. ~NameEntry() {
  22.  
  23. }
  24.  
  25. private:
  26. //Ui::NameEntryClass ui;
  27. };
To copy to clipboard, switch view to plain text mode