本文整理汇总了C++中QStyle::setParent方法的典型用法代码示例。如果您正苦于以下问题:C++ QStyle::setParent方法的具体用法?C++ QStyle::setParent怎么用?C++ QStyle::setParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStyle
的用法示例。
在下文中一共展示了QStyle::setParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QFrame
StartMainPage::StartMainPage(QWidget* parent, GvCore* gvCore)
: QFrame(parent)
, d(new StartMainPagePrivate)
{
d->q = this;
d->mGvCore = gvCore;
d->mSearchUiInitialized = false;
d->setupUi(this);
if (styleIsGtkBased()) {
// Gtk-based styles do not apply the correct background color on tabs.
// As a workaround, use the Plastique style instead.
QStyle* fix = new QPlastiqueStyle();
fix->setParent(this);
d->mHistoryWidget->tabBar()->setStyle(fix);
d->mPlacesTagsWidget->tabBar()->setStyle(fix);
}
setFrameStyle(QFrame::NoFrame);
// Bookmark view
d->mBookmarksModel = new KFilePlacesModel(this);
d->mBookmarksView->setModel(d->mBookmarksModel);
d->mBookmarksView->setAutoResizeItemsEnabled(false);
connect(d->mBookmarksView, SIGNAL(urlChanged(KUrl)),
SIGNAL(urlSelected(KUrl)));
// Tag view
connect(d->mTagView, SIGNAL(clicked(QModelIndex)),
SLOT(slotTagViewClicked(QModelIndex)));
// Recent folder view
connect(d->mRecentFoldersView, SIGNAL(indexActivated(QModelIndex)),
SLOT(slotListViewActivated(QModelIndex)));
connect(d->mRecentFoldersView, SIGNAL(customContextMenuRequested(QPoint)),
SLOT(showRecentFoldersViewContextMenu(QPoint)));
// Url bag view
d->mRecentUrlsView->setItemDelegate(new HistoryViewDelegate(d->mRecentUrlsView));
connect(d->mRecentUrlsView, SIGNAL(customContextMenuRequested(QPoint)),
SLOT(showRecentFoldersViewContextMenu(QPoint)));
if (KGlobalSettings::singleClick()) {
if (KGlobalSettings::changeCursorOverIcon()) {
d->mRecentUrlsView->setCursor(Qt::PointingHandCursor);
}
connect(d->mRecentUrlsView, SIGNAL(clicked(QModelIndex)),
SLOT(slotListViewActivated(QModelIndex)));
} else {
connect(d->mRecentUrlsView, SIGNAL(doubleClicked(QModelIndex)),
SLOT(slotListViewActivated(QModelIndex)));
}
d->updateHistoryTab();
connect(GwenviewConfig::self(), SIGNAL(configChanged()),
SLOT(slotConfigChanged()));
}
示例2: HelpButton
TextSettingsDialog::TextSettingsDialog(QWidget *parent, const OptionsMap& settings)
: BaseSettingsDialog(parent) {
setupUi(this);
new HelpButton(this, buttonBox, "17467707");
curColor = qvariant_cast<QColor>(settings[LABEL_COLOR]);
#if (QT_VERSION < 0x050000) //Qt 5
QStyle *buttonStyle = new QPlastiqueStyle;
#else
QStyle *buttonStyle = new QProxyStyle(QStyleFactory::create("fusion"));
#endif
buttonStyle->setParent(colorButton);
colorButton->setStyle(buttonStyle);
updateColorButton();
QFont curFont = qvariant_cast<QFont>(settings[LABEL_FONT]);
fontComboBox->setCurrentFont(curFont);
sizeSpinBox->setValue(curFont.pointSize());
boldToolButton->setChecked(curFont.bold());
italicToolButton->setChecked(curFont.italic());
underlineToolButton->setChecked(curFont.underline());
overlineToolButton->setChecked(curFont.overline());
overlineToolButton->setVisible(false);
connect(colorButton, SIGNAL(clicked()), SLOT(sl_colorButton()));
}