本文整理汇总了C++中QScrollArea::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::setObjectName方法的具体用法?C++ QScrollArea::setObjectName怎么用?C++ QScrollArea::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::setObjectName方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupUi
void TwitterApiShowThread::setupUi()
{
kDebug();
QVBoxLayout *gridLayout;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QVBoxLayout *verticalLayout_2;
QSpacerItem *verticalSpacer;
gridLayout = new QVBoxLayout(this);
gridLayout->setMargin(0);
gridLayout->setObjectName("gridLayout");
scrollArea = new QScrollArea(this);
scrollArea->setObjectName("scrollArea");
scrollArea->setFrameShape(QFrame::NoFrame);
scrollArea->setWidgetResizable(true);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName("scrollAreaWidgetContents");
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 254, 300));
verticalLayout_2 = new QVBoxLayout(scrollAreaWidgetContents);
verticalLayout_2->setMargin(1);
d->mainLayout = new QVBoxLayout();
verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
d->mainLayout->addItem(verticalSpacer);
d->mainLayout->setSpacing(3);
d->mainLayout->setMargin(1);
verticalLayout_2->addLayout(d->mainLayout);
scrollArea->setWidget(scrollAreaWidgetContents);
gridLayout->addWidget(scrollArea);
}
示例2: QWidget
NotifyManager::NotifyManager(QWidget *parent) :
QWidget(parent),
m_dbus(new Notification("com.deepin.dde.Notification", "/com/deepin/dde/Notification", QDBusConnection::sessionBus(), this))
{
QWidget *widget = new QWidget;
m_connectLayout = new QVBoxLayout(widget);
m_connectLayout->setMargin(0);
m_connectLayout->setSpacing(1);
m_connectLayout->addStretch();
QScrollArea *scrollarea = new QScrollArea;
scrollarea->setWidget(widget);
scrollarea->setObjectName("scrollarea");
scrollarea->setWidgetResizable(true);
scrollarea->setFocusPolicy(Qt::NoFocus);
scrollarea->setFrameStyle(QFrame::NoFrame);
scrollarea->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Expanding);
scrollarea->setContentsMargins(0, 0, 0, 0);
scrollarea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollarea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollarea->setStyleSheet("background-color:transparent;");
QScrollBar *bar = scrollarea->verticalScrollBar();
connect(bar, &QScrollBar::valueChanged, this, [=](int value){
if (m_checkIndex && value == bar->maximum())
onLoadAgain();
});
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->setMargin(0);
mainLayout->setSpacing(0);
m_clearButton = new DImageButton;
m_clearButton->setText(tr("Clear all"));
m_clearButton->setStyleSheet("padding: 4px 0;");
mainLayout->addWidget(m_clearButton, 0, Qt::AlignHCenter);
mainLayout->addWidget(scrollarea);
setLayout(mainLayout);
m_clearButton->setVisible(false);
connect(m_clearButton, &DImageButton::clicked, this, &NotifyManager::onCloseAllItem);
connect(m_dbus, &Notification::RecordAdded, this, &NotifyManager::onNotifyAdded);
m_dbus->setSync(false);
QDBusPendingReply<QString> notify = m_dbus->GetAllRecords();
QDBusPendingCallWatcher *notifyWatcher = new QDBusPendingCallWatcher(notify, this);
connect(notifyWatcher, &QDBusPendingCallWatcher::finished, this, &NotifyManager::onNotifyGetAllFinished);
}
示例3: sansFont
observateurTexte::observateurTexte(Othello * othellier, QPoint pos) : QLabel(){
setWindowTitle("Observateur Texte");
this->move(pos.x() + 300, pos.y());
Qt::WindowFlags flags = 0;
QFont sansFont("Lucida Console", 12); //police à utiliser
sansFont.setWordSpacing(5);
flags |= Qt::CustomizeWindowHint;
flags |= Qt::WindowTitleHint;
setWindowFlags(flags);
this->setMinimumWidth(650);
this->setFont(sansFont); //défini la police
QHBoxLayout *horizontalLayout;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QVBoxLayout *verticalLayout;
horizontalLayout = new QHBoxLayout(this);
horizontalLayout->setSpacing(6);
horizontalLayout->setContentsMargins(11, 11, 11, 11);
horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
vuePlateau = new QLabel(this);
vuePlateau->setObjectName(QString::fromUtf8("vuePlateau"));
horizontalLayout->addWidget(vuePlateau);
scrollArea = new QScrollArea(this);
//scrollArea->setFixedWidth(185);
scrollArea->setMinimumWidth(185);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setWidgetResizable(true);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 285, 642));
verticalLayout = new QVBoxLayout(scrollAreaWidgetContents);
verticalLayout->setSpacing(6);
verticalLayout->setContentsMargins(11, 11, 11, 11);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
listeCoups = new QLabel(scrollAreaWidgetContents);
listeCoups->setObjectName(QString::fromUtf8("listeCoups"));
listeCoups->setAlignment(Qt::AlignLeft|Qt::AlignTop);
verticalLayout->addWidget(listeCoups);
scrollArea->setWidget(scrollAreaWidgetContents);
vuePlateau->raise();
listeCoups->raise();
horizontalLayout->addWidget(scrollArea);
oth = othellier;
}
示例4: Pages
/*
* Constructor for the class
*/
JobList::JobList(const QString &mediaName, const QString &clientName,
const QString &jobName, const QString &filesetName, QTreeWidgetItem *parentTreeWidgetItem)
: Pages()
{
setupUi(this);
m_name = "Jobs Run"; /* treeWidgetName has a virtual override in this class */
m_mediaName = mediaName;
m_clientName = clientName;
m_jobName = jobName;
m_filesetName = filesetName;
pgInitialize("", parentTreeWidgetItem);
QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/emblem-system.png")));
m_resultCount = 0;
m_populated = false;
m_closeable = false;
if ((m_mediaName != "") || (m_clientName != "") || (m_jobName != "") || (m_filesetName != "")) {
m_closeable=true;
}
m_checkCurrentWidget = true;
/* Set Defaults for check and spin for limits */
limitCheckBox->setCheckState(mainWin->m_recordLimitCheck ? Qt::Checked : Qt::Unchecked);
limitSpinBox->setValue(mainWin->m_recordLimitVal);
daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
daysSpinBox->setValue(mainWin->m_daysLimitVal);
QGridLayout *gridLayout = new QGridLayout(this);
gridLayout->setSpacing(6);
gridLayout->setMargin(9);
gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
m_splitter = new QSplitter(Qt::Vertical, this);
QScrollArea *area = new QScrollArea();
area->setObjectName(QString::fromUtf8("area"));
area->setWidget(frame);
area->setWidgetResizable(true);
m_splitter->addWidget(area);
m_splitter->addWidget(mp_tableWidget);
gridLayout->addWidget(m_splitter, 0, 0, 1, 1);
createConnections();
readSettings();
if (m_closeable) { dockPage(); }
}
示例5: createLayout
void SyncMeasuresDialog::createLayout()
{
setWindowTitle("Updates Available in Library");
setModal(true);
setSizeGripEnabled(true);
setObjectName("BlueGradientWidget");
// The central pane
m_centralWidget = new SyncMeasuresDialogCentralWidget(m_project, m_measureManager);
connect(m_centralWidget, &SyncMeasuresDialogCentralWidget::componentClicked, this, &SyncMeasuresDialog::on_componentClicked);
connect(m_centralWidget, &SyncMeasuresDialogCentralWidget::noComponents, this, &SyncMeasuresDialog::on_noComponents);
connect(m_centralWidget, &SyncMeasuresDialogCentralWidget::closeDlg, this, &SyncMeasuresDialog::closeDlg);
QScrollArea * centralScrollArea = new QScrollArea(this);
centralScrollArea->setFrameStyle(QFrame::NoFrame);
centralScrollArea->setObjectName("GrayWidget");
centralScrollArea->setWidgetResizable(true);
centralScrollArea->setWidget(m_centralWidget);
// The right pane
m_rightScrollArea = new QScrollArea(this);
m_rightScrollArea->setFrameStyle(QFrame::NoFrame);
m_rightScrollArea->setObjectName("GrayWidget");
m_rightScrollArea->setWidgetResizable(true);
QSplitter * splitter = new QSplitter(this);
splitter->setOrientation(Qt::Horizontal);
splitter->addWidget(centralScrollArea);
splitter->addWidget(m_rightScrollArea);
QHBoxLayout * mainLayout = new QHBoxLayout();
mainLayout->addWidget(splitter);
setLayout(mainLayout);
m_centralWidget->lowerPushButton->setFocus();
}
示例6: QGroupBox
//selectedFeaturesPage::selectedFeaturesPage(QButtonGroup *fGroup, QWidget *parent)
// : QWizardPage(parent)
//{
// setTitle(tr("Selected Features"));
//
// QVBoxLayout *layout = new QVBoxLayout;
// layout->addWidget( initFeatureBox(fGroup) );
// setLayout(layout);
//}
QGroupBox * FeaturesPage::initFeatureBox(QButtonGroup *fGroup)
{
featureGroup = fGroup;
QGroupBox *groupBox = new QGroupBox(tr("Features"));
groupBox->setObjectName("Features");
QVBoxLayout *featureLayout = new QVBoxLayout;
QHBoxLayout *selLayout = new QHBoxLayout;
QLabel *selLabel = new QLabel(tr("Select:"));
QPushButton *allButton = new QPushButton(tr("All"));
allButton->setObjectName("allButton");
QPushButton *nonButton = new QPushButton(tr("None"));
nonButton->setObjectName("nonButton");
connect(allButton, SIGNAL(clicked()), this, SLOT(selectAll()));
connect(nonButton, SIGNAL(clicked()), this, SLOT(selectNone()));
selLayout->addWidget(selLabel);
selLayout->addWidget(allButton);
selLayout->addWidget(nonButton);
selLayout->addStretch(10);
featureLayout->addLayout(selLayout);
QWidget *groupWidget = new QWidget;
groupWidget->setObjectName("groupWidget");
QVBoxLayout *vLayout = new QVBoxLayout;
QList<QAbstractButton *> buttons = featureGroup->buttons();
for(int b = 0; b<buttons.size(); ++b)
{
vLayout->addWidget( buttons.at(b) );
}
groupWidget->setLayout(vLayout);
QScrollArea *scrollArea = new QScrollArea;
scrollArea->setObjectName("scrollArea");
scrollArea->setWidget(groupWidget);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
featureLayout->addWidget(scrollArea);
groupBox->setLayout(featureLayout);
return groupBox;
}
示例7: sizePolicy
AxisDetailsWidget::AxisDetailsWidget(QWidget* parent,
Animation &animation,
Axis &axis,
Engine& engine) :
ColourGroupGroupWidget(parent, engine),
iAxis(axis),
iAnimation(animation),
iFramesListX(0),
iFramesListWidth(0),
iFrameSlider(NULL),
iGridLayout(NULL) {
iGridLayout = new QGridLayout();
iGridLayout->setObjectName(QString::fromUtf8("gridLayout"));
QSpacerItem* verticalSpacer = new QSpacerItem(20, 115, QSizePolicy::Minimum, QSizePolicy::Expanding);
QScrollArea* scrollArea = new QScrollArea(this);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setWidgetResizable(true);
scrollArea->setFrameStyle(QFrame::Box);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
iScrollAreaWidgetContents = new ScrollContentsWidget(this, animation, axis);
iScrollAreaWidgetContents->setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));
iScrollAreaWidgetContents->setGeometry(QRect(0, 0, 531, 305));
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy.setHorizontalStretch(0);
sizePolicy.setVerticalStretch(0);
sizePolicy.setHeightForWidth(iScrollAreaWidgetContents->sizePolicy().hasHeightForWidth());
iScrollAreaWidgetContents->setSizePolicy(sizePolicy);
scrollArea->setWidget(iScrollAreaWidgetContents);
QVBoxLayout* scrollAreaLayout = new QVBoxLayout(iScrollAreaWidgetContents);
scrollAreaLayout->setObjectName(QString::fromUtf8("scrollAreaLayout"));
scrollAreaLayout->addLayout(iGridLayout);
scrollAreaLayout->addItem(verticalSpacer);
iGridLayout->setVerticalSpacing(FRAME_SPACING);
iFrameSlider = new QSlider(this);
iFrameSlider->setObjectName(QString::fromUtf8("horizontalSlider"));
iFrameSlider->setOrientation(Qt::Horizontal);
iFrameSlider->setMinimum(iAxis.lowValue());
iFrameSlider->setMaximum(iAxis.highValue());
iFrameSlider->setTickPosition(QSlider::TicksBelow);
iFrameSlider->setPageStep(1);
iFrameSlider->setSingleStep(1);
//iGridLayout->addWidget(iFrameSlider, 0, 1, 1, 1);
iCloseAll = new QToolButton(this);
iCloseAll->setObjectName(QString::fromUtf8("closeAll"));
iCloseAll->setIcon(QIcon(":/images/delete.png"));
iCloseAll->setEnabled(false);
connect(iCloseAll, SIGNAL(clicked()), this, SLOT(closeAllClicked()));
// iGridLayout->addWidget(iCloseAll, 0, 2, 1, 1);
QHBoxLayout* topHorizontalLayout = new QHBoxLayout();
topHorizontalLayout->setObjectName(QString::fromUtf8("topHorizontalLayout"));
iSliderSpacer = new QSpacerItem(LED_LABEL_WIDTH + SCROLL_AREA_MARGIN + SLIDER_TICK_OFFSET, iFrameSlider->height(), QSizePolicy::Fixed, QSizePolicy::Fixed);
topHorizontalLayout->addWidget(iCloseAll);
topHorizontalLayout->addItem(iSliderSpacer);
topHorizontalLayout->addWidget(iFrameSlider);
topHorizontalLayout->addItem(new QSpacerItem(SCROLL_AREA_MARGIN + SLIDER_TICK_OFFSET, iFrameSlider->height(), QSizePolicy::Fixed, QSizePolicy::Fixed));
QVBoxLayout* contentsLayout = new QVBoxLayout();
contentsLayout->setObjectName(QString::fromUtf8("contentsLayout"));
contentsLayout->addLayout(topHorizontalLayout);
contentsLayout->addWidget(scrollArea);
QHBoxLayout* mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QString::fromUtf8("mainLayout"));
mainLayout->addLayout(contentsLayout);
setAcceptDrops(true);
connect(iFrameSlider, SIGNAL(valueChanged(int)), &axis, SLOT(setCurrentFrame(int)));
}
示例8: setup
// Setup widget
void MyWidget::setup(int layoutMargin, QString borderColor, QString backgroundColor) {
// Some styling
visibleArea = QSize(600,400);
this->borderColor = borderColor;
this->backgroundColor = (backgroundColor == "" ? "rgba(0,0,0,200)" : backgroundColor);
borderLeftRight = -1;
borderTopDown = -1;
fullscreen = false;
// The different QRects
rectShown = QRect();
rectHidden = QRect(0,-10,10,10);
rectAni = QRect();
// The current geometry and position
isShown = false;
this->setGeometry(rectHidden);
// Fading
backOpacityShow = 0.5;
backOpacityCur = 0;
centerOpacityCur = 0;
fade = new QTimeLine;
fadeIN = true;
fadeEffectCenter = new QGraphicsOpacityEffect;
connect(fade, SIGNAL(valueChanged(qreal)), this, SLOT(fadeStep()));
connect(fade, SIGNAL(finished()), this, SLOT(aniFinished()));
// The current widget look
this->setStyleSheet(QString("background: rgba(0,0,0,%1);").arg(255*backOpacityShow));
// the central widget containing all the information
center = new QWidget(this);
center->setGraphicsEffect(fadeEffectCenter);
center->setObjectName("center");
// For some reason, if the border is not defined right here at the beginning, it wont be visible...
if(borderColor == "")
center->setStyleSheet(QString("#center { background: %1; border-radius: 10px; font-size: 12pt; }").arg(this->backgroundColor));
else
center->setStyleSheet(QString("#center {background: %1; border-radius: 15px; font-size: 12pt; border: 2px solid %2; }").arg(this->backgroundColor).arg(borderColor));
// Create and set the scrollarea with main layout
QVBoxLayout *central = new QVBoxLayout;
central->setMargin(layoutMargin);
QScrollArea *scroll = new QScrollArea(this);
scroll->setObjectName("scrollWidget");
scroll->setStyleSheet("QWidget#scrollWidget { background: transparent; padding-bottom: 3px; border-radius: 0px; }");
QWidget *scrollWidget = new QWidget(scroll->widget());
scrollWidget->setStyleSheet("background: transparent;");
scroll->setWidgetResizable(true);
scroll->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
scrollWidget->setLayout(central);
scroll->setWidget(scrollWidget);
mainlayout = new QVBoxLayout;
if(layoutMargin == 0) mainlayout->setMargin(0);
center->setLayout(mainlayout);
mainlayout->addWidget(scroll);
// This widget gets the main layout set to
centralWidget = new QWidget;
central->addWidget(centralWidget);
// And set the custom scrollbar
scrollbar = new CustomScrollbar;
scroll->setVerticalScrollBar(scrollbar);
// And in case the monitor resolution is so small, that the horizontal scrollbar is visible:
CustomScrollbar *scrollbarHor = new CustomScrollbar;
scroll->setHorizontalScrollBar(scrollbarHor);
}
示例9: clicked
HelpPanel::HelpPanel(QWidget * parent)
: QFrame(parent)
{
class PrivateSubscriberClose
: public QObject
, private SubscribablePushButton::Subscriber
{
public:
~PrivateSubscriberClose()
{
}
PrivateSubscriberClose(SubscribablePushButton * pushButton)
: QObject(pushButton)
, SubscribablePushButton::Subscriber(pushButton)
{
}
private:
void clicked(bool checked)
{
MainWindow::instance().showFrame(MainWindow::MainFrameIndex);
}
};
QBoxLayout * topLayout = new QVBoxLayout();
setLayout(topLayout);
QFormLayout * formLayout = new QFormLayout();
QFrame * buttonsWidget = new QFrame(NULL);
buttonsWidget->setLayout(formLayout);
buttonsWidget->setObjectName("helpButtonsWidget");
buttonsWidget->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
SubscribablePushButton * moveShipButton = new SubscribablePushButton(NULL, tr("M"));
moveShipButton->setObjectName("move");
SubscribablePushButton * colonizeButton = new SubscribablePushButton(NULL, tr("C"));
colonizeButton->setObjectName("colonize");
SubscribablePushButton * loadButton = new SubscribablePushButton(NULL, tr("L"));
loadButton->setObjectName("load");
SubscribablePushButton * unloadButton = new SubscribablePushButton(NULL, tr("U"));
unloadButton->setObjectName("unload");
SubscribablePushButton * buildShipButton = new SubscribablePushButton(NULL, tr("B.."));
buildShipButton->setObjectName("build");
SubscribablePushButton * nextTurnButton = new SubscribablePushButton(NULL, tr("T"));
nextTurnButton->setObjectName("turn");
SubscribablePushButton * shipDesignButton = new SubscribablePushButton(NULL, tr("D.."));
shipDesignButton->setObjectName("design");
SubscribablePushButton * researchButton = new SubscribablePushButton(NULL, tr("R.."));
researchButton->setObjectName("research");
SubscribablePushButton * newButton = new SubscribablePushButton(NULL, tr("N.."));
newButton->setObjectName("new");
SubscribablePushButton * openButton = new SubscribablePushButton(NULL, tr("O.."));
openButton->setObjectName("open");
SubscribablePushButton * saveButton = new SubscribablePushButton(NULL, tr("S.."));
saveButton->setObjectName("save");
SubscribablePushButton * quitButton = new SubscribablePushButton(NULL, tr("Q"));
quitButton->setObjectName("quit");
SubscribablePushButton * helpButton = new SubscribablePushButton(NULL, tr("H.."));
helpButton->setObjectName("help");
SubscribablePushButton * setupButton = new SubscribablePushButton(NULL, tr("S.."));
setupButton->setObjectName("setup");
SubscribablePushButton * flagButton = new SubscribablePushButton(NULL, tr("F"));
flagButton->setObjectName("flag");
formLayout->addRow(newButton, new QLabel("Start a new game."));
formLayout->addRow(openButton, new QLabel("Open a saved game."));
formLayout->addRow(saveButton, new QLabel("Save current game."));
formLayout->addRow(quitButton, new QLabel("Quit the program."));
formLayout->addRow(helpButton, new QLabel("This help panel."));
formLayout->addRow(setupButton, new QLabel("Setup panel."));
formLayout->addRow(flagButton, new QLabel("Center map on your home system."));
formLayout->addRow(moveShipButton, new QLabel("Move selected ship."));
formLayout->addRow(loadButton, new QLabel("Load population from planet to selected ship."));
formLayout->addRow(unloadButton, new QLabel("Unload population from selected ship to planet."));
formLayout->addRow(colonizeButton, new QLabel("Order selected ship to colonize planet."));
formLayout->addRow(buildShipButton, new QLabel("Create a build order for an existing ship design."));
formLayout->addRow(shipDesignButton, new QLabel("Create a new ship design."));
formLayout->addRow(researchButton, new QLabel("Research new technologies."));
formLayout->addRow(nextTurnButton, new QLabel("Advance time by one month."));
QScrollArea * scrollArea = new QScrollArea();
scrollArea->setWidget(buttonsWidget);
scrollArea->setWidgetResizable(true);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scrollArea->setObjectName("helpButtonsScrollArea");
topLayout->addWidget(scrollArea);
QsKineticScroller * kineticScroller = new QsKineticScroller(scrollArea);
kineticScroller->enableKineticScrollFor(scrollArea);
QBoxLayout * buttonLayout = new QHBoxLayout();
topLayout->addItem(buttonLayout);
SubscribablePushButton * closeButton = new SubscribablePushButton(this, tr("Close"));
closeButton->setObjectName("closeButton");
new PrivateSubscriberClose(closeButton);
//.........这里部分代码省略.........
示例10: QWidget
AdvancedScriptManager::AdvancedScriptManager(QWidget* parent) : QWidget(parent) {
QHBoxLayout* hLayout = new QHBoxLayout(this);
setLayout(hLayout);
QVBoxLayout* vLayout2 = new QVBoxLayout(this);
hLayout->addLayout(vLayout2);
lstCategories = new QListWidget;
lstCategories->setMaximumSize(200,9999);
lstCategories->setMinimumSize(0,0);
vLayout2->addWidget(lstCategories);
addScript = new KPushButton;
addScript->setText("Add Script");
vLayout2->addWidget(addScript);
manageCategories = new KPushButton;
manageCategories->setText("Manage Categories");
vLayout2->addWidget(manageCategories);
QVBoxLayout* vLayout = new QVBoxLayout(this);
hLayout->addLayout(vLayout);
tblScript = new QTableWidget;
if (tblScript->columnCount() < 7)
tblScript->setColumnCount(7);
tblScript->verticalHeader()->hide();
tblScript->setSelectionBehavior(QAbstractItemView::SelectRows);
vLayout->addWidget(tblScript);
tabDetails = new QTabWidget;
tabDetails->setMaximumSize(9999,175);
vLayout->addWidget(tabDetails);
tabDescriptionContent = new QWidget;
tabDetails->addTab(tabDescriptionContent, "Description");
QVBoxLayout* vLayout3 = new QVBoxLayout(tabDescriptionContent);
tabDescriptionContent->setLayout(vLayout3);
lblDescription = new QLabel();
lblDescription->setAlignment(Qt::AlignTop);
lblDescription->setWordWrap(true);
QScrollArea *scrollArea = new QScrollArea(this);
scrollArea->setObjectName(QString::fromUtf8("scrollArea"));
scrollArea->setFrameShape(QFrame::StyledPanel);
scrollArea->setWidgetResizable(true);
scrollArea->setWidget(lblDescription);
vLayout3->addWidget(scrollArea);
tabInfoContent = new QWidget;
tabDetails->addTab(tabInfoContent, "Information");
QGridLayout* aGridLayout = new QGridLayout();
tabInfoContent->setLayout(aGridLayout);
lblName = new QLabel("<b>Script name: </b>");
lblName->setWordWrap(true);
aGridLayout->addWidget(lblName,0,0);
lblNameValue = new QLabel();
lblNameValue->setWordWrap(true);
aGridLayout->addWidget(lblNameValue,0,1);
lblExecNb = new QLabel("<b>Executed: </b>");
lblExecNb->setWordWrap(true);
aGridLayout->addWidget(lblExecNb,1,0);
lblExecNbValue = new QLabel("0 time");
lblExecNbValue->setWordWrap(true);
aGridLayout->addWidget(lblExecNbValue,1,1);
lblCreation = new QLabel("<b>Created: </b>");
lblCreation->setWordWrap(true);
aGridLayout->addWidget(lblCreation,0,2);
lblCreationValue = new QLabel();
lblCreationValue->setWordWrap(true);
aGridLayout->addWidget(lblCreationValue,0,3);
lblNbEdition = new QLabel("<b>Edited: </b>");
lblNbEdition->setWordWrap(true);
aGridLayout->addWidget(lblNbEdition,1,2);
lblNbEditionValue = new QLabel("0 time");
lblNbEditionValue->setWordWrap(true);
aGridLayout->addWidget(lblNbEditionValue,1,3);
lblLastEditDate = new QLabel("<b>Last edition: </b>");
lblLastEditDate->setWordWrap(true);
aGridLayout->addWidget(lblLastEditDate,2,0);
lblLastEditDateValue = new QLabel();
lblLastEditDateValue->setWordWrap(true);
aGridLayout->addWidget(lblLastEditDateValue,2,1);
lblMoyExecTime = new QLabel("<b>Moy. exec time:");
lblMoyExecTime->setWordWrap(true);
aGridLayout->addWidget(lblMoyExecTime,2,2);
lblMoyExecTimeValue = new QLabel();
lblMoyExecTimeValue->setWordWrap(true);
//.........这里部分代码省略.........
示例11: DropArea
ProcessImage::ProcessImage( QWidget* parent ): DropArea(parent), _currentItem(-1), _currentImage(-1)
{
layout = new QHBoxLayout( this );
layout->setContentsMargins(0,0,0,0);
layout->setSpacing(0);
QFrame *processLeftColFrame = new QFrame();
processLeftColFrame->setObjectName( "processLeftColFrame" );
QVBoxLayout *leftLayout = new QVBoxLayout( processLeftColFrame );
layout->addWidget( processLeftColFrame );
QHBoxLayout *topLayout = new QHBoxLayout();
topLayout->addWidget( backButton = new QPushButton( this ) );
backButton->setText( "Choisir un autre media" );
backButton->setObjectName("backButton");
connect(backButton, SIGNAL(clicked()), SLOT(onBackButtonClicked()) );
topLayout->addWidget( newSearch = new QPushButton( "Nouvelle recherche" ) );
newSearch->setObjectName("newSearch");
connect( newSearch, SIGNAL(clicked()), SLOT(onNewSearch()) );
topLayout->addStretch(0);
topLayout->addWidget( nbFacesLbl = new QLabel( this ) );
nbFacesLbl->setObjectName( "nbFacesLbl" );
/*
overlap = new QLabel( this );
overlap->setObjectName( "overlapLoader" );
QMovie *loaderMovie = new QMovie(":/res/loader.gif");
overlap->setMovie( loaderMovie );
loaderMovie->start()
*/
// overlap->setGeometry( imageLbl->geometry() );
// topLayout->addWidget( overlap );
leftLayout->addLayout( topLayout );
leftLayout->addWidget( theater = new Theater( this ) );
theater->imageOverlay->setOverlayText("Traitement en cours...");
connect( theater, SIGNAL(rectClicked(int)), SLOT(onPersonSelected(int)) );
QScrollArea *imagesScrollArea = new QScrollArea( this );
leftLayout->addWidget( imagesScrollArea );
imagesScrollArea->setWidgetResizable( true );
imagesScrollArea->setObjectName( "imagesScrollArea" );
imagesScrollArea->setWidget( showCase = new ShowCase( this ) );
connect( showCase, SIGNAL(imageSelected(int)), SLOT(loadImageData(int)) );
// COL 3
layout->addWidget( sidePanel = new SidePanel(this, "view") );
connect(sidePanel, SIGNAL(confirmChanges(QJsonObject)), SLOT(savePanelChanges(QJsonObject)) );
connect( sidePanel, SIGNAL(confirmPerson()), SLOT( onConfirmPerson()) );
connect( sidePanel, SIGNAL(refutePerson()), SLOT( onRefutePerson()) );
//COL2
QVBoxLayout* col2 = new QVBoxLayout();
col2->setSpacing(0);
col2->addWidget( detectedFacesScrollArea = new QScrollArea( this ) );
detectedFacesScrollArea->setWidgetResizable( true );
detectedFacesScrollArea->setObjectName( "detectedFacesScrollArea" );
detectedFacesScrollArea->setWidget( detectedFaces = new DetectedFaces( this ) );
layout->addLayout( col2 );
connect( detectedFaces, SIGNAL(itemClicked(int)), SLOT(onPersonSelected(int)) );
connect( &Socket::sock(), SIGNAL(faceRecognized(int, int, int, int, int, int)), SLOT(onFaceRecognized(int, int, int, int, int, int)) );
connect( &Socket::sock(), SIGNAL(faceIs(int, QString, QString)), SLOT(onFaceIs(int, QString, QString)) );
connect( &Socket::sock(), SIGNAL(got(QJsonObject, QByteArray)), sidePanel, SLOT(populate(QJsonObject, QByteArray)) );
}
示例12: init
void MainPanel::init()
{
if (!db.init())
{
QMessageBox error;
error.critical(0, "Error!", "An error occured while trying to load the database.");
exit(EXIT_FAILURE);
return;
}
stack = new QStackedWidget(this);
QString style = getStylesheet(":/Styles/Content.css");
// Prepare UI objects for each tab
libraryPtr = new Library(db);
libraryPtr->setStyleSheet(style);
browserPtr = new Browser();
browserPtr->setStyleSheet(style);
stack->addWidget(libraryPtr);
stack->addWidget(browserPtr);
stack->setCurrentWidget(libraryPtr);
// System layout
QHBoxLayout* systemLayout = new QHBoxLayout;
systemLayout->setSpacing(0);
systemLayout->setMargin(8);
// Header spacing
QVBoxLayout* topLayout = new QVBoxLayout;
topLayout->setMargin(0);
// Header layout
QHBoxLayout* headerLayout = new QHBoxLayout;
headerLayout->setSpacing(0);
headerLayout->setMargin(0);
// Window title
QLabel* windowTitle = new QLabel(this);
windowTitle->setObjectName("windowTitle");
windowTitle->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
windowTitle->setMinimumWidth(175);
windowTitle->setMaximumWidth(175);
windowTitle->setAlignment(Qt::AlignTop);
windowTitle->setFont(QFont("Sansation", 18));
windowTitle->setText("Project \nASCENSION");
windowTitle->setStyleSheet("color: #7D818C;");
windowTitle->setAttribute(Qt::WA_TransparentForMouseEvents);
// Post-initialization header spacing
topLayout->addLayout(systemLayout);
topLayout->addLayout(headerLayout);
topLayout->addSpacing(10);
headerLayout->addSpacing(20);
headerLayout->addWidget(windowTitle);
headerLayout->addSpacing(40);
// Header tabs
libraryTab = new TabLabel(this);
libraryTab = g_tabFactory(libraryTab, "libraryTab", "LIBRARY");
headerLayout->addSpacing(8);
headerLayout->addWidget(libraryTab);
libraryTab->setStyleSheet("font-weight: bold; color: lightgreen;");
storeTab = new TabLabel(this);
storeTab = g_tabFactory(storeTab, "storeTab", " STORE");
headerLayout->addSpacing(8);
headerLayout->addWidget(storeTab);
modsTab = new TabLabel(this);
modsTab = g_tabFactory(modsTab, "modsTab", " MODS");
headerLayout->addSpacing(8);
headerLayout->addWidget(modsTab);
newsTab = new TabLabel(this);
newsTab = g_tabFactory(newsTab, "newsTab", "NEWS");
headerLayout->addSpacing(8);
headerLayout->addWidget(newsTab);
browserTab = new TabLabel(this);
browserTab = g_tabFactory(browserTab, "browserTab", "BROWSER");
headerLayout->addSpacing(8);
headerLayout->addWidget(browserTab);
activeTab = libraryTab;
headerLayout->addStretch();
// System buttons
systemLayout->addStretch();
// Minimize
QPushButton* pushButtonMinimize = new QPushButton("", this);
pushButtonMinimize->setObjectName("pushButtonMinimize");
systemLayout->addWidget(pushButtonMinimize);
QObject::connect(pushButtonMinimize, SIGNAL(clicked()), this, SLOT(pushButtonMinimize()));
// Maximize
QPushButton* pushButtonMaximize = new QPushButton("", this);
pushButtonMaximize->setObjectName("pushButtonMaximize");
//.........这里部分代码省略.........
示例13: addTab
void addTab(std::string tabName, ImageStorage* imgstore, Ui::MainWindow *ui)
{
/*ui->processBtn->setEnabled(true);
ui->previousBtn->setEnabled(true);*/
QWidget *tab = new QWidget();
QString qname = QString::fromStdString(tabName);
tab->setObjectName(qname);
QHBoxLayout *horizontalLayout = new QHBoxLayout(tab);
horizontalLayout->setSpacing(6);
horizontalLayout->setContentsMargins(11, 11, 11, 11);
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
QScrollArea * scrollArea = new QScrollArea(tab);
scrollArea->setObjectName(QStringLiteral("scrollArea"));
scrollArea->setWidgetResizable(true);
QWidget * scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 492, 447));
QHBoxLayout* horizontalLayout_13 = new QHBoxLayout(scrollAreaWidgetContents);
horizontalLayout->setSpacing(6);
horizontalLayout_13->setContentsMargins(11, 11, 11, 11);
horizontalLayout_13->setObjectName(QStringLiteral("horizontalLayout_13"));
QLabel* label = new QLabel(scrollAreaWidgetContents);
std::string stmp = tabName;
stmp.append("_label");
QString qname2 = QString::fromStdString(stmp);
label->setObjectName(qname2);
QSizePolicy sizePolicy2(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy2.setHorizontalStretch(0);
sizePolicy2.setVerticalStretch(0);
sizePolicy2.setHeightForWidth(label->sizePolicy().hasHeightForWidth());
label->setSizePolicy(sizePolicy2);
horizontalLayout_13->addWidget(label);
scrollArea->setWidget(scrollAreaWidgetContents);
horizontalLayout->addWidget(scrollArea);
ui->imageTab->addTab(tab, QString());
std::string tmp1 = tabName.c_str();
const char* tmp2 = tmp1.c_str();
ui->imageTab->setTabText(ui->imageTab->indexOf(tab), QApplication::translate("MainWindow", tmp2, 0));
ui->imageTab->setCurrentIndex(ui->imageTab->indexOf(tab));
//-------------------------
//---------------------
//display image
cv::Mat image = std::get<1>(imgstore->getCurrent()->second);
QImage img;
if(image.channels() == 3) // RGB image
{
//cvtColor(image, image, CV_BGR2RGB);
img = QImage((const uchar*)(image.data), //(const unsigned char*)
image.cols, image.rows,
image.cols*image.channels(),
QImage::Format_RGB888);
}else // gray image
{
img = QImage((const uchar*)(image.data),
image.cols, image.rows,
image.cols*image.channels(),
QImage::Format_Indexed8);
}
if (!img.isNull())
{
label->setPixmap(QPixmap::fromImage(img));
label->resize(label->pixmap()->size());
label->setAlignment(Qt::AlignCenter);
label->show();
}
else
{
ASSERT(0);
}
//---------------------
}
示例14: QDialog
AdminAccomLocations::AdminAccomLocations(QCA::SecureArray pwOffice, QWidget *parent) : QDialog(parent) {
this->setWindowTitle("Accommodation Locations");
this->setMinimumSize(400,300);
tabs = new QTabWidget;
QScrollArea *scrollAreaBNB = new QScrollArea;
scrollAreaBNB->setObjectName("bnb");
QWidget *scrollBNB = new QWidget;
scrollAreaBNB->setWidget(scrollBNB);
scrollAreaBNB->setWidgetResizable(true);
layBNB = new QVBoxLayout;
scrollBNB->setLayout(layBNB);
layBNB->addStretch();
QScrollArea *scrollAreaHOSTEL = new QScrollArea;
scrollAreaHOSTEL->setObjectName("hostel");
QWidget *scrollHOSTEL = new QWidget;
scrollAreaHOSTEL->setWidget(scrollHOSTEL);
scrollAreaHOSTEL->setWidgetResizable(true);
layHOSTEL = new QVBoxLayout;
scrollHOSTEL->setLayout(layHOSTEL);
layHOSTEL->addStretch();
allItemsBNB.clear();
allDelsBNB.clear();
allItemsHOSTEL.clear();
allDelsHOSTEL.clear();
tabs->addTab(scrollAreaBNB,"Bed and Breakfast");
tabs->addTab(scrollAreaHOSTEL,"Hostel");
err = new Errors;
dbData = new ConfigData(pwOffice,QStringList() << "accommodationlocations");
loadLocations(dbData->getAccommodationLocations());
connect(dbData, SIGNAL(changeAccommodationLocations(QMultiMap<QString,SaverDbAccomLocations>)), this, SLOT(loadLocations(QMultiMap<QString,SaverDbAccomLocations>)));
addNew = new QPushButton("Add New Location");
save = new QPushButton("Save Locations");
cancel = new QPushButton("Cancel");
addNew->setStyleSheet("font-weight: bold; font-size: 9pt; padding: 10px;");
save->setStyleSheet("font-weight: bold; font-size: 10pt; padding: 10px;");
cancel->setStyleSheet("font-size: 10pt; padding: 10px;");
QHBoxLayout *butLay = new QHBoxLayout;
butLay->addWidget(addNew);
butLay->addStretch();
butLay->addWidget(save);
butLay->addWidget(cancel);
connect(save, SIGNAL(clicked()), this, SLOT(saveData()));
connect(addNew, SIGNAL(clicked()), this, SLOT(addNewItem()));
connect(cancel, SIGNAL(clicked()), this, SLOT(close()));
QLabel *title = new QLabel("<center><h2>Adjust Accommodation Locations</h2></center>");
title->setWordWrap(true);
QVBoxLayout *lay = new QVBoxLayout;
lay->addSpacing(10);
lay->addWidget(title);
lay->addSpacing(10);
lay->addWidget(tabs);
lay->addLayout(butLay);
this->setLayout(lay);
}