当前位置: 首页>>代码示例>>C++>>正文


C++ QStyle::setParent方法代码示例

本文整理汇总了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()));
}
开发者ID:theunbelievablerepo,项目名称:gwenview,代码行数:60,代码来源:startmainpage.cpp

示例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()));
}
开发者ID:neuroidss,项目名称:ugene,代码行数:30,代码来源:TextSettingsDialog.cpp


注:本文中的QStyle::setParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。