本文整理汇总了C++中QAbstractItemView::setFrameShadow方法的典型用法代码示例。如果您正苦于以下问题:C++ QAbstractItemView::setFrameShadow方法的具体用法?C++ QAbstractItemView::setFrameShadow怎么用?C++ QAbstractItemView::setFrameShadow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QAbstractItemView
的用法示例。
在下文中一共展示了QAbstractItemView::setFrameShadow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: weekPal
MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
: QMainWindow(parent, flags), m_activityCompleter(NULL),
m_tagCompleter(NULL), m_activityCompleterModel(NULL),
m_tagCompleterModel(NULL), m_trayIconAvailable(false),
m_showTrayIcon(false), m_trayIconMenu(NULL), m_trayIcon(NULL)
{
m_ui.setupUi(this);
setWindowIcon(QIcon(":/icons/hourglass.png"));
m_ui.actionAbout_Qt->setIcon(QIcon(":/trolltech/qmessagebox/images/qtlogo-64.png"));
m_trayIconAvailable = QSystemTrayIcon::isSystemTrayAvailable();
if (m_trayIconAvailable) {
m_showTrayIcon = m_settings.value("showTrayIcon", true).toBool();
if (m_showTrayIcon) {
createTrayIcon();
}
}
else {
qDebug() << "Couldn't display tray icon";
}
/* Set background of week tab to white */
QPalette weekPal(m_ui.saContentsWeek->palette());
weekPal.setColor(QPalette::Background, Qt::white);
m_ui.saContentsWeek->setPalette(weekPal);
/* Set background of current activity table to transparent */
QPalette currentPal(m_ui.tblCurrent->palette());
currentPal.setColor(QPalette::Base, Qt::transparent);
m_ui.tblCurrent->setPalette(currentPal);
/* Setup activity completer */
m_activityCompleter = new QCompleter(this);
m_activityCompleterModel = new ActivityNamesListModel(this);
m_activityCompleter->setModel(m_activityCompleterModel);
m_activityCompleter->setCompletionMode(QCompleter::PopupCompletion);
m_activityCompleter->setCaseSensitivity(Qt::CaseInsensitive);
QAbstractItemView *activityPopup = m_activityCompleter->popup();
activityPopup->setItemDelegate(new NamesDelegate(activityPopup));
activityPopup->setFrameShadow(QFrame::Plain);
m_ui.leActivity->setCompleter(m_activityCompleter);
/* Setup tag completer */
m_tagCompleter = new QCompleter(this);
m_tagCompleterModel = new TagNamesListModel(this);
m_tagCompleter->setModel(m_tagCompleterModel);
m_tagCompleter->setCompletionMode(QCompleter::PopupCompletion);
m_tagCompleter->setCaseSensitivity(Qt::CaseInsensitive);
QAbstractItemView *tagPopup = m_tagCompleter->popup();
tagPopup->setItemDelegate(new NamesDelegate(tagPopup));
tagPopup->setFrameShadow(QFrame::Plain);
m_ui.leTags->setCompleter(m_tagCompleter);
/* Set up activity tables */
m_recordManager = new RecordManager<Activity>;
m_ui.tblCurrent->setModel(new CurrentActivityTableModel(m_recordManager, this));
m_ui.tblCurrent->setItemDelegate(new CurrentActivityDelegate(m_ui.tblCurrent));
connect(this, SIGNAL(activityCreated(QSharedPointer<Activity>)),
m_ui.tblCurrent->model(), SLOT(created(QSharedPointer<Activity>)));
setupViews();
/* Set a timer to go off hourly to check if we should switch days */
m_dayTimer = new QTimer(this);
m_dayTimer->setInterval(3600000);
connect(m_dayTimer, SIGNAL(timeout()), this, SLOT(setupViews()));
QTime nowTime = QTime::currentTime();
int msecsToHour = 3600000 - (nowTime.minute() * 60000) -
(nowTime.second() * 1000) - nowTime.msec();
QTimer::singleShot(msecsToHour, this, SLOT(setupViews()));
QTimer::singleShot(msecsToHour, m_dayTimer, SLOT(start()));
}