Reputation: 10095
I want to use QLabel
s to display some data in this format
username:.....Erich Lancaster (without dots)
Location:.......Wherever
Is there a way to do this?
Upvotes: 1
Views: 1274
Reputation: 3156
Seems like using the QFormLayout would be the easiest. Something like:
QFormLayout *formLayout = new QFormLayout;
QLabel *usernameLabel = new QLabel("Erich Lancaster");
usernameLabel->setAlignment(Qt::AlignRight);
formLayout->addRow("username:", usernameLabel);
QLabel *locationLabel = new QLabel("Wherever");
locationLabel->setAlignment(Qt::AlignRight);
formLayout->addRow("Location:", locationLabel);
setLayout(formLayout);
Upvotes: 3