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:
#include <QListWidget>
#include <QListWidgetItem>
//#include "ui_NameEntry.h"
public:
lblName
->setObjectName
(QString::fromUtf8("lblName"));
lblName
->setGeometry
(QRect(80,
10,
221,
31));
font.setPointSize(14);
lblName->setFont(font);
}
~NameEntry() {
}
private:
//Ui::NameEntryClass ui;
};
#include <QListWidget>
#include <QListWidgetItem>
//#include "ui_NameEntry.h"
class NameEntry : public QListWidgetItem {
public:
QLabel *lblName;
NameEntry(const QString & text, QListWidget * parent = 0) :
QListWidgetItem(text, parent, 1001) {
lblName = new QLabel(this);
lblName->setObjectName(QString::fromUtf8("lblName"));
lblName->setGeometry(QRect(80, 10, 221, 31));
QFont font;
font.setPointSize(14);
lblName->setFont(font);
}
~NameEntry() {
}
private:
//Ui::NameEntryClass ui;
};
To copy to clipboard, switch view to plain text mode
Bookmarks