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


C++ setBackgroundRole函数代码示例

本文整理汇总了C++中setBackgroundRole函数的典型用法代码示例。如果您正苦于以下问题:C++ setBackgroundRole函数的具体用法?C++ setBackgroundRole怎么用?C++ setBackgroundRole使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setBackgroundRole函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QWidget

KoTinyButton::KoTinyButton( Action a, QWidget* parent )
		: QWidget( parent ), m_action( a )
{
	m_pressed = false;
	m_toggled = false;
	switch ( a )
	{
		case Sticky:
			m_bitmap = QBitmap::fromData( QSize( 5, 5 ), notstickybits );
			break;

		default:
			m_bitmap = QBitmap::fromData( QSize(5, 5), closebits );
	}
	m_bitmap.setMask( m_bitmap );
	setMinimumSize( 7, 7 );
	setBackgroundRole( QPalette::Window );
} // KoTinyButton::KoTinyButton
开发者ID:KDE,项目名称:calligra-history,代码行数:18,代码来源:KoContextHelp.cpp

示例2: QWidget

transitionFunctionRenderAreaWidget::transitionFunctionRenderAreaWidget(transitionFunction* functionData, QWidget *parent)
    : QWidget(parent)
{
	this->functionData = functionData;
	setMouseTracking(true);
    setBackgroundRole(QPalette::Base);
    setAutoFillBackground(true);
	Qt::PenStyle style = Qt::PenStyle(Qt::PenStyle::SolidLine);
	Qt::PenCapStyle cap = Qt::PenCapStyle(Qt::PenCapStyle::FlatCap);
	Qt::PenJoinStyle join = Qt::PenJoinStyle(Qt::PenJoinStyle::MiterJoin);
	pen = QPen(Qt::black, 1, style, cap, join);
	pointStyleMoveable = false;
	selectedPoint = -1;
	lengthToPickPoint = 8;
	mouseX = 0;
	mouseY = 0;
	deny = false;
}
开发者ID:JanKolomaznik,项目名称:MedV4D,代码行数:18,代码来源:transitionFunctionRenderArea.cpp

示例3: QFrame

MonitorFixture::MonitorFixture(QWidget* parent, Doc* doc)
    : QFrame(parent)
    , m_doc(doc)
{
    Q_ASSERT(doc != NULL);

    m_fixtureLabel = NULL;
    m_fixture = Fixture::invalidId();
    m_channelStyle = Monitor::DMXChannels;
    m_valueStyle = Monitor::DMXValues;

    new QGridLayout(this);
    layout()->setMargin(3);

    setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
    setAutoFillBackground(true);
    setBackgroundRole(QPalette::Window);
}
开发者ID:OnceBe,项目名称:qlcplus,代码行数:18,代码来源:monitorfixture.cpp

示例4: window_

Canvas::Canvas(Window *const window, bool left):
    window_(window)
{
    setParent(window);
    setBackgroundRole(QPalette::Base);
    setAutoFillBackground(true);
    setFocusPolicy(Qt::WheelFocus);

    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    size_in_pixels_ = width();
    canvas_delegate_ = new Canvas_Delegate();
    canvas_delegate_->left_canvas_ = left;

    left_canvas_ = left;

    reset_canvas();
}
开发者ID:seub,项目名称:CirclePackings,代码行数:18,代码来源:canvas.cpp

示例5: QWidget

Canvas::Canvas()
        : QWidget()
        , m_zoom(1)
        , m_rtree(4, 2)
//, m_rtree( 2, 1 )
        , m_tool(0)
        , m_createTool(this)
        , m_selectTool(this)
        , m_removeTool(this)
        , m_file("data.trc")
        , m_listId(0)
        , m_paintTree(false)
{
    m_tool = &m_createTool;
    setBackgroundRole(QPalette::Base);
    m_file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
    m_out.setDevice(&m_file);
}
开发者ID:abhishekmurthy,项目名称:Calligra,代码行数:18,代码来源:rtreetestapp.cpp

示例6: Cell

  /*!
   * \author Ingemar Axelsson
   *
   * \brief The class constructor
   */
  CellCursor::CellCursor(QWidget *parent)
    : Cell(parent),
    clickedOn_( false )
  {
    setHeight(3);
    QWidget *content = new CursorWidget(this);

    setMainWidget(content);
    hideTreeView(true);
    // PORT >> setBackgroundMode(Qt::PaletteBase);
    setBackgroundRole( QPalette::Base );
    setBackgroundColor(QColor(100,100,100));

    // 2006-04-27 AF, set cursor shape for cell cursor
    QCursor mousecursor = cursor();
    mousecursor.setShape( Qt::SizeHorCursor );
    setCursor( mousecursor );
  }
开发者ID:adrpo,项目名称:OMNotebook,代码行数:23,代码来源:cellcursor.cpp

示例7: QWidget

toResultDataSingle::toResultDataSingle(QWidget *parent)
        : QWidget(parent)
{

    Row       = -1;
    Container = NULL;
    Model     = NULL;

    setBackgroundRole(QPalette::Window);

    // fscking qscrollarea won't resize this is added
    QHBoxLayout *h = new QHBoxLayout;
    h->setContentsMargins(0, 0, 0, 0);
    h->setSpacing(0);
    setLayout(h);

    setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
}
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:18,代码来源:toresultdatasingle.cpp

示例8: QFrame

ModelView::ModelView(QWidget* parent) :
  QFrame(parent),
  ui(new Ui::ModelView) {
  ui->setupUi(this);
  setBackgroundRole(QPalette::Base);

  connect(ui->buttonAdd, SIGNAL(clicked()), SLOT(addFile()));
  connect(ui->interpreter, SIGNAL(currentIndexChanged(int)), SLOT(onInterpreterChanged(int)));
  connect(ui->add, SIGNAL(clicked()), SLOT(add()));
  connect(ui->del, SIGNAL(clicked()), SLOT(del()));

  ui->userIdText->setEnabled(false);
  ui->categoryCombo->setEnabled(false);

  ui->modelInfo->setText(dengueme::getProjectType());
  ui->modelInfo->setVisible(false);
  ui->modelType->setVisible(false);
}
开发者ID:ufopleds,项目名称:DengueME,代码行数:18,代码来源:modelview.cpp

示例9: setBackgroundRole

void DropArea::dropEvent(QDropEvent *event)
{
	/** Accept only urls */
	if(event->mimeData()->hasUrls()) {

		/** Set default background */
		setBackgroundRole(QPalette::Dark);

		/** Set action to move */
		event->setDropAction(Qt::TargetMoveAction);

		/** Accept event */
		event->accept();

		/** Emit the dropped event */
		emit dropped(event->mimeData()->urls());
	}
}
开发者ID:jmlemetayer,项目名称:ultraviolet,代码行数:18,代码来源:droparea.cpp

示例10: QWidget

WizUserCipherForm::WizUserCipherForm(WizExplorerApp& app, QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::WizUserCipherForm)
    , m_app(app)
    , m_bSaveForSession(false)
{
    ui->setupUi(this);
    ui->editUserCipher->setEchoMode(QLineEdit::Password);
    ui->editUserCipher->setAttribute(Qt::WA_MacShowFocusRect, false);

    setAutoFillBackground(true);
    setAttribute(Qt::WA_MacShowFocusRect, false);
    setBackgroundRole(QPalette::Midlight);
    //
    ui->checkSave->setVisible(false);


    QString strIconNormal = Utils::WizStyleHelper::skinResourceFileName("mac_icons_password_done", true); // ::WizGetSkinResourcePath(m_app.userSettings().skin())
//            + "mac_icons_password_done.png";
    QString strIconHot = Utils::WizStyleHelper::skinResourceFileName("mac_icons_password_done_hot", true); // ::WizGetSkinResourcePath(m_app.userSettings().skin())
//            + "mac_icons_password_done_hot.png";
    QString strIconDown = Utils::WizStyleHelper::skinResourceFileName("mac_icons_password_done_down", true); // ::WizGetSkinResourcePath(m_app.userSettings().skin())
//            + "mac_icons_password_done_down.png";

    ui->editUserCipher->setFixedHeight(19);
    QSize szBtn(19, 19);
    ui->buttonOk->setMinimumSize(szBtn);
    ui->buttonOk->setMaximumSize(szBtn);
    ui->buttonOk->setIconNormal(strIconNormal);
    ui->buttonOk->setIconHot(strIconHot);
    ui->buttonOk->setIconDown(strIconDown);
    ui->buttonOk->setStatusNormal();
    ui->buttonOk->setLockNormalStatus(true);


    m_animation = new QPropertyAnimation(ui->editUserCipher, "pos", this);

    connect(ui->editUserCipher, SIGNAL(returnPressed()), SLOT(onButtonOK_clicked()));
    connect(ui->editUserCipher, SIGNAL(textChanged(const QString&)),
            SLOT(onCipher_changed(const QString&)));
    connect(ui->buttonOk, SIGNAL(clicked()), SLOT(onButtonOK_clicked()));
    connect(ui->checkSave, SIGNAL(stateChanged(int)), SLOT(onCheckSave_stateChanged(int)));

}
开发者ID:JamesLinus,项目名称:WizQTClient,代码行数:44,代码来源:WizUserCipherForm.cpp

示例11: setMouseTracking

//! [0]
SortingBox::SortingBox()
{
//! [0] //! [1]
    setMouseTracking(true);
//! [1] //! [2]
    setBackgroundRole(QPalette::Base);
//! [2]

    itemInMotion = 0;

//! [3]
    newCircleButton = createToolButton(tr("New Circle"),
                                       QIcon(":/images/circle.png"),
                                       SLOT(createNewCircle()));

    newSquareButton = createToolButton(tr("New Square"),
                                       QIcon(":/images/square.png"),
                                       SLOT(createNewSquare()));

    newTriangleButton = createToolButton(tr("New Triangle"),
                                         QIcon(":/images/triangle.png"),
                                         SLOT(createNewTriangle()));

    circlePath.addEllipse(QRect(0, 0, 100, 100));
    squarePath.addRect(QRect(0, 0, 100, 100));

    qreal x = trianglePath.currentPosition().x();
    qreal y = trianglePath.currentPosition().y();
    trianglePath.moveTo(x + 120 / 2, y);
    trianglePath.lineTo(0, 100);
    trianglePath.lineTo(120, 100);
    trianglePath.lineTo(x + 120 / 2, y);

//! [3] //! [4]
    setWindowTitle(tr("Tool Tips"));
    resize(500, 300);

    createShapeItem(circlePath, tr("Circle"), initialItemPosition(circlePath),
                    initialItemColor());
    createShapeItem(squarePath, tr("Square"), initialItemPosition(squarePath),
                    initialItemColor());
    createShapeItem(trianglePath, tr("Triangle"),
                    initialItemPosition(trianglePath), initialItemColor());
}
开发者ID:Fale,项目名称:qtmoko,代码行数:45,代码来源:sortingbox.cpp

示例12: setPixmap

void DropArea::dropEvent(QDropEvent *event)
{
    const QMimeData *mimeData = event->mimeData();

    if (mimeData->hasImage()) {
        setPixmap(qvariant_cast<QPixmap>(mimeData->imageData()));
    } else if (mimeData->hasHtml()) {
        setText(mimeData->html());
        setTextFormat(Qt::RichText);
    } else if (mimeData->hasText()) {
        setText(mimeData->text());
        setTextFormat(Qt::PlainText);
    } else {
        setText(tr("Cannot display data"));
    }

    setBackgroundRole(QPalette::Dark);
    event->acceptProposedAction();
}
开发者ID:Andreas665,项目名称:qt,代码行数:19,代码来源:droparea.cpp

示例13: QLabel

HelpPopup::HelpPopup(QWidget* parent) : QLabel(parent)
{
    setForegroundRole(QPalette::ToolTipText);
    setBackgroundRole(QPalette::ToolTipBase);
    setPalette(QToolTip::palette());
    ensurePolished();
    setMargin(1 + style()->pixelMetric(QStyle::PM_ToolTipLabelFrameWidth, 0, this));
    setFrameStyle(QFrame::NoFrame);
    setAlignment(Qt::AlignLeft);
    setIndent(1);
    setWindowOpacity(style()->styleHint(QStyle::SH_ToolTipLabel_Opacity, 0, this) / 255.0);
    setMouseTracking(true);

    setWindowFlags(Qt::Popup);
    setAttribute(Qt::WA_DeleteOnClose);

    QShortcut* shortcut = new QShortcut(QKeySequence("Esc"), this);
    connect(shortcut, SIGNAL(activated()), this, SLOT(close()));
}
开发者ID:jpnurmi,项目名称:communi-desktop,代码行数:19,代码来源:helppopup.cpp

示例14: QScrollArea

ImageViewerWidget::ImageViewerWidget(QWidget *parent) :
    QScrollArea(parent), m_Scale(1.0)
{
    m_FlickCharm = new FlickCharm(this);
    m_FlickCharm->activateOn(this);
    m_Image = new QLabel(this);
    m_Image->setBackgroundRole(QPalette::Base);
    m_Image->setScaledContents(true);
    m_Image->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
    m_Image->setStyleSheet("QLabel {"
        "background-color: transparent;"
        "background-image: url(':/images/checkerboard.png');"
        "border: 1px dashed #000000;"
    "}");
    setAlignment(Qt::AlignCenter);
    setBackgroundRole(QPalette::Dark);
    setWidget(m_Image);
    viewport()->setCursor(Qt::OpenHandCursor);
}
开发者ID:vaibhavpandeyvpz,项目名称:apkstudio,代码行数:19,代码来源:imageviewerwidget.cpp

示例15: setBackgroundRole

StartTab::StartTab(MainWindow *mainWindow)
{
	setBackgroundRole(QPalette::Base);
	setAutoFillBackground(true);

	QGridLayout *gridLayout = new QGridLayout(this);
	gridLayout->setAlignment(Qt::AlignCenter);
	gridLayout->setMargin(10);
	gridLayout->setSpacing(15);

	QAbstractButton *button =
		addShortcut(i18n("&1 Play File"), QIcon::fromTheme(QLatin1String("video-x-generic"), QIcon(":video-x-generic")), this);
	button->setShortcut(Qt::Key_1);
	button->setWhatsThis(i18n("Open dialog to play a file"));
	connect(button, SIGNAL(clicked()), mainWindow, SLOT(open()));
	gridLayout->addWidget(button, 0, 0);

	button = addShortcut(i18n("&2 Play Audio CD"), QIcon::fromTheme(QLatin1String("media-optical-audio"), QIcon(":media-optical-audio")), this);
	button->setShortcut(Qt::Key_2);
	button->setWhatsThis(i18n("Start playing an audio CD. It assumes that the CD is already there at the CD driver"));
	connect(button, SIGNAL(clicked()), mainWindow, SLOT(openAudioCd()));
	gridLayout->addWidget(button, 0, 1);

	button = addShortcut(i18n("&3 Play Video CD"), QIcon::fromTheme(QLatin1String("media-optical"), QIcon(":media-optical")), this);
	button->setShortcut(Qt::Key_3);
	button->setWhatsThis(i18n("Start playing a Video CD. It assumes that the CD is already there at the CD driver"));
	connect(button, SIGNAL(clicked()), mainWindow, SLOT(openVideoCd()));
	gridLayout->addWidget(button, 0, 2);

	button = addShortcut(i18n("&4 Play DVD"), QIcon::fromTheme(QLatin1String("media-optical"), QIcon(":media-optical")), this);
	button->setShortcut(Qt::Key_4);
	button->setWhatsThis(i18n("Start playing a DVD. It assumes that the DVD is already there at the DVD driver"));
	connect(button, SIGNAL(clicked()), mainWindow, SLOT(openDvd()));
	gridLayout->addWidget(button, 1, 0);

#if HAVE_DVB == 1
	button = addShortcut(i18n("&5 Digital TV"), QIcon::fromTheme(QLatin1String("video-television"), QIcon(":video-television")), this);
	button->setShortcut(Qt::Key_5);
	button->setWhatsThis("Open the Digital TV live view window. If the TV channels are already scanned, it will start playing the last channel");
	connect(button, SIGNAL(clicked()), mainWindow, SLOT(playDvb()));
	gridLayout->addWidget(button, 1, 1);
#endif /* HAVE_DVB == 1 */
}
开发者ID:KDE,项目名称:kaffeine,代码行数:43,代码来源:mainwindow.cpp


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