示例#1
0
KoDetailsPane::KoDetailsPane(QWidget* parent, const KComponentData &_componentData, const QString& header)
        : QWidget(parent),
        Ui_KoDetailsPaneBase(),
        d(new KoDetailsPanePrivate(_componentData))
{
    d->m_model->setHorizontalHeaderItem(0, new QStandardItem(header));

    setupUi(this);

    m_previewLabel->installEventFilter(this);
    m_documentList->installEventFilter(this);
    m_documentList->setIconSize(QSize(64, 64));
    m_documentList->setModel(d->m_model);
    m_splitter->setSizes(QList<int>() << 2 << 1);

    changePalette();

    connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(changePalette()));

    connect(m_documentList->selectionModel(), SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)),
            this, SLOT(selectionChanged(const QModelIndex&)));
    connect(m_documentList, SIGNAL(doubleClicked(const QModelIndex&)),
            this, SLOT(openFile(const QModelIndex&)));
    connect(m_openButton, SIGNAL(clicked()), this, SLOT(openFile()));
}
//! [5]
void WidgetGallery::changeStyle(const QString &styleName)
//! [5] //! [6]
{
    if (styleName == "NorwegianWood") {
        QApplication::setStyle(new NorwegianWoodStyle);
    } else {
        QApplication::setStyle(QStyleFactory::create(styleName));
    }
    changePalette();
}
示例#3
0
文件: scene.cpp 项目: nfrey/qreal
Scene::Scene(View *view, QObject * parent)
	:  QGraphicsScene(parent), mItemType(none), mWaitMove(false), mCount(0), mGraphicsItem(NULL), mSelectedTextPicture(NULL)
{
	mView = view;
	setItemIndexMethod(NoIndex);
	mEmptyRect = addRect(0, 0, sizeEmptyRectX, sizeEmptyRectY, QPen(Qt::white));
	setEmptyPenBrushItems();
	mCopyPaste = nonePaste;
	connect(this, SIGNAL(selectionChanged()), this, SLOT(changePalette()));
	connect(this, SIGNAL(selectionChanged()), this, SLOT(changeFontPalette()));
	mZValue = 0;
}
示例#4
0
KoDetailsPane::KoDetailsPane(QWidget* parent, const QString& header)
        : QWidget(parent),
        Ui_KoDetailsPaneBase(),
        d(new KoDetailsPanePrivate)
{
    d->m_model->setHorizontalHeaderItem(0, new QStandardItem(header));

    setupUi(this);

    m_previewLabel->installEventFilter(this);
    m_documentList->installEventFilter(this);
    m_documentList->setIconSize(QSize(IconExtent, IconExtent));
    m_documentList->setModel(d->m_model);
    m_splitter->setSizes(QList<int>() << 2 << 1);

    changePalette();

    connect(m_documentList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
            this, SLOT(selectionChanged(QModelIndex)));
    connect(m_documentList, SIGNAL(doubleClicked(QModelIndex)),
            this, SLOT(openFile(QModelIndex)));
    connect(m_openButton, SIGNAL(clicked()), this, SLOT(openFile()));
}
示例#5
0
void QSetupDialog::changeStyle(const QString &styleName)
{
	QApplication::setStyle(QStyleFactory::create(styleName));
	style = styleName;
	changePalette();
}