本文整理汇总了C++中QListWidget::setFrameShape方法的典型用法代码示例。如果您正苦于以下问题:C++ QListWidget::setFrameShape方法的具体用法?C++ QListWidget::setFrameShape怎么用?C++ QListWidget::setFrameShape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QListWidget
的用法示例。
在下文中一共展示了QListWidget::setFrameShape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLabel
FinderHomeWidget::FinderHomeWidget(QWidget *parent) : QWidget(parent) {
setWindowTitle(tr("Home"));
// speedup painting since we'll paint the whole background
// by ourselves anyway in paintEvent()
setAttribute(Qt::WA_OpaquePaintEvent);
// colors
QPalette p = palette();
p.setBrush(QPalette::Base, Qt::black);
p.setColor(QPalette::Text, QColor(Qt::white));
p.setBrush(QPalette::Window, Qt::black);
p.setColor(QPalette::WindowText, QColor(Qt::white));
this->setPalette(p);
QBoxLayout *layout = new QVBoxLayout(this);
layout->setMargin(0);
layout->setSpacing(0);
layout->setAlignment(Qt::AlignLeft | Qt::AlignTop);
QLabel *welcomeLabel =
new QLabel("<h3>" +
tr("Welcome to <a href='%1'>%2</a>,")
.replace("<a ", "<a style='color:white'")
.arg(Constants::WEBSITE, Constants::APP_NAME)
+ "</h3>" + tr("Use the icons below to explore your music collection."), this);
welcomeLabel->setOpenExternalLinks(true);
welcomeLabel->setMargin(15);
layout->addWidget(welcomeLabel);
// welcomeLabel->setStyleSheet("background: qlineargradient(x1:0, y1:0, x2:1, y2:1,stop:0 #1a1a1a, stop:1 #343434)");
QListWidget *items = new QListWidget(this);
connect(items, SIGNAL(itemActivated(QListWidgetItem*)), SLOT(itemActivated(QListWidgetItem*)));
items->setAutoFillBackground(false);
items->setAttribute(Qt::WA_NoSystemBackground);
items->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
items->setFrameShape(QFrame::NoFrame);
items->setAttribute(Qt::WA_MacShowFocusRect, false);
items->setSelectionMode(QAbstractItemView::NoSelection);
items->addItem(tr("Artists"));
items->addItem(tr("Albums"));
items->addItem(tr("Tracks"));
items->addItem(tr("Years"));
items->addItem(tr("Languages"));
layout->addWidget(items);
/*
Artists
Albums
Tracks
Time machine
By language
Files
---
Tagcloud
*/
}