本文整理汇总了C++中setFrameShadow函数的典型用法代码示例。如果您正苦于以下问题:C++ setFrameShadow函数的具体用法?C++ setFrameShadow怎么用?C++ setFrameShadow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFrameShadow函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
bool ShortcutWidget::event(QEvent * e)
{
switch (e->type()) {
case QEvent::FocusOut:
has_cursor_ = false;
setFrameShadow(QFrame::Raised);
break;
case QEvent::FocusIn:
has_cursor_ = true;
setFrameShadow(QFrame::Sunken);
break;
case QEvent::ShortcutOverride:
// accepting the ShortcutOverride event lets us override shortcuts
// and capture them as keypress events instead
e->accept();
return true;
case QEvent::KeyPress:
keyPressEvent(static_cast<QKeyEvent *>(e));
return true;
case QEvent::KeyRelease:
case QEvent::Shortcut:
return true;
default:
break;
}
return QLabel::event(e);
}
示例2: setFrameShape
void TSeparator::setOrientation(Qt::Orientation orientation)
{
if (orientation == Qt::Vertical) {
setFrameShape(QFrame::VLine);
setFrameShadow(QFrame::Sunken);
setMinimumSize(2, 0);
} else {
setFrameShape(QFrame::HLine);
setFrameShadow(QFrame::Sunken);
setMinimumSize(0, 2);
}
}
示例3: QLCDNumber
DigitalClock::DigitalClock(QWidget *parent)
: QLCDNumber(parent)
{
setSegmentStyle(Filled);
// setSegmentStyle(Outline);
// setSegmentStyle(Flat);
setAutoFillBackground(true);
setStyle(QStyleFactory::create(tr("Windows")) );
QPalette palette;
QBrush brush(QColor(255, 0, 0, 255));
brush.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::Active, QPalette::WindowText, brush);
palette.setBrush(QPalette::Inactive, QPalette::WindowText, brush);
setPalette(palette);
setFrameShape(QFrame::NoFrame);
setFrameShadow(QFrame::Plain);
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(showTime()));
timer->start(1000);
showTime();
// setWindowTitle(tr("Digital Clock"));
// resize(150, 60);
}
示例4: QFrame
GradientPreview::GradientPreview(QWidget *pa) : QFrame(pa)
{
setFrameShape( QFrame::Panel );
setFrameShadow( QFrame::Sunken );
setLineWidth( 2 );
setMinimumSize(QSize(200, 70));
setMaximumSize(QSize(3000, 70));
setMouseTracking(true);
setFocusPolicy(Qt::ClickFocus);
Mpressed = false;
outside = true;
onlyselect = true;
isEditable = true;
fill_gradient = VGradient(VGradient::linear);
fill_gradient.clearStops();
QColor color;
color = QColor(255,255,255);
fill_gradient.addStop( color, 0.0, 0.5, 1.0 );
color = QColor(0,0,0);
fill_gradient.addStop( color, 1.0, 0.5, 1.0 );
QList<VColorStop*> cstops = fill_gradient.colorStops();
StopM.clear();
ActStop = 0;
for (uint a = 0; a < fill_gradient.Stops(); ++a)
{
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
StopM.append(center);
}
}
示例5: QLabel
CtrlRenders::CtrlRenders( QWidget * i_parent, ListRenders * i_renderslist):
QLabel("View Options", i_parent ),
m_list( i_renderslist)
{
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Raised);
}
示例6: setLineWidth
/** Slot appelé lors de click de case **/
void Case::deminage(){
if(!hasCase || black) return;
hasCase = false;
thirdMark = false;
setLineWidth(1);
setMidLineWidth(0);
setFrameShape(QFrame::Panel);
setFrameShadow(QFrame::Sunken);
label->setText(showValue(value));
if(flag && notMine()){
emit signalCaseFlag(false);
}
else{
emit signalDemine();
if(value >= 9){
label->setText(showValue(value, QString("red"), QString("black")));
emit signalGameOver(false);
}
else if(value == 0){
emit signalDemineAroundCase(x, y);
}
}
}
示例7: QFrame
BtColorWidget::BtColorWidget(QWidget* parent)
: QFrame(parent) {
setFrameShadow(QFrame::Sunken);
setFrameShape(QFrame::StyledPanel);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
setAutoFillBackground(true);
}
示例8: QListWidget
//-----------------------------------------------------------------------------
// Function: TextContentAssistWidget()
//-----------------------------------------------------------------------------
TextContentAssistWidget::TextContentAssistWidget(QPlainTextEdit* target, QWidget* parentWnd,
QSharedPointer<ITextContentMatcher> matcher)
: QListWidget(parentWnd),
target_(target),
matcher_(matcher),
maxVisibleItems_(DEFAULT_MAX_VISIBLE_ITEMS),
lastAssistStartPos_(-1),
contentFound_(false),
toolTipHintWidget_()
{
Q_ASSERT(target != 0);
Q_ASSERT(matcher != 0);
// Set widget settings.
//setWindowFlags(Qt::Tool | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint);
setFrameShadow(QFrame::Raised);
setFocusPolicy(Qt::NoFocus);
setFont(QFont("Tahoma", 10));
// We want the widget to look active even though it is inactive.
QPalette pal = palette();
pal.setColor(QPalette::Inactive, QPalette::Highlight, Qt::darkBlue);
pal.setColor(QPalette::Inactive, QPalette::HighlightedText, Qt::white);
setPalette(pal);
hideAssist();
}
示例9: setFrameShape
/* normalize label */
void KbfxPixmapLabel::normalize ()
{
setFrameShape ( QLabel::NoFrame );
setFrameShadow ( QLabel::Plain );
setScaledContents ( FALSE );
setAlignment ( int ( QLabel::WordBreak | QLabel::AlignCenter ) );
}
示例10: QLabel
DragLabel::DragLabel(const QString &text, QWidget *parent)
: QLabel(text, parent)
{
setAutoFillBackground(true);
setFrameShape(QFrame::Panel);
setFrameShadow(QFrame::Raised);
}
示例11: QFrame
CWizGroupAttributeForm::CWizGroupAttributeForm(CWizExplorerApp& app, QWidget* parent)
: QFrame(parent)
, m_app(app)
, m_web(new QWebView(parent))
{
setFrameShadow(QFrame::Raised);
setFrameShape(QFrame::StyledPanel);
setAutoFillBackground(true);
setAttribute(Qt::WA_MacShowFocusRect, true);
QVBoxLayout* layout = new QVBoxLayout(this);
setLayout(layout);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(m_web);
QPushButton* btnClose = new QPushButton(this);
btnClose->setDefault(true);
btnClose->setIcon(::WizLoadSkinIcon(app.userSettings().skin(), palette().window().color(), "sheetHide"));
btnClose->setFlat(true);
btnClose->setMaximumHeight(18);
btnClose->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
connect(btnClose, SIGNAL(clicked()), SLOT(on_btnClose_clicked()));
layout->addWidget(btnClose);
layout->setAlignment(btnClose, Qt::AlignHCenter);
connect(&m_api, SIGNAL(clientLoginDone()), SLOT(on_clientLoginDone()));
}
示例12: QFrame
//
// class ReportResizeBar
//
ReportResizeBar::ReportResizeBar(QWidget * parent, Qt::WFlags f)
: QFrame(parent, f) {
setMinimumHeight(5);
setMaximumHeight(5);
setCursor(QCursor(Qt::SizeVerCursor));
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Raised);
}
示例13: QTextEdit
TextEditor::TextEditor(Graph *g): QTextEdit(g), d_target(NULL)
{
setAttribute(Qt::WA_DeleteOnClose);
setFrameShadow(QFrame::Plain);
setFrameShape(QFrame::Box);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QPalette palette = this->palette();
palette.setColor(QPalette::Active, QPalette::WindowText, Qt::blue);
palette.setColor(QPalette::Active, QPalette::Base, Qt::white);
setPalette(palette);
QString text;
if (g->selectedText()){
d_target = g->selectedText();
setGeometry(d_target->geometry());
auto legend = dynamic_cast<LegendWidget*>(d_target);
text = legend ? legend->text() : "";
d_target->hide();
} else if (g->titleSelected()){
d_target = g->plotWidget()->titleLabel();
QwtText t = g->plotWidget()->title();
text = t.text();
setAlignment((Qt::Alignment)t.renderFlags());
setGeometry(d_target->geometry());
} else if (g->selectedScale()){
d_target = g->selectedScale();
QwtScaleWidget *scale = (QwtScaleWidget*)d_target;
QwtText t = scale->title();
text = t.text();
setAlignment((Qt::Alignment)t.renderFlags());
QRect rect = g->axisTitleRect(scale);
if (scale->alignment() == QwtScaleDraw::BottomScale ||
scale->alignment() == QwtScaleDraw::TopScale){
resize(rect.size());
move(QPoint(d_target->x() + rect.x(), d_target->y() + rect.y()));
} else {
resize(QSize(rect.height(), rect.width()));
if (scale->alignment() == QwtScaleDraw::LeftScale)
move(QPoint(d_target->x() + rect.x(), d_target->y() + rect.y() + rect.height()/2));
else if (scale->alignment() == QwtScaleDraw::RightScale)
move(QPoint(d_target->x() - rect.height(), d_target->y() + rect.y() + rect.height()/2));
t.setText(" ");
t.setBackgroundPen(QPen(Qt::NoPen));
scale->setTitle(t);
}
}
QTextCursor cursor = textCursor();
cursor.insertText(text);
d_initial_text = text;
show();
setFocus();
}
示例14: setContactInfo
void ContactWidgetItem::showContactInfo()
{
if (!m_info) {
setContactInfo();
m_info = true;
}
if (m_show) {
setFrameShadow(Plasma::Frame::Raised);
if (!isEmpty()) {
m_mainLayout->removeItem(m_infoText);
m_infoText->hide();
}
m_mainLayout->removeItem(m_edit);
m_edit->hide();
m_show = false;
} else {
setFrameShadow(Plasma::Frame::Sunken);
if (!isEmpty()) {
m_mainLayout->addItem(m_infoText);
m_infoText->show();
}
m_mainLayout->addItem(m_edit);
m_edit->show();
m_show = true;
}
}
示例15: QFrame
Line::Line(Qt::Orientation orient, QWidget *parent)
: QFrame(parent)
{
setFrameShadow(Sunken);
if (orient == Qt::Horizontal)
setFrameShape(HLine);
else
setFrameShape(VLine);
}