本文整理汇总了C++中QLabel::setFrameShadow方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::setFrameShadow方法的具体用法?C++ QLabel::setFrameShadow怎么用?C++ QLabel::setFrameShadow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLabel
的用法示例。
在下文中一共展示了QLabel::setFrameShadow方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotIdentifyScreens
void BGDialog::slotIdentifyScreens()
{
// Taken from PositionTab::showIdentify in kdebase/kcontrol/kicker/positiontab_impl.cpp
for (unsigned s = 0; s < m_numScreens; s++) {
QLabel *screenLabel = new QLabel(0, Qt::X11BypassWindowManagerHint);
screenLabel->setObjectName("Screen Identify");
QFont identifyFont(KGlobalSettings::generalFont());
identifyFont.setPixelSize(100);
screenLabel->setFont(identifyFont);
screenLabel->setFrameStyle(QFrame::Panel);
screenLabel->setFrameShadow(QFrame::Plain);
screenLabel->setAlignment(Qt::AlignCenter);
screenLabel->setNum(int(s + 1));
// BUGLET: we should not allow the identification to be entered again
// until the timer fires.
QTimer::singleShot(1500, screenLabel, SLOT(deleteLater()));
QPoint screenCenter(QApplication::desktop()->screenGeometry(s).center());
QRect targetGeometry(QPoint(0, 0), screenLabel->sizeHint());
targetGeometry.moveCenter(screenCenter);
screenLabel->setGeometry(targetGeometry);
screenLabel->show();
}
}
示例2: addLabel
void ModelPanel::addLabel(QGridLayout * gridLayout, QString text, int col, bool minimize)
{
QLabel *label = new QLabel(this);
label->setFrameShape(QFrame::Panel);
label->setFrameShadow(QFrame::Raised);
label->setMidLineWidth(0);
label->setAlignment(Qt::AlignCenter);
label->setMargin(5);
label->setText(text);
if (!minimize)
label->setMinimumWidth(100);
gridLayout->addWidget(label, 0, col, 1, 1);
}
示例3: ModelPanel
TelemetryCustomScreen::TelemetryCustomScreen(QWidget *parent, ModelData & model, FrSkyScreenData & screen, GeneralSettings & generalSettings, FirmwareInterface * firmware):
ModelPanel(parent, model, generalSettings, firmware),
ui(new Ui::TelemetryCustomScreen),
screen(screen)
{
ui->setupUi(this);
for (int l=0; l<4; l++) {
for (int c=0; c<firmware->getCapability(TelemetryCustomScreensFieldsPerLine); c++) {
fieldsCB[l][c] = new QComboBox(this);
fieldsCB[l][c]->setProperty("index", c + (l<<8));
ui->screenNumsLayout->addWidget(fieldsCB[l][c], l, c, 1, 1);
connect(fieldsCB[l][c], SIGNAL(currentIndexChanged(int)), this, SLOT(customFieldChanged(int)));
}
}
for (int l=0; l<4; l++) {
barsCB[l] = new QComboBox(this);
barsCB[l]->setProperty("index", l);
connect(barsCB[l], SIGNAL(currentIndexChanged(int)), this, SLOT(barSourceChanged(int)));
ui->screenBarsLayout->addWidget(barsCB[l], l, 0, 1, 1);
minSB[l] = new QDoubleSpinBox(this);
minSB[l]->setProperty("index", l);
connect(minSB[l], SIGNAL(valueChanged(double)), this, SLOT(barMinChanged(double)));
ui->screenBarsLayout->addWidget(minSB[l], l, 1, 1, 1);
QLabel * label = new QLabel(this);
label->setAutoFillBackground(false);
label->setStyleSheet(QString::fromUtf8("Background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(0, 0, 128, 255), stop:0.339795 rgba(0, 0, 128, 255), stop:0.339799 rgba(255, 255, 255, 255), stop:0.662444 rgba(255, 255, 255, 255),)\n"""));
label->setFrameShape(QFrame::Panel);
label->setFrameShadow(QFrame::Raised);
label->setAlignment(Qt::AlignCenter);
ui->screenBarsLayout->addWidget(label, l, 2, 1, 1);
maxSB[l] = new QDoubleSpinBox(this);
maxSB[l]->setProperty("index", l);
connect(maxSB[l], SIGNAL(valueChanged(double)), this, SLOT(barMaxChanged(double)));
ui->screenBarsLayout->addWidget(maxSB[l], l, 3, 1, 1);
}
disableMouseScrolling();
update();
}
示例4: continueCreate
/// continue the creation of the widgets once the pieces XML was loaded.
/// this is where all the work of creating the family tabs and their content is performed.
void PicsSelectWidget::continueCreate()
{
const PicBucket& bucket = PicBucket::instance();
m_tabs = new QTabWidget(this);
connect(m_tabs, SIGNAL(currentChanged(int)), this, SLOT(updateSetsSpinBox(int)));
m_layout->addWidget(m_tabs);
m_groups.resize(bucket.grps.size());
for (int f = 0; f < bucket.families.size(); ++f)
{
const PicFamily &fam = bucket.families[f];
SizedWidget *tab = new SizedWidget(QSize(6 * BOT_TOTAL_X + BOT_OFFS_X + FRAME_OFFS_SPACE_RIGHT - 5, NUM_DEFS * BOT_TOTAL_Y + FRAME_OFFS_Y), nullptr);
//QWidget *tab = new QWidget();
//tab->resize(QSize(6 * BOT_TOTAL_X + BOT_OFFS_X + FRAME_OFFS_SPACE_RIGHT, NUM_DEFS * BOT_TOTAL_Y + FRAME_OFFS_Y));
QScrollArea *scroll = new QScrollArea();
scroll->setWidget(tab);
// the following is the voodoo needed to make the scroll area the same color as the tab
// if this wasn't here, the scroll area would have gotten the default window color
// this is significant in Windows XP with new apperance style where the tab color is
// different from the default window color
scroll->viewport()->setAutoFillBackground(false);
tab->setAutoFillBackground(false);
// scroll area has a frame by default. get rid of it.
scroll->setFrameShape(QFrame::NoFrame);
m_tabs->addTab(scroll, fam.name.c_str());
for (int g = fam.startIndex; g < fam.startIndex + fam.numGroups; ++g)
{
const PicGroupDef *grp = &(bucket.grps[g]);
GroupCtrl &grpctrl = m_groups[g];
int normg = (g - fam.startIndex); // normalized g with start of family
QGroupBox *groupbox = new QGroupBox(grp->name.c_str(), tab);
groupbox->move(BOT_OFFS_X-FRAME_OFFS_SPACE_LEFT, FRAME_OFFS_Y + normg*BOT_TOTAL_Y - 30);
groupbox->resize(FRAME_OFFS_SPACE_RIGHT + grp->numPics() * BOT_TOTAL_X, BOT_Y + 55);
grpctrl.num = new DataSpinBox(g, tab);
grpctrl.num->move(grp->numPics() * BOT_TOTAL_X + BOT_OFFS_X + FRAME_OFFS_SPACE_RIGHT - 65, BOT_OFFS_Y + normg*BOT_TOTAL_Y + 40);
grpctrl.num->resize(45, 23);
grpctrl.num->setButtonSymbols(QAbstractSpinBox::PlusMinus);
grpctrl.num->setRange(-1, MAX_IDENTICAL_PIECES);
grpctrl.num->setSpecialValueText("X");
connect(grpctrl.num, SIGNAL(dvalueChanged(int, int)), this, SLOT(changedGrpBox(int, int)));
for (int p = 0; p < bucket.grps[g].numPics(); ++p)
{
const PicDef* pic = &(grp->getPic(p));
PicCtrl picctrl;
int data = (g << 16) | p;
DataPushButton *button = new DataPushButton(data, QIcon(pic->pixmap), QString(), tab);
picctrl.bot = button;
button->setCheckable(true);
button->move(BOT_OFFS_X + p*BOT_TOTAL_X, BOT_OFFS_Y + normg * BOT_TOTAL_Y); // g normalized to start of family
button->resize(BOT_X, BOT_Y);
button->setIconSize(pic->pixmap.size()); // +1 because it's the texture + line, from Pieces.h
connect(button, SIGNAL(pclicked(int, bool)), this, SLOT(pressedPicButton(int, bool)));
DataSpinBox *spinbox = new DataSpinBox(data, tab);
picctrl.num = spinbox;
spinbox->setRange(0, MAX_IDENTICAL_PIECES);
spinbox->move(BOT_OFFS_X + p*BOT_TOTAL_X + (BOT_X/5*2 + 2), BOT_OFFS_Y + normg*BOT_TOTAL_Y + BOT_Y + 5);
spinbox->resize(BOT_X/5*3 - 4, EDIT_THICK + 1);
spinbox->setButtonSymbols(QAbstractSpinBox::PlusMinus);
connect(spinbox, SIGNAL(dvalueChanged(int, int)), this, SLOT(changedNumBox(int, int)));
QLabel *solnum = new QLabel("0", tab);
picctrl.snum = solnum;
solnum->move(BOT_OFFS_X + p*BOT_TOTAL_X + 2, BOT_OFFS_Y + normg*BOT_TOTAL_Y + BOT_Y + 6);
solnum->resize(BOT_X/5*2 - 4, EDIT_THICK);
solnum->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
solnum->setFrameShadow(QFrame::Sunken);
solnum->setFrameShape(QFrame::Panel);
solnum->setPalette(*m_slvPalette);
solnum->setVisible(false);
grpctrl.pics.push_back(picctrl);
}
}
}
setBuildTilesCount(m_doc->getBuild().tilesCount());
// prevent the build Help sidebar to get notifications. it might not be there yet.
// eventually the sidebar will take care of itself.
blockSignals(true);
changeToResetValues();
//.........这里部分代码省略.........
示例5: showRoomGrid
void MainWindow::showRoomGrid()
{
if(0!=Grid || 0!=scroll || 0!=layout)
{
delete Grid;
delete scroll;
delete layout;
}
layout = new QVBoxLayout();
scroll = new QScrollArea(this);
Grid = new QGridLayout(this);
Grid->setHorizontalSpacing(6);
Grid->setVerticalSpacing(6);
scroll->setLayout(Grid);
layout->addWidget(scroll);
ui->Tabs2->widget(0)->setLayout(layout);
vector<Room> Room;
QString RoomNumTitle,RoomFloor;
Room = RM.fetchAllRooms();
int RoomSize=Room.size();
int i=0,j=0;
int num=0,RoomNum=0;
while(num!=RoomSize)
{
QLabel * RoomLabel = new QLabel(this);
RoomLabel->setGeometry(0,0,310,180);
RoomLabel->setFrameShape(QFrame::Box);
RoomLabel->setFrameShadow(QFrame::Sunken);
RoomLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
RoomLabel->setFont(QFont( "Comic Sans MS", 8, QFont::Bold ));
//-----------------------------------------------------------
RoomNumTitle.setNum(Room[RoomNum].getRoomNumber());
RoomFloor.setNum(Room[RoomNum].getRoomFloor());
RoomLabel->setObjectName(RoomNumTitle);
RoomLabel->setText("Num:"+RoomNumTitle+"\n Floor:"+RoomFloor);
//-----------------------------------------------------------
if(RM.getStatus(Room[RoomNum].getRoomNumber(),QDate::currentDate(),QDate::currentDate())==false)
RoomLabel->setStyleSheet("color: white; background-color:green;");
else
RoomLabel->setStyleSheet("color: white; background-color:red;");
//-----------------------------------------------------------
RoomLabel->installEventFilter(this);
Grid->addWidget(RoomLabel,i,j);
num++;
if(j<5)
{
j++;
}
else
{
j=0;
i++;
}
RoomNum++;
}
}
示例6: getValue
QWidget *DynamicConnectionPageWindow::createDynamicWidget(WidgetType widgetType, DynamicWidgetInfo *widgetInfo) const
{
QWidget *widget = 0;
QString value = getValue(widgetInfo->attributes.value("value"));
switch(widgetType){
case Label:
{
QLabel *label = new QLabel(value);
label->setFrameShape(QFrame::StyledPanel);
label->setFrameShadow(QFrame::Sunken);
label->setTextInteractionFlags(Qt::TextSelectableByMouse|Qt::TextSelectableByKeyboard);
widget = label;
break;
}
case CheckBox:
{
QCheckBox *checkBox = new QCheckBox();
checkBox->setChecked(value == "true");
widget = checkBox;
break;
}
case ComboBox:
{
QComboBox *comboBox = new QComboBox();
QDomNodeList childNodes = widgetInfo->childNodes;
for(int i=0; i<childNodes.size(); ++i){
QDomNode e = childNodes.at(i);
Q_ASSERT(e.nodeName() == "option");
comboBox->addItem(e.attributes().namedItem("text").toAttr().value());
}
if(!value.isEmpty()){
comboBox->setCurrentIndex(value.toInt());
}
widget = comboBox;
break;
}
case RadioButton:
{
RadioButtonGroup *radioButtonGroup = new RadioButtonGroup(widgetInfo->attributes.value("caption").isEmpty() ? Qt::Horizontal : Qt::Vertical);
QDomNodeList childNodes = widgetInfo->childNodes;
for(int i=0; i<childNodes.size(); ++i){
QDomNode e = childNodes.at(i);
Q_ASSERT(e.nodeName() == "option");
QString text = e.attributes().namedItem("text").toAttr().value();
QRadioButton *radio = new QRadioButton(text);
radioButtonGroup->addRadioButton(radio);
}
if(!value.isEmpty()){
radioButtonGroup->checkRadio(value.toInt());
}
widget = radioButtonGroup;
break;
}
default:
Q_ASSERT(false);
return 0;
break;
}
QString widgetName = widgetInfo->attributes.value("name");
widget->setObjectName(widgetName);
return widget;
}
示例7: rotate
bool RotateDlg::rotate(Rotation & map)
{
Dimension dim = map.size();
assert( dim == int(d_labels.size()) );
d_buttons.resize( Extension( dim, dim ) );
const int ncol = 2;
const int nrow = (d_editAtomType)?3:2;
d_cbs.assign( dim, 0 );
QVBoxLayout* top = new QVBoxLayout(this);
top->setMargin( 10 );
QGridLayout* contents = new QGridLayout();
QHBoxLayout* buttons = new QHBoxLayout();
QLabel* l = new QLabel( d_colLabel.data(), this );
l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
l->setFrameStyle( QFrame::Panel );
l->setFrameShadow( QFrame::Sunken );
contents->addWidget( l, 0, 2, 1, dim + 1 - 2 + 1 );
l = new QLabel( d_rowLabel.data(), this );
l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
l->setFrameStyle( QFrame::Panel );
l->setFrameShadow( QFrame::Sunken );
contents->addWidget( l, nrow, 0, dim, 1 );
Dimension row;
for( row = 0; row < dim; row++ )
{
QString str;
// Set row headers
if( !d_labels[ row ].first.isEmpty() )
str.sprintf( "Dim. %s: %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row), d_labels[ row ].first.data() );
else
str.sprintf( "Dim. %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row) );
l = new QLabel( str, this );
l->setAlignment( Qt::AlignCenter | Qt::AlignVCenter );
l->setFrameStyle( QFrame::Panel );
l->setFrameShadow( QFrame::Sunken );
contents->addWidget( l, 1, row + ncol );
// Set column headers
if( !d_labels[ row ].second.isEmpty() )
str.sprintf( "Dim. %s: %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row), d_labels[ row ].second.data() );
else
str.sprintf( "Dim. %s", (d_dimLetter)?getDimLetter(row):getDimSymbol(row) );
l = new QLabel( str, this );
l->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
l->setFrameStyle( QFrame::Panel );
l->setFrameShadow( QFrame::Sunken );
contents->addWidget( l, row + nrow, 1 );
if( d_editAtomType )
{
d_cbs[ row ] = new QComboBox( this );
for( int i = AtomType::None; i <= AtomType::Lr; i++ )
d_cbs[ row ]->addItem( AtomType::s_labels[ i ] );
d_cbs[ row ]->setCurrentIndex( d_clr[ row ].getIsoType() );
contents->addWidget( d_cbs[ row ], nrow - 1, row + ncol );
}
for( Dimension col = 0; col < dim; col++ )
{
QRadioButton* b = new QRadioButton( this );
b->setAutoExclusive( false );
//b->setToggleButton( true );
contents->addWidget( b, row + nrow, col + ncol, Qt::AlignHCenter );
d_buttons.setAt( row, col, b );
connect( b, SIGNAL( toggled(bool) ), this, SLOT( toggled(bool) ) );
}
}
// Toggle erst zuletzt, da vorher noch nicht alle Buttons existieren.
for( row = 0; row < dim; row++ )
for( Dimension col = 0; col < dim; col++ )
{
if( map[ row ] == col )
d_buttons.getAt( row, col )->setChecked( true );
}
QPushButton* ok = new QPushButton( "&OK", this );
connect( ok, SIGNAL( clicked() ), SLOT( accept() ) );
buttons->addWidget( ok );
ok->setDefault( true );
QPushButton* cancel = new QPushButton( "&Cancel", this );
connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
buttons->addWidget( cancel );
top->addLayout( contents );
top->addLayout( buttons );
while( true )
{
if( exec() == QDialog::Accepted )
{
Rotation map2 = map;
bool clrOk = true;
for( int row = 0; row < dim; row++ )
{
//.........这里部分代码省略.........
示例8: QWidget
WidgetImage::WidgetImage(QWidget *parent) : QWidget(parent), toolbar(0),
statusbar(0), paintWnd(0), scrollArea(0), zoomBox(0) {
toolbar = new QToolBar(tr("Image"),this);
statusbar = new QStatusBar(this);
paintWnd = new PaintWidget();
scrollArea = new QScrollArea(this);
scrollArea->setWidget(paintWnd);
scrollArea->setWidgetResizable(true);
QAction* action = new QAction(QIcon(":/icons/resources/save.png"),tr("Save Image"),toolbar);
connect(action,SIGNAL(triggered()),paintWnd,SLOT(saveImage()));
toolbar->addAction(action);
toolbar->addSeparator();
action = new QAction(QIcon(":/icons/resources/arrow_in.png"),tr("Fit to Window"),toolbar);
action->setCheckable(true);
action->setChecked(true);
connect(action,SIGNAL(triggered(bool)),this,SLOT(toggleFitToWindow(bool)));
connect(action,SIGNAL(triggered(bool)),paintWnd,SLOT(toggleFitToWindow(bool)));
toolbar->addAction(action);
action = new QAction(QIcon(":/icons/resources/zoom_100.png"),tr("Zoom 100%"),toolbar);
action->setEnabled(false);
connect(action,SIGNAL(triggered()),paintWnd,SLOT(zoomImage100()));
toolbar->addAction(action);
zoomBox = new QSpinBox(toolbar);
zoomBox->setToolTip(tr("Zoom Image"));
zoomBox->setRange(0,999);
zoomBox->setSingleStep(10);
zoomBox->setSuffix("%");
zoomBox->setButtonSymbols(QAbstractSpinBox::PlusMinus);
zoomBox->setEnabled(false);
connect(zoomBox,SIGNAL(valueChanged(int)),paintWnd,SLOT(zoomImage(int)));
connect(paintWnd,SIGNAL(setZoom(int)),zoomBox,SLOT(setValue(int)));
toolbar->addWidget(zoomBox);
QLabel* typeLabel = new QLabel(statusbar);
typeLabel->setTextFormat(Qt::PlainText);
typeLabel->setTextInteractionFlags(Qt::NoTextInteraction);
typeLabel->setFrameShadow(QFrame::Sunken);
statusbar->addPermanentWidget(typeLabel);
QLabel* sizeLabel = new QLabel(statusbar);
sizeLabel->setTextFormat(Qt::PlainText);
sizeLabel->setTextInteractionFlags(Qt::NoTextInteraction);
sizeLabel->setFrameShadow(QFrame::Sunken);
statusbar->addPermanentWidget(sizeLabel);
QLabel* posLabel = new QLabel(statusbar);
posLabel->setTextFormat(Qt::PlainText);
posLabel->setTextInteractionFlags(Qt::NoTextInteraction);
posLabel->setFrameShape(QFrame::NoFrame);
statusbar->addWidget(posLabel,1);
connect(paintWnd,SIGNAL(setStatusMsg(QString,int)),statusbar,SLOT(showMessage(QString,int)),Qt::QueuedConnection);
connect(paintWnd,SIGNAL(printImageSize(QString)),sizeLabel,SLOT(setText(QString)),Qt::QueuedConnection);
connect(paintWnd,SIGNAL(printImageType(QString)),typeLabel,SLOT(setText(QString)),Qt::QueuedConnection);
connect(paintWnd,SIGNAL(printImagePos(QString)),posLabel,SLOT(setText(QString)),Qt::QueuedConnection);
QVBoxLayout* layout = new QVBoxLayout();
layout->addWidget(toolbar);
layout->addWidget(scrollArea,1);
layout->addWidget(statusbar);
layout->setSpacing(0);
layout->setContentsMargins(0,0,0,0);
setLayout(layout);
}