本文整理汇总了C++中QTabWidget::addTab方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::addTab方法的具体用法?C++ QTabWidget::addTab怎么用?C++ QTabWidget::addTab使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::addTab方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FastYUVToBMPImage
MemoryViewer::MemoryViewer(RobotMemoryManager::const_ptr memoryManager) :
memoryManager(memoryManager) {
MRawImages::const_ptr rawImages = memoryManager->getMemory()->get<MRawImages>();
FastYUVToBMPImage* rawTopBMP = new FastYUVToBMPImage(rawImages, Camera::TOP, this);
FastYUVToBMPImage* rawBottomBMP = new FastYUVToBMPImage(rawImages, Camera::BOTTOM, this);
VisualInfoImage* shapesBottom = new VisualInfoImage(memoryManager->getMemory()->get<MVision>(),
Camera::BOTTOM);
VisualInfoImage* shapesTop = new VisualInfoImage(memoryManager->getMemory()->get<MVision>(),
Camera::TOP);
OverlayedImage* comboBottom = new OverlayedImage(rawBottomBMP, shapesBottom, this);
OverlayedImage* comboTop = new OverlayedImage(rawTopBMP, shapesTop, this);
BMPImageViewer* bottomImageViewer = new BMPImageViewer(comboBottom, this);
BMPImageViewer* topImageViewer = new BMPImageViewer(comboTop, this);
BMPImageViewer* top = new BMPImageViewer(comboTop, this);
BMPImageViewer* bottom = new BMPImageViewer(comboBottom, this);
QHBoxLayout* mainLayout = new QHBoxLayout;
QWidget* mainWidget = new QWidget;
QTabWidget* imageTabs = new QTabWidget();
imageTabs->addTab(topImageViewer, QString("Top Image"));
imageTabs->addTab(bottomImageViewer, QString("Bottom Image"));
mainLayout->addWidget(imageTabs);
mainWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
mainWidget->setLayout(mainLayout);
this->setCentralWidget(mainWidget);
//TODO: we call updateView twice per vision frame
memoryManager->connectSlot(bottomImageViewer, SLOT(updateView()), "MVision");
memoryManager->connectSlot(topImageViewer, SLOT(updateView()), "MVision");
//need another set of these to connect the BMPImageViewer copies (top, bottom)
memoryManager->connectSlot(bottom, SLOT(updateView()), "MVision");
memoryManager->connectSlot(top, SLOT(updateView()), "MVision");
//corner ownership
this->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
Memory::const_ptr memory = memoryManager->getMemory();
std::vector<QTreeView> messageViewers;
for (Memory::const_iterator iterator = memory->begin(); iterator != memory->end(); iterator++) {
if (iterator->first != "MRawImages" && iterator->first != "GroundTruth") {
QDockWidget* dockWidget = new QDockWidget(QString(iterator->first.c_str()), this);
dockWidget->setMinimumWidth(300);
dockWidget->setMaximumHeight(125);
MObjectViewer* view = new MObjectViewer(iterator->second, dockWidget);
dockWidget->setWidget(view);
this->addDockWidget(Qt::RightDockWidgetArea, dockWidget);
memoryManager->connectSlot(view, SLOT(updateView()), iterator->first);
}
}
}
示例2: QGridLayout
//-----------------------------------------------------------------------------
ConfigDialog::ConfigDialog(QWidget *parent)
: QDialog(parent),
_saved(false), _WWHEnabled(0)
{
// kDebug(11001) << ": ConfigDialog";
setWindowTitle( i18n("Configure Highscores") );
setModal( true );
QWidget *page = 0;
QTabWidget *tab = 0;
QVBoxLayout *layout = new QVBoxLayout;
setLayout(layout);
if ( internal->isWWHSAvailable() ) {
tab = new QTabWidget(this);
layout->addWidget(tab);
page = new QWidget;
tab->addTab(page, i18n("Main"));
}
else {
page = new QWidget(this);
layout->addWidget(page);
}
QGridLayout *pageTop =
new QGridLayout(page);
//pageTop->setMargin(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
//pageTop->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
layout->addLayout(pageTop);
QLabel *label = new QLabel(i18n("Nickname:"), page);
pageTop->addWidget(label, 0, 0);
_nickname = new QLineEdit(page);
connect(_nickname, SIGNAL(textChanged(QString)),
SLOT(modifiedSlot()));
connect(_nickname, SIGNAL(textChanged(QString)),
SLOT(nickNameChanged(QString)));
_nickname->setMaxLength(16);
pageTop->addWidget(_nickname, 0, 1);
label = new QLabel(i18n("Comment:"), page);
pageTop->addWidget(label, 1, 0);
_comment = new QLineEdit(page);
connect(_comment, SIGNAL(textChanged(QString)),
SLOT(modifiedSlot()));
_comment->setMaxLength(50);
pageTop->addWidget(_comment, 1, 1);
if (tab) {
_WWHEnabled
= new QCheckBox(i18n("World-wide highscores enabled"), page);
connect(_WWHEnabled, SIGNAL(toggled(bool)),
SLOT(modifiedSlot()));
pageTop->addWidget(_WWHEnabled, 2, 0, 1, 2 );
// advanced tab
QWidget *page = new QWidget;
tab->addTab(page, i18n("Advanced"));
QVBoxLayout *pageTop = new QVBoxLayout(page);
//pageTop->setMargin(QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin));
//pageTop->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
QGroupBox *group = new QGroupBox(page);
group->setTitle( i18n("Registration Data") );
pageTop->addWidget(group);
QGridLayout *groupLayout = new QGridLayout(group);
//groupLayout->setSpacing(QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
label = new QLabel(i18n("Nickname:"), group);
groupLayout->addWidget(label, 0, 0);
_registeredName = new KLineEdit(group);
_registeredName->setReadOnly(true);
groupLayout->addWidget(_registeredName, 0, 1);
label = new QLabel(i18n("Key:"), group);
groupLayout->addWidget(label, 1, 0);
_key = new KLineEdit(group);
_key->setReadOnly(true);
groupLayout->addWidget(_key, 1, 1);
KGuiItem gi = KStandardGuiItem::clear();
gi.setText(i18n("Remove"));
_removeButton = new QPushButton(group);
KGuiItem::assign(_removeButton, gi);
groupLayout->addWidget(_removeButton, 2, 0);
connect(_removeButton, SIGNAL(clicked()), SLOT(removeSlot()));
}
buttonBox = new QDialogButtonBox(this);
buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
// TODO mapping for Apply button
//.........这里部分代码省略.........
示例3: file
QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeature, bool featureOwner, QgsDistanceArea myDa, QWidget* parent, bool showDialogButtons )
: QObject( parent )
, mDialog( 0 )
, mSettingsPath( "/Windows/AttributeDialog/" )
, mLayer( vl )
, mFeature( thepFeature )
, mFeatureOwner( featureOwner )
, mHighlight( 0 )
, mFormNr( -1 )
, mShowDialogButtons( showDialogButtons )
{
if ( !mFeature || !vl->dataProvider() )
return;
const QgsFields &theFields = vl->pendingFields();
if ( theFields.isEmpty() )
return;
QgsAttributes myAttributes = mFeature->attributes();
QDialogButtonBox *buttonBox = NULL;
if ( vl->editorLayout() == QgsVectorLayer::UiFileLayout && !vl->editForm().isEmpty() )
{
// UI-File defined layout
QFile file( vl->editForm() );
if ( file.open( QFile::ReadOnly ) )
{
QUiLoader loader;
QFileInfo fi( vl->editForm() );
loader.setWorkingDirectory( fi.dir() );
QWidget *myWidget = loader.load( &file, parent );
file.close();
mDialog = qobject_cast<QDialog*>( myWidget );
buttonBox = myWidget->findChild<QDialogButtonBox*>();
}
}
else if ( vl->editorLayout() == QgsVectorLayer::TabLayout )
{
// Tab display
mDialog = new QDialog( parent );
QGridLayout *gridLayout;
QTabWidget *tabWidget;
mDialog->resize( 447, 343 );
gridLayout = new QGridLayout( mDialog );
gridLayout->setObjectName( QString::fromUtf8( "gridLayout" ) );
tabWidget = new QTabWidget( mDialog );
gridLayout->addWidget( tabWidget );
foreach ( const QgsAttributeEditorElement *widgDef, vl->attributeEditorElements() )
{
QWidget* tabPage = new QWidget( tabWidget );
tabWidget->addTab( tabPage, widgDef->name() );
QGridLayout *tabPageLayout = new QGridLayout( tabPage );
if ( widgDef->type() == QgsAttributeEditorElement::AeTypeContainer )
{
tabPageLayout->addWidget( QgsAttributeEditor::createWidgetFromDef( widgDef, tabPage, vl, myAttributes, mProxyWidgets, false ) );
}
else
{
QgsDebugMsg( "No support for fields in attribute editor on top level" );
}
}
buttonBox = new QDialogButtonBox( mDialog );
buttonBox->setObjectName( QString::fromUtf8( "buttonBox" ) );
gridLayout->addWidget( buttonBox );
}
示例4: font
AboutWidget::AboutWidget()
{
setWindowTitle(tr("About QMPlay2"));
setAttribute(Qt::WA_DeleteOnClose);
QString labelText;
labelText += "<b>QMPlay2:</b> " + tr("video and audio player");
labelText += "<br/><b>" + tr("Programmer") + ":</b> <a href='mailto:[email protected]'>Błażej Szczygieł</a>";
labelText += "<br/><b>" + tr("Version") + ":</b> " + QMPlay2Core.getSettings().getString("Version");
QLabel *label = new QLabel(labelText);
QLabel *iconL = new QLabel;
iconL->setPixmap(Functions::getPixmapFromIcon(QMPlay2Core.getQMPlay2Icon(), QSize(128, 128), this));
QPalette palette;
palette.setBrush(QPalette::Base, palette.window());
QTabWidget *tabW = new QTabWidget;
const QFont font(QFontDatabase::systemFont(QFontDatabase::FixedFont));
logE = new QPlainTextEdit;
logE->setFont(font);
logE->setPalette(palette);
logE->setFrameShape(QFrame::NoFrame);
logE->setFrameShadow(QFrame::Plain);
logE->setReadOnly(true);
logE->setLineWrapMode(QPlainTextEdit::NoWrap);
logE->viewport()->setProperty("cursor", QCursor(Qt::ArrowCursor));
tabW->addTab(logE, tr("Logs"));
clE = new QPlainTextEdit;
clE->setFont(font);
clE->setPalette(palette);
clE->setFrameShape(QFrame::NoFrame);
clE->setFrameShadow(QFrame::Plain);
clE->setReadOnly(true);
clE->viewport()->setProperty("cursor", QCursor(Qt::ArrowCursor));
tabW->addTab(clE, tr("Change log"));
auE = new QPlainTextEdit;
auE->setFont(font);
auE->setPalette(palette);
auE->setFrameShape(QFrame::NoFrame);
auE->setFrameShadow(QFrame::Plain);
auE->setReadOnly(true);
auE->viewport()->setProperty("cursor", QCursor(Qt::ArrowCursor));
tabW->addTab(auE, tr("Contributors"));
clrLogB = new QPushButton;
clrLogB->setText(tr("Clear log"));
QPushButton *closeB = new QPushButton;
closeB->setText(tr("Close"));
closeB->setShortcut(QKeySequence("ESC"));
QGridLayout *layout = new QGridLayout;
layout->setContentsMargins(2, 2, 2, 2);
layout->addWidget(iconL, 0, 0, 1, 1);
layout->addWidget(label, 0, 1, 1, 2);
layout->addWidget(tabW, 1, 0, 1, 3);
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 2, 0, 1, 1); //hSpacer
layout->addWidget(clrLogB, 2, 1, 1, 1);
layout->addWidget(closeB, 2, 2, 1, 1);
setLayout(layout);
connect(label, SIGNAL(linkActivated(const QString &)), this, SLOT(linkActivated(const QString &)));
connect(clrLogB, SIGNAL(clicked()), this, SLOT(clrLog()));
connect(closeB, SIGNAL(clicked()), this, SLOT(close()));
connect(tabW, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int)));
connect(&logWatcher, SIGNAL(fileChanged(const QString &)), this, SLOT(refreshLog()));
show();
}
示例5: QMainWindow
KawaiiGL::KawaiiGL(QWidget *parent)
: QMainWindow(parent), m_kView(NULL), m_edDlg(NULL), m_doc(NULL)
{
ui.setupUi(this);
m_sett.loadFromReg();
connect(&m_sett, SIGNAL(changed()), &m_sett, SLOT(storeToReg()));
setWindowTitle("KawaiiGL");
show(); // needed becase we're creating display lists in the c'tor.
QDir::setCurrent(EXAMPLES_DIR); // we're reading the config and textures from there
m_progMenu = new QMenu(this);
m_modelsMenu = new QMenu(this);
m_doc = new Document(this); // adds to the menus
m_progMenu->addSeparator();
QAction *loadFromFileAct = m_progMenu->addAction("From file...");
connect(loadFromFileAct, SIGNAL(triggered(bool)), m_doc, SLOT(loadProgramFile()));
m_kView = new T2GLWidget(this, m_doc);
setCentralWidget(m_kView);
m_edDlg = new KwEdit(this, m_sett.disp, m_doc, m_kView); // need the view for tracking vec2s
m_edDlg->show();
m_edDlg->move(pos() + QPoint(width() - 20, 30));
m_control = new MyDialog(this);
QBoxLayout *control_l = new QVBoxLayout();
m_control->setLayout(control_l);
control_l->setMargin(0);
control_l->setSpacing(0);
QTabWidget *tabs = new QTabWidget();
control_l->addWidget(tabs);
m_contDlg = new ControlPanel(&m_sett.disp, this, m_doc, m_kView);
tabs->addTab(m_contDlg, "Config");
m_browse = new ProjBrowser(this, m_doc);
tabs->addTab(m_browse, "Browser");
tabs->setCurrentWidget(m_browse);
//tabs->setCurrentIndex(m_sett.gui.configWindowTab);
tabs->setCurrentIndex(0);
m_control->show();
m_control->move(pos() + QPoint(-30, 20));
m_control->resize(100, 100); // make it as small as possible
m_doc->model()->m_errAct = new ErrorHighlight(m_edDlg);
connect(m_kView, SIGNAL(message(const QString&)), this, SLOT(message(const QString&)));
connect(m_edDlg, SIGNAL(changedModel(DocSrc*)), m_doc, SLOT(calc(DocSrc*)));
connect(m_edDlg, SIGNAL(updateShaders()), m_doc, SLOT(compileShaders()));
// connect(m_kView, SIGNAL(decompProgChanged(const QString&)), m_edDlg, SLOT(curChanged(const QString&)));
connect(m_doc, SIGNAL(loaded()), m_kView, SLOT(newModelLoaded()));
//connect(m_doc, SIGNAL(loaded()), m_edDlg, SLOT(doVarsUpdate())); // parsed new text. vars defs may be wrong
connect(m_doc, SIGNAL(modelChanged()), m_kView, SLOT(updateGL()));
connect(m_doc, SIGNAL(progChanged()), m_kView, SLOT(redoFrameBuffers()));
connect(m_kView, SIGNAL(changedFBOs()), m_contDlg, SLOT(updateTexEdits()));
connect(m_kView, SIGNAL(makeGradientTex(int, const QString&)), m_contDlg, SLOT(externalGradient(int, const QString&)));
connect(m_doc, SIGNAL(progParamChanged()), m_kView, SLOT(updateGL()));
connect(m_doc, SIGNAL(addModelLine(const QString&)), m_edDlg, SLOT(addModelLine(const QString&)));
connect(m_contDlg, SIGNAL(changedRend()), m_doc, SLOT(calcNoParse())); // passes update
connect(m_contDlg, SIGNAL(changedFont()), m_kView, SLOT(updateCoordFont()));
connect(m_contDlg, SIGNAL(doUpdate()), m_kView, SLOT(updateGL())); // passes update
connect(m_contDlg, SIGNAL(resetView()), m_kView, SLOT(resetState()));
connect(m_contDlg, SIGNAL(resetLight()), m_kView, SLOT(resetLight()));
connect(m_contDlg, SIGNAL(changedTexFile(int)), m_kView, SLOT(setTexture(int)));
// connect(m_contDlg, SIGNAL(reassertTex(int)), m_kView, SLOT(rebindTexture(int)));
connect(m_contDlg, SIGNAL(saveMesh()), m_doc, SLOT(calcSave()));
connect(m_browse, SIGNAL(openDocText(DocElement*)), m_edDlg, SLOT(addPage(DocElement*)) );
connect(m_browse, SIGNAL(openPassConf(DocElement*)), m_edDlg, SLOT(addPage(DocElement*)) );
connect(m_browse, SIGNAL(commitGuiData()), m_edDlg, SLOT(commitAll()));
connect(m_doc, SIGNAL(goingToClearProg()), m_edDlg, SLOT(clearingProg()));
connect(m_doc, SIGNAL(didReadProg(ProgKeep*)), m_edDlg, SLOT(readProg(ProgKeep*)) );
connect(m_doc, SIGNAL(didReadProg(ProgKeep*)), m_browse, SLOT(readProg(ProgKeep*)) );
connect(m_doc, SIGNAL(didReadModel(DocSrc*)), m_browse, SLOT(readModel()) );
connect(m_doc, SIGNAL(didReadModel(DocSrc*)), m_edDlg, SLOT(readModel(DocSrc*)));
connect(&m_sett.disp.bVtxNormals, SIGNAL(changed()), m_doc, SLOT(calcNoParse())); // TBD - this is bad.
connect(m_contDlg->ui.clipSlider, SIGNAL(valueChanged(int)), m_kView, SLOT(setClipValue(int)));
m_kView->setContextMenuPolicy(Qt::ActionsContextMenu);
QPushButton *viewBot = new QPushButton("View");
viewBot->setMaximumSize(60, 19);
statusBar()->addPermanentWidget(viewBot);
QMenu *view = new QMenu("View");
viewBot->setMenu(view);
//.........这里部分代码省略.........
示例6: TraceWindow
QWidget *QmlProfilerTool::createWidgets()
{
// Analyzer::AnalyzerManager *analyzerMgr = Analyzer::AnalyzerManager::instance();
// Utils::FancyMainWindow *mw = analyzerMgr->mainWindow();
QWidget *mw = this;
d->m_traceWindow = new TraceWindow(mw);
d->m_traceWindow->reset(d->m_client);
connect(d->m_traceWindow, SIGNAL(gotoSourceLocation(QString,int)),this, SLOT(gotoSourceLocation(QString,int)));
connect(d->m_traceWindow, SIGNAL(timeChanged(qreal)), this, SLOT(updateTimer(qreal)));
d->m_statistics = new QmlProfilerEventStatistics(mw);
d->m_eventsView = new QmlProfilerEventsView(mw, d->m_statistics);
d->m_eventsView->setViewType(QmlProfilerEventsView::EventsView);
connect(d->m_traceWindow, SIGNAL(range(int,int,int,qint64,qint64,QStringList,QString,int)),
d->m_statistics, SLOT(addRangedEvent(int,int,int,qint64,qint64,QStringList,QString,int)));
connect(d->m_traceWindow, SIGNAL(viewUpdated()),
d->m_statistics, SLOT(complete()));
connect(d->m_eventsView, SIGNAL(gotoSourceLocation(QString,int)),
this, SLOT(gotoSourceLocation(QString,int)));
d->m_calleeView = new QmlProfilerEventsView(mw, d->m_statistics);
d->m_calleeView->setViewType(QmlProfilerEventsView::CalleesView);
connect(d->m_calleeView, SIGNAL(gotoSourceLocation(QString,int)),
this, SLOT(gotoSourceLocation(QString,int)));
d->m_callerView = new QmlProfilerEventsView(mw, d->m_statistics);
d->m_callerView->setViewType(QmlProfilerEventsView::CallersView);
connect(d->m_callerView, SIGNAL(gotoSourceLocation(QString,int)),
this, SLOT(gotoSourceLocation(QString,int)));
#if 0
Core::ICore *core = Core::ICore::instance();
Core::ActionManager *am = core->actionManager();
Core::ActionContainer *manalyzer = am->actionContainer(Analyzer::Constants::M_DEBUG_ANALYZER);
const Core::Context globalcontext(Core::Constants::C_GLOBAL);
d->m_attachAction = new QAction(tr("Attach..."), manalyzer);
Core::Command *command = am->registerAction(d->m_attachAction,
Constants::ATTACH, globalcontext);
command->setAttribute(Core::Command::CA_UpdateText);
//manalyzer->addAction(command, Analyzer::Constants::G_ANALYZER_STARTSTOP);
connect(d->m_attachAction, SIGNAL(triggered()), this, SLOT(attach()));
updateAttachAction(false);
QDockWidget *eventsDock = AnalyzerManager::createDockWidget
(this, tr("Events"), d->m_eventsView, Qt::BottomDockWidgetArea);
QDockWidget *timelineDock = AnalyzerManager::createDockWidget
(this, tr("Timeline"), d->m_traceWindow, Qt::BottomDockWidgetArea);
QDockWidget *calleeDock = AnalyzerManager::createDockWidget
(this, tr("Callees"), d->m_calleeView, Qt::BottomDockWidgetArea);
QDockWidget *callerDock = AnalyzerManager::createDockWidget
(this, tr("Callers"), d->m_callerView, Qt::BottomDockWidgetArea);
mw->splitDockWidget(mw->toolBarDockWidget(), eventsDock, Qt::Vertical);
mw->tabifyDockWidget(eventsDock, timelineDock);
mw->tabifyDockWidget(timelineDock, calleeDock);
mw->tabifyDockWidget(calleeDock, callerDock);
#endif
QTabWidget *tabWidget = new QTabWidget;
tabWidget->addTab(d->m_eventsView, tr("Events"));
tabWidget->addTab(d->m_traceWindow, tr("Timeline"));
tabWidget->addTab(d->m_calleeView, tr("Callees"));
tabWidget->addTab(d->m_callerView, tr("Callers"));
//
// Toolbar
//
QWidget *toolbarWidget = new QWidget;
toolbarWidget->setObjectName(QLatin1String("QmlProfilerToolBarWidget"));
QHBoxLayout *layout = new QHBoxLayout;
layout->setMargin(0);
layout->setSpacing(0);
d->m_recordButton = new QToolButton(toolbarWidget);
// icon and tooltip set in setRecording(), called later
d->m_recordButton->setCheckable(true);
connect(d->m_recordButton,SIGNAL(toggled(bool)), this, SLOT(setRecording(bool)));
d->m_recordButton->setChecked(true);
layout->addWidget(d->m_recordButton);
d->m_clearButton = new QToolButton(toolbarWidget);
d->m_clearButton->setIcon(QIcon(QLatin1String(":/qmlprofiler/clean_pane_small.png")));
d->m_clearButton->setToolTip(tr("Discard data"));
connect(d->m_clearButton,SIGNAL(clicked()), this, SLOT(clearDisplay()));
layout->addWidget(d->m_clearButton);
QLabel *timeLabel = new QLabel(tr("Elapsed: 0 s"));
QPalette palette = timeLabel->palette();
palette.setColor(QPalette::WindowText, Qt::white);
timeLabel->setPalette(palette);
timeLabel->setIndent(10);
connect(this, SIGNAL(setTimeLabel(QString)), timeLabel, SLOT(setText(QString)));
layout->addWidget(timeLabel);
//.........这里部分代码省略.........
示例7: QLabel
BioXASXASScanConfigurationEditor::BioXASXASScanConfigurationEditor(BioXASXASScanConfiguration *configuration, QWidget *parent) :
BioXASXASScanConfigurationView(parent)
{
// Create scan name editor.
QLabel *namePrompt = new QLabel("Name: ");
nameLineEdit_ = new QLineEdit();
// Create scan energy editor.
QLabel *energyPrompt = new QLabel("Energy: ");
energySpinBox_ = new QDoubleSpinBox();
energySpinBox_->setSuffix(" eV");
energySpinBox_->setMinimum(0);
energySpinBox_->setMaximum(30000);
edgeEditor_ = new BioXASXASScanConfigurationEdgeEditor(0);
// Create scan regions editor.
regionsEditor_ = new BioXASXASScanConfigurationRegionsEditor(0);
// Create scan detectors editor.
scientificDetectorsView_ = new AMGenericStepScanConfigurationDetectorsView(0, BioXASBeamline::bioXAS()->exposedScientificDetectors());
QVBoxLayout *scientificDetectorsWidgetLayout = new QVBoxLayout();
scientificDetectorsWidgetLayout->addWidget(scientificDetectorsView_);
scientificDetectorsWidgetLayout->addStretch();
QWidget *scientificDetectorsWidget = new QWidget();
scientificDetectorsWidget->setLayout(scientificDetectorsWidgetLayout);
allDetectorsView_ = new AMGenericStepScanConfigurationDetectorsView(0, BioXASBeamline::bioXAS()->defaultXASScanDetectorOptions());
QVBoxLayout *allDetectorsWidgetLayout = new QVBoxLayout();
allDetectorsWidgetLayout->addWidget(allDetectorsView_);
allDetectorsWidgetLayout->addStretch();
QWidget *allDetectorsWidget = new QWidget();
allDetectorsWidget->setLayout(allDetectorsWidgetLayout);
QTabWidget *detectorsViews = new QTabWidget();
detectorsViews->addTab(scientificDetectorsWidget, "Scientific");
detectorsViews->addTab(allDetectorsWidget, "All");
exportSpectraCheckBox_ = new QCheckBox("Export spectra");
collectICRsCheckBox_ = new QCheckBox("Collect ICRs");
// Create and set main layouts
QHBoxLayout *edgeEditorLayout = new QHBoxLayout();
edgeEditorLayout->addStretch();
edgeEditorLayout->addWidget(edgeEditor_);
QGridLayout *propertiesLayout = new QGridLayout();
propertiesLayout->addWidget(namePrompt, 0, 0, 1, 1, Qt::AlignRight);
propertiesLayout->addWidget(nameLineEdit_, 0, 1);
propertiesLayout->addWidget(energyPrompt, 1, 0, 1, 1, Qt::AlignRight);
propertiesLayout->addWidget(energySpinBox_, 1, 1);
propertiesLayout->addLayout(edgeEditorLayout, 1, 2);
QVBoxLayout *scanBoxLayout = new QVBoxLayout();
scanBoxLayout->addLayout(propertiesLayout);
scanBoxLayout->addWidget(regionsEditor_);
QGroupBox *scanBox = new QGroupBox("Scan");
scanBox->setLayout(scanBoxLayout);
QVBoxLayout *detectorBoxLayout = new QVBoxLayout();
detectorBoxLayout->addWidget(detectorsViews);
detectorBoxLayout->addWidget(exportSpectraCheckBox_);
detectorBoxLayout->addWidget(collectICRsCheckBox_);
detectorBoxLayout->addStretch();
QGroupBox *detectorBox = new QGroupBox("Detectors");
detectorBox->setLayout(detectorBoxLayout);
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget(scanBox);
layout->addWidget(detectorBox);
setLayout(layout);
// Make connections.
connect( nameLineEdit_, SIGNAL(textChanged(QString)), this, SLOT(updateConfigurationName()) );
connect( energySpinBox_, SIGNAL(valueChanged(double)), this, SLOT(updateConfigurationEnergy()) );
connect( exportSpectraCheckBox_, SIGNAL(clicked(bool)), this, SLOT(updateConfigurationExportSpectraPreference()) );
connect( collectICRsCheckBox_, SIGNAL(clicked(bool)), this, SLOT(updateConfigurationCollectICRsPreference()) );
// Current settings.
setConfiguration(configuration);
}
示例8: QWidget
CVectorWindow::CVectorWindow() : QWidget( NULL ), theActualImage(NULL), theActualOverlay(NULL)
{
dImageLut[0] = 0.0;
dImageLut[1] = 127.0;
dOverlayLut[0] = 0.0;
dOverlayLut[1] = 1.0;
dImageClampValues[0] = 0.0;
dImageClampValues[1] = 127.0;
dOverlayClampValues[0] = 0.0;
dOverlayClampValues[1] = 1.0;
//setFixedSize(260,260);
setMinimumSize(256,256);
aGlobalColumnPtr = new QVBox( this );
aGlobalColumnPtr->setGeometry(0,0,250,250);
aGlobalColumnPtr->setMargin(2);
aGlobalColumnPtr->setSpacing(8);
display = new vtkQtRenderWindow( aGlobalColumnPtr );
//display->setMinimumSize(128,128);
interactor = vtkQtRenderWindowInteractor::New();
interactor->SetRenderWindow( display );
interactor->SetInteractorStyle( vtkInteractorStyleImage::New() );
renderer = vtkRenderer::New();
display->AddRenderer( renderer );
theImageLookupTable = vtkLookupTable::New();
theImageLookupTable->SetTableRange( 0.0, 127.0 );
theImageLookupTable->SetRampToLinear();
theImageLookupTable->SetSaturationRange( 0.0, 0.0 );
theImageLookupTable->SetValueRange( 0.0, 1.0 );
theImageLookupTable->SetHueRange( 0.0, 0.0);
theImageLookupTable->Build();
theImageLookupTable->SetTableValue( 0, 0.0, 0.0, 0.0, 0.0 );
theImageColorBar = vtkScalarBarActor::New();
theImageColorBar->SetLookupTable( theImageLookupTable );
theImageColorBar->SetOrientationToVertical();
theImageColorBar->SetWidth( 0.05 );
theImageColorBar->SetHeight( 0.9 );
dImageClampValues[0] = dImageLut[0];
dImageClampValues[1] = dImageLut[1];
theImage = vtkImageActor::New();
theImageColorsMapper = vtkImageMapToColors::New();
theImageColorsMapper->SetLookupTable( theImageLookupTable );
theImageColorsMapper->SetOutputFormatToRGBA();
theImageColorsMapper->PassAlphaToOutputOff();
renderer->AddActor( theImageColorBar );
theOverlayLookupTable = vtkLookupTable::New();
theOverlayLookupTable->SetTableRange( 0.0, 127.0 );
theOverlayLookupTable->SetRampToLinear();
theOverlayLookupTable->SetSaturationRange( 0.0, 0.0 );
theOverlayLookupTable->SetValueRange( 0.0, 1.0 );
theOverlayLookupTable->SetHueRange( 0.0, 1.0);
theOverlayLookupTable->Build();
theOverlayLookupTable->SetTableValue( 0, 0.0, 0.0, 0.0, 0.0 );
theOverlayColorBar = vtkScalarBarActor::New();
theOverlayColorBar->SetLookupTable( theOverlayLookupTable );
theOverlayColorBar->SetLayerNumber( 1 );
theOverlayColorBar->SetOrientationToVertical();
theOverlayColorBar->SetWidth( 0.05 );
theOverlayColorBar->SetHeight( 0.9 );
dOverlayClampValues[0] = dOverlayLut[0];
dOverlayClampValues[1] = dOverlayLut[1];
theGlyphSource = vtkArrowSource::New();
theFieldGlyphs = vtkGlyph2D::New();
theFieldGlyphs->SetScaleModeToScaleByVector();
theFieldGlyphs->SetColorModeToColorByVector();
theFieldGlyphs->SetVectorModeToUseVector();
theFieldGlyphs->SetSource( theGlyphSource->GetOutput() );
theFieldMapper = vtkPolyDataMapper2D::New();
theFieldMapper->SetInput( theFieldGlyphs->GetOutput() );
theFieldMapper->SetLookupTable( theOverlayLookupTable );
theOverlay = vtkActor2D::New();
theOverlay->SetMapper( theFieldMapper );
theImage->SetInput( theImageColorsMapper->GetOutput() );
//renderer->AddActor( theImage );
renderer->AddActor( theOverlay );
renderer->AddActor( theOverlayColorBar );
double* pos = theImageColorBar->GetPosition();
theOverlayColorBar->SetPosition( pos[0]+0.05, pos[1] );
QTabWidget* dialog = new QTabWidget( aGlobalColumnPtr );
// Setup tab 1
QVBox* aColumn1Ptr = new QVBox( this );
dialog->addTab( aColumn1Ptr, "Image" );
aColumn1Ptr->setGeometry(0,0,250,250);
aColumn1Ptr->setMargin(2);
aColumn1Ptr->setSpacing(8);
theImageLutFileButton = new QPushButton( "Color table", aColumn1Ptr );
theImageLutFileButton->setMinimumSize( 200, 25 );
QLabel* doc1 = new QLabel( "Data range minimum", aColumn1Ptr );
QHBox* aRow3Ptr = new QHBox ( aColumn1Ptr );
theImageDataMin = new QScrollBar ( 0, 1000, 1, 50, 0, Qt::Horizontal, aRow3Ptr );
theImageDataMin->setMinimumSize(256,16);
aRow3Ptr->setStretchFactor( theImageDataMin, 3 );
aRow3Ptr->setSpacing(10);
theImageMinDisplay = new QLineEdit( QString::number( dImageLut[0] ), aRow3Ptr );
theImageMinDisplay->setFixedSize(96,16);
//.........这里部分代码省略.........
示例9: tr
//.........这里部分代码省略.........
QString licenseText = tr(
"Copyright (C) 2012-2015 Boris Dalstein.<br><br>"
" "
"Permission is hereby granted, free of charge, to any person obtaining a copy"
" of this software and associated documentation files (the \"Software\"), to deal"
" in the Software without restriction, including without limitation the rights"
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"
" copies of the Software, and to permit persons to whom the Software is"
" furnished to do so, subject to the following conditions:<br><br>"
" "
"The above copyright notice and this permission notice shall be included in"
" all copies or substantial portions of the Software.<br><br>"
" "
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN"
" THE SOFTWARE.");
// Window title
setWindowTitle(tr("About"));
setMinimumSize(500, 500);
// About widget
QWidget * aboutWidget = new QWidget();
QLabel * logoLabel = new QLabel();
logoLabel->setPixmap(QPixmap(":/images/logo_1-5.png"));
logoLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
QLabel * websiteLabel = new QLabel(websiteText);
websiteLabel->setTextFormat(Qt::RichText);
websiteLabel->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
websiteLabel->setOpenExternalLinks(true);
QFont websiteFont = websiteLabel->font();
websiteFont.setPointSize(15);
websiteLabel->setFont(websiteFont);
QLabel * aboutLabel = new QLabel(aboutText);
aboutLabel->setWordWrap(true);
aboutLabel->setTextFormat(Qt::RichText);
aboutLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
subscribeLineEdit_ = new QLineEdit();
subscribeLineEdit_->setPlaceholderText(tr("Your email address"));
networkManager_ = new QNetworkAccessManager(this);
QPushButton * subscribeButton = new QPushButton(tr("Subscribe"));
connect(subscribeButton, SIGNAL(clicked(bool)), this, SLOT(processSubscribe_()));
QHBoxLayout * subscribeLayout = new QHBoxLayout();
subscribeLayout->addWidget(subscribeLineEdit_);
subscribeLayout->addWidget(subscribeButton);
QVBoxLayout * aboutWidgetLayout = new QVBoxLayout();
aboutWidgetLayout->addWidget(logoLabel);
aboutWidgetLayout->addSpacing(10);
aboutWidgetLayout->addWidget(websiteLabel);
aboutWidgetLayout->addSpacing(10);
aboutWidgetLayout->addWidget(aboutLabel);
aboutWidgetLayout->addSpacing(10);
aboutWidgetLayout->addLayout(subscribeLayout);
aboutWidgetLayout->addStretch();
aboutWidget->setLayout(aboutWidgetLayout);
// License widget
QWidget * licenseWidget = new QWidget();
QLabel * licenseLabel = new QLabel(licenseText);
licenseLabel->setWordWrap(true);
licenseLabel->setTextFormat(Qt::RichText);
licenseLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
QVBoxLayout * licenseWidgetLayout = new QVBoxLayout();
licenseWidgetLayout->addWidget(licenseLabel);
aboutWidgetLayout->addStretch();
licenseWidget->setLayout(licenseWidgetLayout);
// Tab widget
QTabWidget * tabWidget = new QTabWidget();
tabWidget->addTab(aboutWidget, tr("About"));
tabWidget->addTab(licenseWidget, tr("License"));
// Show at startup checkbox
showAtStartupCheckBox_ = new QCheckBox(tr("Show this message at startup"));
showAtStartupCheckBox_->setChecked(showAtStartup);
// Dialog button box
QDialogButtonBox * buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
// Main layout
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(tabWidget);
layout->addWidget(showAtStartupCheckBox_);
layout->addWidget(buttonBox);
setLayout(layout);
}
示例10: QSplitter
HelpWidget::HelpWidget(const SimRobot::Object& object) : QSplitter(Qt::Horizontal), object(object)
{
QString qhc = QFileInfo(HelpModule::application->getAppPath()).dir().path() +
#ifdef MACOSX
"/../Resources" +
#endif
"/helpcollection.qhc";
helpEngine = new QHelpEngine(qhc, this);
helpBrowser = new HelpBrowser(helpEngine, this);
helpBrowser->setFrameStyle(QFrame::NoFrame);
if(!helpEngine->setupData())
HelpModule::application->showWarning(tr("SimRobotHelp"), helpEngine->error());
QHelpContentWidget* contentWidget = helpEngine->contentWidget();
contentWidget->setFrameStyle(QFrame::NoFrame);
QHelpIndexWidget* indexWidget = helpEngine->indexWidget();
indexWidget->setFrameStyle(QFrame::NoFrame);
QTabWidget* leftWidget = new QTabWidget(this);
leftWidget->addTab(contentWidget, "Contents");
leftWidget->addTab(indexWidget, "Index");
QWidget* searchTabWidget = new QWidget(this);
QVBoxLayout* searchTabLayout = new QVBoxLayout(this);
searchTabLayout->addWidget(helpEngine->searchEngine()->queryWidget());
searchTabLayout->addWidget(new QLabel("Search results:", this));
searchResultsWidget = new QTextBrowser(this);
searchTabLayout->addWidget(searchResultsWidget);
searchTabWidget->setLayout(searchTabLayout);
leftWidget->addTab(searchTabWidget, "Search");
QToolBar* toolBar = new QToolBar(this);
QAction* navigateHomeAction = new QAction(QIcon(":/Icons/home.png"), tr("Home"), this);
navigateHomeAction->setStatusTip(tr("Navigate Home"));
connect(navigateHomeAction, SIGNAL(triggered()), this, SLOT(navigateHome()));
toolBar->addAction(navigateHomeAction);
QAction* locatePageAction = new QAction(QIcon(":/Icons/locate.png"), tr("Locate"), this);
locatePageAction->setStatusTip(tr("Locate current page in contents window"));
connect(locatePageAction, SIGNAL(triggered()), this, SLOT(locatePage()));
toolBar->addAction(locatePageAction);
toolBar->addSeparator();
QAction* navigateBackwardAction = new QAction(QIcon(":/Icons/back.png"), tr("Back"), this);
navigateBackwardAction->setStatusTip(tr("Navigate Back"));
connect(navigateBackwardAction, SIGNAL(triggered()), this, SLOT(navigateBackward()));
toolBar->addAction(navigateBackwardAction);
QAction* navigateForwardAction = new QAction(QIcon(":/Icons/forward.png"), tr("Forward"), this);
navigateForwardAction->setStatusTip(tr("Navigate Forward"));
connect(navigateForwardAction, SIGNAL(triggered()), this, SLOT(navigateForward()));
toolBar->addAction(navigateForwardAction);
QWidget* rightWidget = new QWidget(this);
QVBoxLayout* rightWidgetLayout = new QVBoxLayout(this);
rightWidgetLayout->addWidget(toolBar);
rightWidgetLayout->addWidget(helpBrowser);
rightWidget->setLayout(rightWidgetLayout);
addWidget(leftWidget);
addWidget(rightWidget);
connect(helpBrowser, SIGNAL(forwardAvailable(bool)), navigateForwardAction, SLOT(setEnabled(bool)));
connect(helpBrowser, SIGNAL(backwardAvailable(bool)), navigateBackwardAction, SLOT(setEnabled(bool)));
connect(contentWidget, SIGNAL(linkActivated(const QUrl&)), helpBrowser, SLOT(setSource(const QUrl &)));
connect(indexWidget, SIGNAL(linkActivated(const QUrl&, const QString&)), helpBrowser, SLOT(setSource(const QUrl &)));
connect(this, SIGNAL(tabChangeRequested(int)), leftWidget, SLOT(setCurrentIndex(int)));
connect(helpEngine->searchEngine()->queryWidget(), SIGNAL(search()), this, SLOT(searchInvoked()));
connect(helpEngine->searchEngine(), SIGNAL(searchingFinished(int)), this, SLOT(searchFinished(int)));
helpEngine->searchEngine()->reindexDocumentation();
searchResultsWidget->setOpenLinks(false);
searchResultsWidget->setOpenExternalLinks(false);
connect(searchResultsWidget, SIGNAL(anchorClicked(const QUrl&)), helpBrowser, SLOT(setSource(const QUrl&)));
navigateHome();
setStretchFactor(0,1);
setStretchFactor(1,2);
setFrameStyle(QFrame::NoFrame);
QSettings& settings = HelpModule::application->getLayoutSettings();
settings.beginGroup(object.getFullName());
restoreState(settings.value("State").toByteArray());
settings.endGroup();
}
示例11: createWidget
void ZObjsManagerWidget::createWidget()
{
QTabWidget *tabs = new QTabWidget(this);
tabs->setElideMode(Qt::ElideNone);
tabs->setUsesScrollButtons(true);
m_swcObjsTreeView = new QTreeView(this);
m_swcObjsTreeView->setTextElideMode(Qt::ElideLeft);
m_swcObjsTreeView->setExpandsOnDoubleClick(false);
m_swcObjsTreeView->setModel(m_doc->swcObjsModel());
m_swcObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_swcObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_swcObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(swcItemDoubleClicked(QModelIndex)));
connect(m_swcObjsTreeView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(swcSelectionChangedFromTreeView(QItemSelection,QItemSelection)));
tabs->addTab(m_swcObjsTreeView, "Neurons");
if (NeutubeConfig::getInstance().getObjManagerConfig().isCategorizedSwcNodeOn()) {
m_swcNodeObjsTreeView = new QTreeView(this);
m_swcNodeObjsTreeView->setExpandsOnDoubleClick(false);
m_swcNodeObjsTreeView->setModel(m_doc->swcNodeObjsModel());
m_swcNodeObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_swcNodeObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_swcNodeObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(processDoubleClickOnCategorizedSwcNode(QModelIndex)));
connect(m_swcNodeObjsTreeView->selectionModel(),
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(updateSelectionFromCategorizedSwcNode(QItemSelection,QItemSelection)));
tabs->addTab(m_swcNodeObjsTreeView, "Neuron Nodes");
}
if (NeutubeConfig::getInstance().getMainWindowConfig().isMarkPunctaOn()) {
m_punctaObjsTreeView = new QTreeView(this);
m_punctaObjsTreeView->setSortingEnabled(true);
m_punctaObjsTreeView->setExpandsOnDoubleClick(false);
m_punctaProxyModel = new QSortFilterProxyModel(this);
m_punctaProxyModel->setSourceModel(m_doc->punctaObjsModel());
//m_punctaObjsTreeView->setModel(m_doc->punctaObjsModel());
m_punctaObjsTreeView->setModel(m_punctaProxyModel);
m_punctaObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_punctaObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_punctaObjsTreeView, SIGNAL(doubleClicked(QModelIndex)),
this, SLOT(punctaItemDoubleClicked(QModelIndex)));
connect(m_punctaObjsTreeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(punctaSelectionChangedFromTreeView(QItemSelection,QItemSelection)));
m_punctaObjsTreeView->sortByColumn(0, Qt::AscendingOrder);
tabs->addTab(m_punctaObjsTreeView, "Puncta");
}
if (GET_APPLICATION_NAME == "FlyEM") {
m_seedObjsTreeView = new QTreeView(this);
m_seedObjsTreeView->setSortingEnabled(false);
m_seedObjsTreeView->setExpandsOnDoubleClick(false);
m_seedObjsTreeView->setModel(m_doc->seedObjsModel());
m_seedObjsTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection);
m_seedObjsTreeView->setContextMenuPolicy(Qt::CustomContextMenu);
tabs->addTab(m_seedObjsTreeView, "Seeds");
}
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(tabs);
setLayout(layout);
if (m_doc->hasSelectedPuncta()) {
//std::set<ZPunctum*> *selectedPuncta = m_doc->selectedPuncta();
QList<ZPunctum*> selected =
m_doc->getSelectedObjectList<ZPunctum>(ZStackObject::TYPE_PUNCTUM);
QList<ZPunctum*> deselected;
//std::copy(selectedPuncta->begin(), selectedPuncta->end(), std::back_inserter(selected));
punctaSelectionChanged(selected, deselected);
}
if (!m_doc->hasSelectedSwc()) {
//std::set<ZSwcTree*> *selectedSwcs = m_doc->selectedSwcs();
QList<ZSwcTree*> selected =
m_doc->getSelectedObjectList<ZSwcTree>(ZStackObject::TYPE_SWC);
QList<ZSwcTree*> deselected;
//std::copy(selectedSwcs->begin(), selectedSwcs->end(), std::back_inserter(selected));
swcSelectionChanged(selected, deselected);
}
if (m_doc->hasSelectedSwcNode()) {
std::set<Swc_Tree_Node*> nodeSet = m_doc->getSelectedSwcNodeSet();
QList<Swc_Tree_Node*> selected;
QList<Swc_Tree_Node*> deselected;
std::copy(nodeSet.begin(), nodeSet.end(),
std::back_inserter(selected));
swcTreeNodeSelectionChanged(selected, deselected);
}
connect(m_doc,
SIGNAL(punctaSelectionChanged(QList<ZPunctum*>,QList<ZPunctum*>)),
this, SLOT(punctaSelectionChanged(QList<ZPunctum*>,QList<ZPunctum*>)));
connect(m_doc,
SIGNAL(swcSelectionChanged(QList<ZSwcTree*>,QList<ZSwcTree*>)),
this, SLOT(swcSelectionChanged(QList<ZSwcTree*>,QList<ZSwcTree*>)));
connect(m_doc,
SIGNAL(swcTreeNodeSelectionChanged(QList<Swc_Tree_Node*>,QList<Swc_Tree_Node*>)),
this, SLOT(swcTreeNodeSelectionChanged(QList<Swc_Tree_Node*>,QList<Swc_Tree_Node*>)));
}
示例12: QWidget
PolygonView::PolygonView(PinEditDoc * doc, QWidget * parent, const char * name, Qt::WFlags f)
: QWidget(parent, name, f) {
assert(doc != NULL);
p_Doc = doc;
p_Shape = NULL;
p_Polygon = NULL;
m_bSelectionChanged = true;
p_Doc->registerUpdateable(this, "polygon");
p_Doc->registerRebuildable(this, "polygon");
// the polygon list view
p_PolygonListView = new Q3ListView(this);
connect(p_PolygonListView, SIGNAL(selectionChanged()), this, SLOT(slotChanged()));
p_PolygonListView->setSelectionMode(Q3ListView::Extended);
p_PolygonListView->addColumn(QString("polygons"));
p_PolygonListView->setMinimumSize(200, 240);
// the vertex list view
p_VertexListView = new Q3ListView(this);
connect(p_VertexListView, SIGNAL(selectionChanged()), this, SLOT(slotVertexChanged()));
p_VertexListView->setSelectionMode(Q3ListView::Single);
p_VertexListView->addColumn(QString("vertices for polygon"));
p_VertexListView->setMinimumSize(200, 80);
// tabs and widgets
QTabWidget * tabWidget = new QTabWidget(this);
//tabWidget->setFixedSize(200, 80);
tabWidget->setMinimumSize(200, 80);
// main layout
Q3BoxLayout * vlayout = new Q3VBoxLayout(this);
vlayout->addWidget(p_PolygonListView);
vlayout->addWidget(p_VertexListView);
vlayout->addWidget(tabWidget);
vlayout->setStretchFactor(p_PolygonListView, 3);
vlayout->setStretchFactor(p_PolygonListView, 2);
vlayout->setStretchFactor(tabWidget, 0);
// the vertex order widget
{
QWidget * widget = new QWidget(this);
tabWidget->addTab(widget, "order");
p_ButtonUp = new QPushButton("up", widget);
connect(p_ButtonUp, SIGNAL(clicked()), this, SLOT(slotVertexUp()));
p_ButtonDown = new QPushButton("down", widget);
connect(p_ButtonDown, SIGNAL(clicked()), this, SLOT(slotVertexDown()));
Q3BoxLayout * layout = new Q3HBoxLayout(widget);
layout->addWidget(p_ButtonUp);
layout->addWidget(p_ButtonDown);
}
// the position widget
{
QWidget * widget = new QWidget(this);
tabWidget->addTab(widget, "position");
p_EditX = new QLineEdit(widget);
p_EditY = new QLineEdit(widget);
p_EditZ = new QLineEdit(widget);
connect(p_EditX, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
connect(p_EditY, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
connect(p_EditZ, SIGNAL(returnPressed()), this, SLOT(slotApplyVertex()));
p_ApplyVertexButton = new QPushButton("apply", widget);
connect(p_ApplyVertexButton, SIGNAL(clicked()), this, SLOT(slotApplyVertex()));
Q3BoxLayout * vlayoutc = new Q3VBoxLayout(widget);
Q3BoxLayout * hlayout = new Q3HBoxLayout(vlayoutc);
hlayout->addWidget(p_EditX);
hlayout->addWidget(p_EditY);
hlayout->addWidget(p_EditZ);
vlayoutc->addWidget(p_ApplyVertexButton);
}
// the color widget
{
QWidget * widget = new QWidget(this);
tabWidget->addTab(widget, "color");
p_EditR = new QLineEdit(widget);
p_EditG = new QLineEdit(widget);
p_EditB = new QLineEdit(widget);
p_EditA = new QLineEdit(widget);
connect(p_EditR, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
connect(p_EditG, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
connect(p_EditB, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
connect(p_EditA, SIGNAL(returnPressed()), this, SLOT(slotApplyColor()));
p_ApplyColorButton = new QPushButton("apply", widget);
connect(p_ApplyColorButton, SIGNAL(clicked()), this, SLOT(slotApplyColor()));
Q3BoxLayout * vlayoutc = new Q3VBoxLayout(widget);
Q3BoxLayout * hlayoutb = new Q3HBoxLayout(vlayoutc);
hlayoutb->addWidget(p_EditR);
hlayoutb->addWidget(p_EditG);
hlayoutb->addWidget(p_EditB);
hlayoutb->addWidget(p_EditA);
vlayoutc->addWidget(p_ApplyColorButton);
}
// properties widget
{
QWidget * widget = new QWidget(this);
tabWidget->addTab(widget, "prop");
//.........这里部分代码省略.........
示例13: mainWidget
void K3b::AudioRippingDialog::setupGui()
{
QWidget *frame = mainWidget();
QGridLayout* Form1Layout = new QGridLayout( frame );
Form1Layout->setContentsMargins( 0, 0, 0, 0 );
QTreeWidgetItem* header = new QTreeWidgetItem;
header->setText( 0, i18n( "Filename") );
header->setText( 1, i18n( "Length") );
header->setText( 2, i18n( "File Size") );
header->setText( 3, i18n( "Type") );
d->viewTracks = new QTreeWidget( frame );
d->viewTracks->setSortingEnabled( false );
d->viewTracks->setAllColumnsShowFocus( true );
d->viewTracks->setHeaderItem( header );
d->viewTracks->setRootIsDecorated( false );
d->viewTracks->setSelectionMode( QAbstractItemView::NoSelection );
d->viewTracks->setFocusPolicy( Qt::NoFocus );
d->viewTracks->header()->setStretchLastSection( false );
d->viewTracks->header()->setSectionResizeMode( 0, QHeaderView::Stretch );
d->viewTracks->header()->setSectionResizeMode( 1, QHeaderView::ResizeToContents );
d->viewTracks->header()->setSectionResizeMode( 2, QHeaderView::ResizeToContents );
d->viewTracks->header()->setSectionResizeMode( 3, QHeaderView::ResizeToContents );
QTabWidget* mainTab = new QTabWidget( frame );
m_optionWidget = new K3b::AudioConvertingOptionWidget( mainTab );
mainTab->addTab( m_optionWidget, i18n("Settings") );
// setup filename pattern page
// -------------------------------------------------------------------------------------------
m_patternWidget = new K3b::CddbPatternWidget( mainTab );
mainTab->addTab( m_patternWidget, i18n("File Naming") );
connect( m_patternWidget, SIGNAL(changed()), this, SLOT(refresh()) );
// setup advanced page
// -------------------------------------------------------------------------------------------
QWidget* advancedPage = new QWidget( mainTab );
QGridLayout* advancedPageLayout = new QGridLayout( advancedPage );
mainTab->addTab( advancedPage, i18n("Advanced") );
m_comboParanoiaMode = K3b::StdGuiItems::paranoiaModeComboBox( advancedPage );
m_spinRetries = new QSpinBox( advancedPage );
m_checkIgnoreReadErrors = new QCheckBox( i18n("Ignore read errors"), advancedPage );
m_checkUseIndex0 = new QCheckBox( i18n("Do not read pregaps"), advancedPage );
advancedPageLayout->addWidget( new QLabel( i18n("Paranoia mode:"), advancedPage ), 0, 0 );
advancedPageLayout->addWidget( m_comboParanoiaMode, 0, 1 );
advancedPageLayout->addWidget( new QLabel( i18n("Read retries:"), advancedPage ), 1, 0 );
advancedPageLayout->addWidget( m_spinRetries, 1, 1 );
advancedPageLayout->addWidget( m_checkIgnoreReadErrors, 2, 0, 0, 1 );
advancedPageLayout->addWidget( m_checkUseIndex0, 3, 0, 0, 1 );
advancedPageLayout->setRowStretch( 4, 1 );
advancedPageLayout->setColumnStretch( 2, 1 );
// -------------------------------------------------------------------------------------------
Form1Layout->addWidget( d->viewTracks, 0, 0 );
Form1Layout->addWidget( mainTab, 1, 0 );
Form1Layout->setRowStretch( 0, 1 );
setStartButtonText( i18n( "Start Ripping" ), i18n( "Starts copying the selected tracks") );
connect( m_checkUseIndex0, SIGNAL(toggled(bool)), this, SLOT(refresh()) );
connect( m_optionWidget, SIGNAL(changed()), this, SLOT(refresh()) );
}
示例14: filesmask
WndCustomizeGUI::WndCustomizeGUI():
Wnd("Customize GUI")
{
QVBoxLayout * topLayout = new QVBoxLayout(this);
QTabWidget * tabWidet = new QTabWidget(this);
topLayout->addWidget( tabWidet);
QWidget * colorsWidget = new QWidget( this);
tabWidet->addTab( colorsWidget, "Colors");
colorsWidget->setBackgroundRole( QPalette::Mid);
colorsWidget->setAutoFillBackground( true);
QWidget * starsWidget = new QWidget( this);
tabWidet->addTab( starsWidget, "Stars Shape");
starsWidget->setBackgroundRole( QPalette::Mid);
starsWidget->setAutoFillBackground( true);
QWidget * fontsWidget = new QWidget( this);
tabWidet->addTab( fontsWidget, "Fonts");
fontsWidget->setBackgroundRole( QPalette::Mid);
fontsWidget->setAutoFillBackground( true);
QWidget * imagesWidget = new QWidget( this);
tabWidet->addTab( imagesWidget, "Images");
imagesWidget->setBackgroundRole( QPalette::Mid);
imagesWidget->setAutoFillBackground( true);
QHBoxLayout * hlayout;
QVBoxLayout * vlayout;
QLabel * label;
ColorWidget * cw;
NumberWidget * nw;
FontWidget * ftw;
FileWidget * flw;
hlayout = new QHBoxLayout( colorsWidget);
vlayout = new QVBoxLayout();
#if QT_VERSION >= 0x040300
vlayout->setContentsMargins( 1, 1, 1, 1);
#endif
vlayout->setSpacing( 2);
hlayout->addLayout( vlayout);
label = new QLabel("QT standart GUI pallete:", this);
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter);
vlayout->addWidget( label);
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Window ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_WindowText ));
//vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_AlternateBase ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Base ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Text ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Button ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Light ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Midlight ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Mid ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Dark ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Shadow ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Highlight ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_HighlightedText ));
label = new QLabel("Watch specific colors:", this);
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter);
vlayout->addWidget( label);
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_item ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_selected ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_running ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_done ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_error ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_outline ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_star ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_starline ));
vlayout = new QVBoxLayout();
#if QT_VERSION >= 0x040300
vlayout->setContentsMargins( 1, 1, 1, 1);
#endif
vlayout->setSpacing( 2);
hlayout->addLayout( vlayout);
label = new QLabel("Qt not used palette:", this);
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter);
vlayout->addWidget( label);
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_Link ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_LinkVisited ));
label = new QLabel("Job Item Colors:", this);
label->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter);
vlayout->addWidget( label);
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_itemjoberror ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_itemjoboff ));
vlayout->addWidget( new ColorWidget( this, &afqt::QEnvironment::clr_itemjobwtime ));
//.........这里部分代码省略.........
示例15: init
//.........这里部分代码省略.........
createMenus();
QTabWidget* tabWidget = new QTabWidget(this);
tabWidget->setObjectName("celestia-tabbed-browser");
toolsDock = new QDockWidget(_("Celestial Browser"), this);
toolsDock->setObjectName("celestia-tools-dock");
toolsDock->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
// Create the various browser widgets
celestialBrowser = new CelestialBrowser(m_appCore, NULL);
celestialBrowser->setObjectName("celestia-browser");
connect(celestialBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
QWidget* deepSkyBrowser = new DeepSkyBrowser(m_appCore, NULL);
deepSkyBrowser->setObjectName("deepsky-browser");
connect(deepSkyBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
SolarSystemBrowser* solarSystemBrowser = new SolarSystemBrowser(m_appCore, NULL);
solarSystemBrowser->setObjectName("ssys-browser");
connect(solarSystemBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
// Set up the browser tabs
tabWidget->addTab(solarSystemBrowser, _("Solar System"));
tabWidget->addTab(celestialBrowser, _("Stars"));
tabWidget->addTab(deepSkyBrowser, _("Deep Sky Objects"));
toolsDock->setWidget(tabWidget);
addDockWidget(Qt::LeftDockWidgetArea, toolsDock);
infoPanel = new InfoPanel(_("Info Browser"), this);
infoPanel->setObjectName("info-panel");
infoPanel->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
addDockWidget(Qt::RightDockWidgetArea, infoPanel);
infoPanel->setVisible(false);
eventFinder = new EventFinder(m_appCore, _("Event Finder"), this);
eventFinder->setObjectName("event-finder");
eventFinder->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
addDockWidget(Qt::LeftDockWidgetArea, eventFinder);
eventFinder->setVisible(false);
//addDockWidget(Qt::DockWidgetArea, eventFinder);
// Create the time toolbar
TimeToolBar* timeToolBar = new TimeToolBar(m_appCore, _("Time"));
timeToolBar->setObjectName("time-toolbar");
timeToolBar->setFloatable(true);
timeToolBar->setMovable(true);
addToolBar(Qt::TopToolBarArea, timeToolBar);
// Create the guides toolbar
QToolBar* guidesToolBar = new QToolBar(_("Guides"));
guidesToolBar->setObjectName("guides-toolbar");
guidesToolBar->setFloatable(true);