本文整理汇总了C++中configChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ configChanged函数的具体用法?C++ configChanged怎么用?C++ configChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了configChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pwrCurve
//.........这里部分代码省略.........
// Setup the axis (of evil :-)
setAxisTitle(yLeft, "Watts");
setAxisTitle(yRight, "Cadence / HR");
setAxisTitle(yRight2, "Speed");
setAxisTitle(xBottom, "Seconds Ago");
setAxisMaxMinor(xBottom, 0);
setAxisMaxMinor(yLeft, 0);
setAxisMaxMinor(yLeft2, 0);
setAxisMaxMinor(yRight, 0);
setAxisMaxMinor(yRight2, 0);
QPalette pal;
setAxisScale(yLeft, 0, 500); // watts
pal.setColor(QPalette::WindowText, GColor(CPOWER));
pal.setColor(QPalette::Text, GColor(CPOWER));
axisWidget(QwtPlot::yLeft)->setPalette(pal);
axisWidget(QwtPlot::yLeft)->scaleDraw()->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScale(yRight, 0, 230); // cadence / hr
pal.setColor(QPalette::WindowText, GColor(CHEARTRATE));
pal.setColor(QPalette::Text, GColor(CHEARTRATE));
axisWidget(QwtPlot::yRight)->setPalette(pal);
axisWidget(QwtPlot::yRight)->scaleDraw()->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScale(xBottom, MAXSAMPLES, 0, 15); // time ago
pal.setColor(QPalette::WindowText, GColor(CPLOTMARKER));
pal.setColor(QPalette::Text, GColor(CPLOTMARKER));
axisWidget(QwtPlot::xBottom)->setPalette(pal);
axisWidget(QwtPlot::xBottom)->scaleDraw()->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScale(yRight2, 0, 60); // speed km/h - 60kmh on a turbo is good going!
pal.setColor(QPalette::WindowText, GColor(CSPEED));
pal.setColor(QPalette::Text, GColor(CSPEED));
axisWidget(QwtPlot::yRight2)->setPalette(pal);
axisWidget(QwtPlot::yRight2)->scaleDraw()->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisLabelRotation(yRight2,90);
setAxisLabelAlignment(yRight2,Qt::AlignVCenter);
enableAxis(xBottom, false); // very little value and some cpu overhead
enableAxis(yLeft, true);
enableAxis(yRight, true);
enableAxis(yRight2, true);
// 30s Power curve
pwr30Curve = new QwtPlotCurve("30s Power");
pwr30Curve->setRenderHint(QwtPlotItem::RenderAntialiased); // too cpu intensive
pwr30Curve->attach(this);
pwr30Curve->setYAxis(QwtPlot::yLeft);
// Power curve
pwrCurve = new QwtPlotCurve("Power");
//pwrCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
pwrCurve->setData(pwrData);
pwrCurve->attach(this);
pwrCurve->setYAxis(QwtPlot::yLeft);
altPwrCurve = new QwtPlotCurve("Alt Power");
//pwrCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
altPwrCurve->setData(altPwrData);
altPwrCurve->attach(this);
altPwrCurve->setYAxis(QwtPlot::yLeft);
// HR
hrCurve = new QwtPlotCurve("HeartRate");
//hrCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
hrCurve->setData(hrData);
hrCurve->attach(this);
hrCurve->setYAxis(QwtPlot::yRight);
// Cadence
cadCurve = new QwtPlotCurve("Cadence");
//cadCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
cadCurve->setData(cadData);
cadCurve->attach(this);
cadCurve->setYAxis(QwtPlot::yRight);
// Speed
spdCurve = new QwtPlotCurve("Speed");
//spdCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
spdCurve->setData(spdData);
spdCurve->attach(this);
spdCurve->setYAxis(QwtPlot::yRight2);
// Load
// lodCurve = new QwtPlotCurve("Load");
// //lodCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
// QPen lodpen = QPen(QColor(128,128,128));
// lodpen.setWidth(2.0);
// lodCurve->setPen(lodpen);
// QColor brush_color = QColor(124, 91, 31);
// brush_color.setAlpha(64);
// lodCurve->setBrush(brush_color); // fill below the line
// lodCurve->setData(lodData);
// lodCurve->attach(this);
// lodCurve->setYAxis(QwtPlot::yLeft);
canvas()->setFrameStyle(QFrame::NoFrame);
configChanged(); // set colors
}
开发者ID:FuzzyBunnys,项目名称:GoldenCheetah,代码行数:101,代码来源:RealtimePlot.cpp
示例2: GcWindow
//.........这里部分代码省略.........
hl->addWidget(titleEdit);
cl->addLayout(hl);
cl->addSpacing(15);
cl->addWidget(controlStack);
setControls(cw);
setProperty("isManager", true);
setAcceptDrops(true);
QVBoxLayout *layout = new QVBoxLayout(this);
QFont bigandbold;
bigandbold.setPointSize(bigandbold.pointSize() + 2);
bigandbold.setWeight(QFont::Bold);
style = new QStackedWidget(this);
style->setAutoFillBackground(false);
layout->setSpacing(0);
layout->setContentsMargins(0,0,0,0);
layout->addWidget(style);
QPalette palette;
palette.setBrush(backgroundRole(), QColor("#B3B4B6"));
setAutoFillBackground(false);
// each style has its own container widget
QWidget *tabArea = new QWidget(this);
tabArea->setContentsMargins(0,0,0,0); // no spacing now, used to be 20px
QVBoxLayout *tabLayout = new QVBoxLayout(tabArea);
tabLayout->setContentsMargins(0,0,0,0);
tabLayout->setSpacing(0);
tabbed = new QStackedWidget(this);
chartbar = new ChartBar(context);
tabLayout->addWidget(chartbar);
tabLayout->addWidget(tabbed);
style->addWidget(tabArea);
// tiled
tileWidget = new QWidget(this);
tileWidget->setAutoFillBackground(false);
tileWidget->setPalette(palette);
tileWidget->setContentsMargins(0,0,0,0);
tileGrid = new QGridLayout(tileWidget);
tileGrid->setSpacing(0);
tileArea = new QScrollArea(this);
#ifdef Q_OS_WIN
QStyle *cde = QStyleFactory::create(OS_STYLE);
tileArea->setStyle(cde);
#endif
tileArea->setAutoFillBackground(false);
tileArea->setPalette(palette);
tileArea->setWidgetResizable(true);
tileArea->setWidget(tileWidget);
tileArea->setFrameStyle(QFrame::NoFrame);
tileArea->setContentsMargins(0,0,0,0);
style->addWidget(tileArea);
winWidget = new QWidget(this);
winWidget->setAutoFillBackground(false);
winWidget->setContentsMargins(0,0,0,0);
winWidget->setPalette(palette);
winFlow = new GcWindowLayout(winWidget, 0, tileSpacing, tileSpacing);
winFlow->setContentsMargins(tileMargin,tileMargin,tileMargin,tileMargin);
winArea = new QScrollArea(this);
winArea->setAutoFillBackground(false);
winArea->setPalette(palette);
winArea->setWidgetResizable(true);
winArea->setWidget(winWidget);
winArea->setFrameStyle(QFrame::NoFrame);
winArea->setContentsMargins(0,0,0,0);
style->addWidget(winArea);
winWidget->installEventFilter(this); // to draw cursor
winWidget->setMouseTracking(true); // to draw cursor
// enable right click to add a chart
winArea->setContextMenuPolicy(Qt::CustomContextMenu);
tabArea->setContextMenuPolicy(Qt::CustomContextMenu);
connect(winArea,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(rightClick(const QPoint &)));
connect(tabArea,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(rightClick(const QPoint &)));
currentStyle=-1;
styleChanged(2);
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideSelected()));
connect(this, SIGNAL(dateRangeChanged(DateRange)), this, SLOT(dateRangeChanged(DateRange)));
connect(context, SIGNAL(configChanged()), this, SLOT(configChanged()));
//connect(tabbed, SIGNAL(currentChanged(int)), this, SLOT(tabSelected(int)));
//connect(tabbed, SIGNAL(tabCloseRequested(int)), this, SLOT(removeChart(int)));
//connect(tb, SIGNAL(tabMoved(int,int)), this, SLOT(tabMoved(int,int)));
connect(chartbar, SIGNAL(currentIndexChanged(int)), this, SLOT(tabSelected(int)));
connect(titleEdit, SIGNAL(textChanged(const QString&)), SLOT(titleChanged()));
installEventFilter(this);
qApp->installEventFilter(this);
}
开发者ID:cernst72,项目名称:GoldenCheetah,代码行数:101,代码来源:HomeWindow.cpp
示例3: configChanged
void KdeConnectPluginConfig::slotConfigChanged()
{
Q_EMIT configChanged();
}
开发者ID:KDE,项目名称:kdeconnect-kde,代码行数:4,代码来源:kdeconnectpluginconfig.cpp
示例4: rideItem
PfPvPlot::PfPvPlot(Context *context)
: rideItem (NULL), context(context), hover(NULL), cp_ (0), cad_ (85), cl_ (0.175), shade_zones(true)
{
static_cast<QwtPlotCanvas*>(canvas())->setFrameStyle(QFrame::NoFrame);
setAutoFillBackground(true);
setAxisTitle(yLeft, tr("Average Effective Pedal Force (N)"));
setAxisScale(yLeft, 0, 600);
setAxisTitle(xBottom, tr("Circumferential Pedal Velocity (m/s)"));
setAxisScale(xBottom, 0, 3);
setAxisMaxMinor(yLeft, 0);
setAxisMaxMinor(xBottom, 0);
QwtScaleDraw *sd = new QwtScaleDraw;
sd->setTickLength(QwtScaleDiv::MajorTick, 3);
setAxisScaleDraw(xBottom, sd);
sd = new QwtScaleDraw;
sd->setTickLength(QwtScaleDiv::MajorTick, 3);
sd->enableComponent(QwtScaleDraw::Ticks, false);
sd->enableComponent(QwtScaleDraw::Backbone, false);
setAxisScaleDraw(yLeft, sd);
mX = new QwtPlotMarker();
mX->setLineStyle(QwtPlotMarker::VLine);
mX->attach(this);
mY = new QwtPlotMarker();
mY->setLineStyle(QwtPlotMarker::HLine);
mY->attach(this);
cpCurve = new QwtPlotCurve();
cpCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
cpCurve->attach(this);
curve = new QwtPlotCurve();
curve->attach(this);
cl_ = appsettings->value(this, GC_CRANKLENGTH).toDouble() / 1000.0;
// markup timeInQuadrant
tiqMarker[0] = new QwtPlotMarker(); tiqMarker[0]->attach(this);
tiqMarker[0]->setXValue(2.9);
tiqMarker[0]->setYValue(580);
tiqMarker[1] = new QwtPlotMarker(); tiqMarker[1]->attach(this);
tiqMarker[1]->setXValue(0.1);
tiqMarker[1]->setYValue(580);
tiqMarker[2] = new QwtPlotMarker(); tiqMarker[2]->attach(this);
tiqMarker[2]->setXValue(0.1);
tiqMarker[2]->setYValue(10);
tiqMarker[3] = new QwtPlotMarker(); tiqMarker[3]->attach(this);
tiqMarker[3]->setXValue(2.9);
tiqMarker[3]->setYValue(10);
merge_intervals = false;
frame_intervals = true;
gear_ratio_display = false;
// only default on first time through, after this the user may have adjusted
if (appsettings->value(this, GC_SHADEZONES, true).toBool()==false) shade_zones = false;
else shade_zones = true;
configChanged();
recalc();
}
开发者ID:cernst72,项目名称:GoldenCheetah,代码行数:67,代码来源:PfPvPlot.cpp
示例5: FriendMapConfigPage
ConfigPage* FriendMapController::qt_config_page() const {
auto configPage = new FriendMapConfigPage(settings);
connect(configPage, SIGNAL(configChanged()), this, SLOT(configChanged()));
return configPage;
}
开发者ID:Nyfor,项目名称:FriendMap,代码行数:5,代码来源:FriendMapController.cpp
示例6: minX
PowerHist::PowerHist(Context *context):
minX(0),
maxX(0),
rideItem(NULL),
context(context),
series(RideFile::watts),
lny(false),
shade(false),
zoned(false),
binw(3),
withz(true),
dt(1),
absolutetime(true),
cache(NULL),
source(Ride)
{
binw = appsettings->value(this, GC_HIST_BIN_WIDTH, 5).toInt();
if (appsettings->value(this, GC_SHADEZONES, true).toBool() == true)
shade = true;
else
shade = false;
// create a background object for shading
bg = new PowerHistBackground(this);
bg->attach(this);
hrbg = new HrHistBackground(this);
hrbg->attach(this);
setCanvasBackground(Qt::white);
canvas()->setFrameStyle(QFrame::NoFrame);
setParameterAxisTitle();
setAxisTitle(yLeft, absolutetime ? tr("Time (minutes)") : tr("Time (percent)"));
curve = new QwtPlotCurve("");
curve->setStyle(QwtPlotCurve::Steps);
curve->setRenderHint(QwtPlotItem::RenderAntialiased);
curve->attach(this);
curveSelected = new QwtPlotCurve("");
curveSelected->setStyle(QwtPlotCurve::Steps);
curveSelected->setRenderHint(QwtPlotItem::RenderAntialiased);
curveSelected->attach(this);
grid = new QwtPlotGrid();
grid->enableX(false);
grid->attach(this);
zoneLabels = QList<PowerHistZoneLabel *>();
hrzoneLabels = QList<HrHistZoneLabel *>();
zoomer = new penTooltip(this->canvas());
canvasPicker = new LTMCanvasPicker(this);
connect(canvasPicker, SIGNAL(pointHover(QwtPlotCurve*, int)), this, SLOT(pointHover(QwtPlotCurve*, int)));
setAxisMaxMinor(xBottom, 0);
setAxisMaxMinor(yLeft, 0);
configChanged();
}
开发者ID:ClaFio,项目名称:GoldenCheetah,代码行数:61,代码来源:PowerHist.cpp
示例7: GcChartWindow
//.........这里部分代码省略.........
setRevealLayout(revealLayout);
// the plot
QVBoxLayout *vlayout = new QVBoxLayout;
pfPvPlot = new PfPvPlot(context);
vlayout->addWidget(pfPvPlot);
HelpWhatsThis *help = new HelpWhatsThis(pfPvPlot);
pfPvPlot->setWhatsThis(help->getWhatsThisText(HelpWhatsThis::ChartRides_PFvV));
setChartLayout(vlayout);
setAutoFillBackground(true);
// allow zooming
pfpvZoomer = new QwtPlotZoomer(pfPvPlot->canvas());
pfpvZoomer->setRubberBand(QwtPicker::RectRubberBand);
pfpvZoomer->setRubberBandPen(GColor(CPLOTSELECT));
pfpvZoomer->setTrackerMode(QwtPicker::AlwaysOff);
pfpvZoomer->setEnabled(true);
pfpvZoomer->setMousePattern(QwtEventPattern::MouseSelect1, Qt::LeftButton);
pfpvZoomer->setMousePattern(QwtEventPattern::MouseSelect2, Qt::RightButton, Qt::ControlModifier);
pfpvZoomer->setMousePattern(QwtEventPattern::MouseSelect3, Qt::RightButton);
// double click
doubleClickPicker = new PfPvDoubleClickPicker(pfPvPlot);
// the controls
QFormLayout *f = new QFormLayout;
cl->addLayout(f);
QLabel *qaCPLabel = new QLabel(tr("Watts:"), this);
qaCPValue = new QLineEdit(QString("%1").arg(pfPvPlot->getCP()));
qaCPValue->setValidator(new QIntValidator(0, 9999, qaCPValue));
f->addRow(qaCPLabel, qaCPValue);
QLabel *qaCadLabel = new QLabel(tr("RPM:"), this);
qaCadValue = new QLineEdit(QString("%1").arg(pfPvPlot->getCAD()));
qaCadValue->setValidator(new QIntValidator(0, 999, qaCadValue));
f->addRow(qaCadLabel, qaCadValue);
QLabel *qaClLabel = new QLabel(tr("Crank Length (m):"), this);
qaClValue = new QLineEdit(QString("%1").arg(1000 * pfPvPlot->getCL()));
f->addRow(qaClLabel, qaClValue);
shadeZonesPfPvCheckBox = new QCheckBox;
shadeZonesPfPvCheckBox->setText(tr("Shade zones"));
if (appsettings->value(this, GC_SHADEZONES, true).toBool() == true)
shadeZonesPfPvCheckBox->setCheckState(Qt::Checked);
else
shadeZonesPfPvCheckBox->setCheckState(Qt::Unchecked);
cl->addWidget(shadeZonesPfPvCheckBox);
mergeIntervalPfPvCheckBox = new QCheckBox;
mergeIntervalPfPvCheckBox->setText(tr("Merge intervals"));
mergeIntervalPfPvCheckBox->setCheckState(Qt::Unchecked);
cl->addWidget(mergeIntervalPfPvCheckBox);
frameIntervalPfPvCheckBox = new QCheckBox;
frameIntervalPfPvCheckBox->setText(tr("Frame intervals"));
frameIntervalPfPvCheckBox->setCheckState(Qt::Checked);
cl->addWidget(frameIntervalPfPvCheckBox);
gearRatioDisplayPfPvCheckBox = new QCheckBox;
gearRatioDisplayPfPvCheckBox->setText(tr("Gear Ratio Display"));
gearRatioDisplayPfPvCheckBox->setCheckState(Qt::Checked);
cl->addWidget(gearRatioDisplayPfPvCheckBox);
cl->addStretch();
connect(pfPvPlot, SIGNAL(changedCP(const QString&)), qaCPValue, SLOT(setText(const QString&)) );
connect(pfPvPlot, SIGNAL(changedCAD(const QString&)), qaCadValue, SLOT(setText(const QString&)) );
connect(pfPvPlot, SIGNAL(changedCL(const QString&)), qaClValue, SLOT(setText(const QString&)) );
connect(qaCPValue, SIGNAL(editingFinished()), this, SLOT(setQaCPFromLineEdit()));
connect(qaCadValue, SIGNAL(editingFinished()), this, SLOT(setQaCADFromLineEdit()));
connect(qaClValue, SIGNAL(editingFinished()), this, SLOT(setQaCLFromLineEdit()));
connect(shadeZonesPfPvCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setShadeZonesPfPvFromCheckBox()));
connect(rShade, SIGNAL(stateChanged(int)), this, SLOT(setrShadeZonesPfPvFromCheckBox()));
connect(mergeIntervalPfPvCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setMergeIntervalsPfPvFromCheckBox()));
connect(rMergeInterval, SIGNAL(stateChanged(int)), this, SLOT(setrMergeIntervalsPfPvFromCheckBox()));
connect(frameIntervalPfPvCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setFrameIntervalsPfPvFromCheckBox()));
connect(rFrameInterval, SIGNAL(stateChanged(int)), this, SLOT(setrFrameIntervalsPfPvFromCheckBox()));
connect(gearRatioDisplayPfPvCheckBox, SIGNAL(stateChanged(int)), this, SLOT(setGearRatioDisplayPfPvFromCheckBox()));
connect(doubleClickPicker, SIGNAL(doubleClicked(int, int)), this, SLOT(doubleClicked(int, int)));
// GC signals
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(rideSelected()));
connect(context, SIGNAL(rideChanged(RideItem*)), this, SLOT(forceReplot()));
connect(context, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));
connect(context, SIGNAL(intervalsChanged()), this, SLOT(intervalSelected()));
connect(context, SIGNAL(intervalHover(IntervalItem*)), this, SLOT(intervalHover(IntervalItem*)));
connect(context->athlete, SIGNAL(zonesChanged()), this, SLOT(zonesChanged()));
connect(context, SIGNAL(configChanged(qint32)), this, SLOT(configChanged(qint32)));
connect(context, SIGNAL(configChanged(qint32)), pfPvPlot, SLOT(configChanged(qint32)));
// comparing things
connect(context, SIGNAL(compareIntervalsStateChanged(bool)), this, SLOT(compareChanged()));
connect(context, SIGNAL(compareIntervalsChanged()), this, SLOT(compareChanged()));
configChanged(CONFIG_APPEARANCE);
// share current setting with Plot
setGearRatioDisplayPfPvFromCheckBox();
}
开发者ID:AndyBryson,项目名称:GoldenCheetah,代码行数:101,代码来源:PfPvWindow.cpp
示例8: qDebug
/*! \brief Load new configuration.
* \param cfgfile
* \returns True if config is OK, False if not (e.g. no input device specified).
*
* If cfgfile is an absolute path it will be used as is, otherwise it is assumed to be the
* name of a file under m_cfg_dir.
*
* If cfgfile does not exist it will be created.
*
* If no input device is specified, we return false to signal that the I/O configuration
* dialog should be run.
*
* FIXME: Refactor.
*/
bool MainWindow::loadConfig(const QString cfgfile, bool check_crash)
{
bool conf_ok = false;
bool skipLoadingSettings = false;
qDebug() << "Loading configuration from:" << cfgfile;
if (m_settings)
delete m_settings;
if (QDir::isAbsolutePath(cfgfile))
m_settings = new QSettings(cfgfile, QSettings::IniFormat);
else
m_settings = new QSettings(QString("%1/%2").arg(m_cfg_dir).arg(cfgfile), QSettings::IniFormat);
qDebug() << "Configuration file:" << m_settings->fileName();
if (check_crash)
{
if (m_settings->value("crashed", false).toBool())
{
qDebug() << "Crash guard triggered!" << endl;
QMessageBox* askUserAboutConfig =
new QMessageBox(QMessageBox::Warning, tr("Crash Detected!"),
tr("<p>Gqrx has detected problems with the current configuration. "
"Loading the configuration again could cause the application to crash.</p>"
"<p>Do you want to edit the settings?</p>"),
QMessageBox::Yes | QMessageBox::No);
askUserAboutConfig->setDefaultButton(QMessageBox::Yes);
askUserAboutConfig->setTextFormat(Qt::RichText);
askUserAboutConfig->exec();
if (askUserAboutConfig->result() == QMessageBox::Yes)
skipLoadingSettings = true;
delete askUserAboutConfig;
}
else
{
m_settings->setValue("crashed", true); // clean exit will set this to FALSE
saveConfig(cfgfile);
}
}
if (skipLoadingSettings)
return false;
emit configChanged(m_settings);
// manual reconf (FIXME: check status)
bool conv_ok = false;
QString indev = m_settings->value("input/device", "").toString();
if (!indev.isEmpty())
{
conf_ok = true;
rx->set_input_device(indev.toStdString());
// Update window title
QRegExp regexp("'([a-zA-Z0-9 \\-\\_\\/\\.\\,\\(\\)]+)'");
QString devlabel;
if (regexp.indexIn(indev, 0) != -1)
devlabel = regexp.cap(1);
else
devlabel = indev; //"Unknown";
setWindowTitle(QString("Gqrx %1 - %2").arg(VERSION).arg(devlabel));
// Add available antenna connectors to the UI
std::vector<std::string> antennas = rx->get_antennas();
uiDockInputCtl->setAntennas(antennas);
}
QString outdev = m_settings->value("output/device", "").toString();
rx->set_output_device(outdev.toStdString());
int sr = m_settings->value("input/sample_rate", 0).toInt(&conv_ok);
if (conv_ok && (sr > 0))
{
double actual_rate = rx->set_input_rate(sr);
qDebug() << "Requested sample rate:" << sr;
qDebug() << "Actual sample rate :" << QString("%1").arg(actual_rate, 0, 'f', 6);
uiDockRxOpt->setFilterOffsetRange((qint64)(0.9*actual_rate));
ui->plotter->setSampleRate(actual_rate);
ui->plotter->setSpanFreq((quint32)actual_rate);
}
//.........这里部分代码省略.........
开发者ID:scottdm,项目名称:gqrx,代码行数:101,代码来源:mainwindow.cpp
示例9: TopWin
ArrangerView::ArrangerView(QWidget* parent)
: TopWin(TopWin::ARRANGER, parent, "arrangerview", Qt::Window)
{
setWindowTitle(tr("MusE: Arranger"));
setFocusPolicy(Qt::NoFocus);
arranger = new Arranger(this, "arranger");
setCentralWidget(arranger);
//setFocusProxy(arranger);
scoreOneStaffPerTrackMapper = new QSignalMapper(this);
scoreAllInOneMapper = new QSignalMapper(this);
editSignalMapper = new QSignalMapper(this);
QShortcut* sc = new QShortcut(shortcuts[SHRT_DELETE].key, this);
sc->setContext(Qt::WindowShortcut);
connect(sc, SIGNAL(activated()), editSignalMapper, SLOT(map()));
editSignalMapper->setMapping(sc, CMD_DELETE);
// Toolbars ---------------------------------------------------------
editTools = new EditToolBar(this, arrangerTools);
addToolBar(editTools);
editTools->setObjectName("arrangerTools");
visTracks = new VisibleTracks(this);
addToolBar(visTracks);
connect(editTools, SIGNAL(toolChanged(int)), arranger, SLOT(setTool(int)));
connect(visTracks, SIGNAL(visibilityChanged()), MusEGlobal::song, SLOT(update()) );
connect(arranger, SIGNAL(editPart(MusECore::Track*)), MusEGlobal::muse, SLOT(startEditor(MusECore::Track*)));
connect(arranger, SIGNAL(dropSongFile(const QString&)), MusEGlobal::muse, SLOT(loadProjectFile(const QString&)));
connect(arranger, SIGNAL(dropMidiFile(const QString&)), MusEGlobal::muse, SLOT(importMidi(const QString&)));
connect(arranger, SIGNAL(startEditor(MusECore::PartList*,int)), MusEGlobal::muse, SLOT(startEditor(MusECore::PartList*,int)));
connect(arranger, SIGNAL(toolChanged(int)), editTools, SLOT(set(int)));
connect(MusEGlobal::muse, SIGNAL(configChanged()), arranger, SLOT(configChanged()));
connect(arranger, SIGNAL(setUsedTool(int)), editTools, SLOT(set(int)));
connect(arranger, SIGNAL(selectionChanged()), SLOT(selectionChanged()));
connect(MusEGlobal::song, SIGNAL(songChanged(MusECore::SongChangedFlags_t)), this, SLOT(songChanged(MusECore::SongChangedFlags_t)));
//-------- Edit Actions
editCutAction = new QAction(QIcon(*editcutIconSet), tr("C&ut"), this);
editCopyAction = new QAction(QIcon(*editcopyIconSet), tr("&Copy"), this);
editCopyRangeAction = new QAction(QIcon(*editcopyIconSet), tr("Copy in range"), this);
editPasteAction = new QAction(QIcon(*editpasteIconSet), tr("&Paste"), this);
editPasteCloneAction = new QAction(QIcon(*editpasteCloneIconSet), tr("Paste c&lone"), this);
editPasteToTrackAction = new QAction(QIcon(*editpaste2TrackIconSet), tr("Paste to selected &track"), this);
editPasteCloneToTrackAction = new QAction(QIcon(*editpasteClone2TrackIconSet), tr("Paste clone to selected trac&k"), this);
editPasteDialogAction = new QAction(QIcon(*editpasteIconSet), tr("Paste (show dialo&g)"), this);
editInsertEMAction = new QAction(QIcon(*editpasteIconSet), tr("&Insert Empty Measure"), this);
editDeleteSelectedAction = new QAction(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), this);
editDuplicateSelTrackAction = new QAction(QIcon(*edit_track_addIcon), tr("Duplicate Selected Tracks"), this);
editShrinkPartsAction = new QAction(tr("Shrink selected parts"), this);
editExpandPartsAction = new QAction(tr("Expand selected parts"), this);
editCleanPartsAction = new QAction(tr("Purge hidden events from selected parts"), this);
addTrack = new QMenu(tr("Add Track"), this);
addTrack->setIcon(QIcon(*edit_track_addIcon));
select = new QMenu(tr("Select"), this);
select->setIcon(QIcon(*selectIcon));
editSelectAllAction = new QAction(QIcon(*select_allIcon), tr("Select &All"), this);
editDeselectAllAction = new QAction(QIcon(*select_deselect_allIcon), tr("&Deselect All"), this);
editInvertSelectionAction = new QAction(QIcon(*select_invert_selectionIcon), tr("Invert &Selection"), this);
editInsideLoopAction = new QAction(QIcon(*select_inside_loopIcon), tr("&Inside Loop"), this);
editOutsideLoopAction = new QAction(QIcon(*select_outside_loopIcon), tr("&Outside Loop"), this);
editAllPartsAction = new QAction( QIcon(*select_all_parts_on_trackIcon), tr("All &Parts on Track"), this);
scoreSubmenu = new QMenu(tr("Score"), this);
scoreSubmenu->setIcon(QIcon(*scoreIconSet));
scoreAllInOneSubsubmenu = new QMenu(tr("all tracks in one staff"), this);
scoreOneStaffPerTrackSubsubmenu = new QMenu(tr("one staff per track"), this);
scoreSubmenu->addMenu(scoreAllInOneSubsubmenu);
scoreSubmenu->addMenu(scoreOneStaffPerTrackSubsubmenu);
updateScoreMenus();
startScoreEditAction = new QAction(*scoreIconSet, tr("New score window"), this);
startPianoEditAction = new QAction(*pianoIconSet, tr("Pianoroll"), this);
startDrumEditAction = new QAction(QIcon(*edit_drummsIcon), tr("Drums"), this);
startListEditAction = new QAction(QIcon(*edit_listIcon), tr("List"), this);
startWaveEditAction = new QAction(QIcon(*edit_waveIcon), tr("Wave"), this);
master = new QMenu(tr("Mastertrack"), this);
master->setIcon(QIcon(*edit_mastertrackIcon));
masterGraphicAction = new QAction(QIcon(*mastertrack_graphicIcon),tr("Graphic"), this);
masterListAction = new QAction(QIcon(*mastertrack_listIcon),tr("List"), this);
midiTransformerAction = new QAction(QIcon(*midi_transformIcon), tr("Midi &Transform"), this);
//.........这里部分代码省略.........
开发者ID:Windfisch,项目名称:muse,代码行数:101,代码来源:arrangerview.cpp
示例10: xEventNotifier
KeyboardApplet::KeyboardApplet(QObject *parent, const QVariantList &args):
Plasma::Applet(parent, args),
xEventNotifier(),
rules(Rules::readRules(Rules::READ_EXTRAS)),
keyboardConfig(new KeyboardConfig()),
layoutsMenu(new LayoutsMenu(*keyboardConfig, *rules, flags))
{
if( ! X11Helper::xkbSupported(NULL) ) {
setFailedToLaunch(true, i18n("XKB extension failed to initialize"));
return;
}
m_svg = new Plasma::Svg(this);
m_svg->setImagePath("widgets/labeltexture");
m_svg->setContainsMultipleImages(true);
resize(48,48);
setHasConfigurationInterface(false);
setAspectRatioMode(Plasma::KeepAspectRatio);
//setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
setBackgroundHints(DefaultBackground);
connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SLOT(themeChanged()));
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.connect(QString(), KEYBOARD_DBUS_OBJECT_PATH, KEYBOARD_DBUS_SERVICE_NAME, KEYBOARD_DBUS_CONFIG_RELOAD_MESSAGE, this, SLOT(configChanged()));
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:27,代码来源:keyboard_applet.cpp
示例11: SLOT
KeyboardApplet::~KeyboardApplet()
{
QDBusConnection dbus = QDBusConnection::sessionBus();
dbus.disconnect(QString(), KEYBOARD_DBUS_OBJECT_PATH, KEYBOARD_DBUS_SERVICE_NAME, KEYBOARD_DBUS_CONFIG_RELOAD_MESSAGE, this, SLOT(configChanged()));
delete layoutsMenu;
delete rules;
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:8,代码来源:keyboard_applet.cpp
示例12: MidiEditor
//.........这里部分代码省略.........
selectNextPartAction = select->addAction(QIcon(*select_all_parts_on_trackIcon), tr("&Next Part"));
mapper->setMapping(selectNextPartAction, WaveCanvas::CMD_SELECT_NEXT_PART);
connect(selectNextPartAction, SIGNAL(triggered()), mapper, SLOT(map()));
QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config"));
eventColor = settingsMenu->addMenu(tr("&Event Color"));
QActionGroup* actgrp = new QActionGroup(this);
actgrp->setExclusive(true);
evColorNormalAction = actgrp->addAction(tr("&Part colors"));
evColorNormalAction->setCheckable(true);
colorMapper->setMapping(evColorNormalAction, 0);
evColorPartsAction = actgrp->addAction(tr("&Gray"));
evColorPartsAction->setCheckable(true);
colorMapper->setMapping(evColorPartsAction, 1);
connect(evColorNormalAction, SIGNAL(triggered()), colorMapper, SLOT(map()));
connect(evColorPartsAction, SIGNAL(triggered()), colorMapper, SLOT(map()));
eventColor->addActions(actgrp->actions());
connect(colorMapper, SIGNAL(mapped(int)), this, SLOT(eventColorModeChanged(int)));
settingsMenu->addSeparator();
settingsMenu->addAction(subwinAction);
settingsMenu->addAction(shareAction);
settingsMenu->addAction(fullscreenAction);
connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
//--------------------------------------------------
// ToolBar: Solo Cursor1 Cursor2
tools2 = new MusEGui::EditToolBar(this, waveEditTools);
addToolBar(tools2);
addToolBarBreak();
tb1 = addToolBar(tr("WaveEdit tools"));
tb1->setObjectName("WaveEdit tools");
//tb1->setLabel(tr("weTools"));
solo = new QToolButton();
solo->setText(tr("Solo"));
solo->setCheckable(true);
solo->setFocusPolicy(Qt::NoFocus);
tb1->addWidget(solo);
connect(solo, SIGNAL(toggled(bool)), SLOT(soloChanged(bool)));
QLabel* label = new QLabel(tr("Cursor"));
tb1->addWidget(label);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
label->setIndent(3);
pos1 = new PosLabel(0);
pos1->setFixedHeight(22);
tb1->addWidget(pos1);
pos2 = new PosLabel(0);
pos2->setFixedHeight(22);
pos2->setSmpte(true);
tb1->addWidget(pos2);
开发者ID:Windfisch,项目名称:muse-tmp,代码行数:66,代码来源:waveedit.cpp
示例13: QVBoxLayout
averageEdit->setText(QString("%1").arg(1) );
averageLayout->addWidget(averageEdit);
controlsLayout->addRow(averageLabel, averageLayout);
// display label...
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(3,3,3,3);
valueLabel = new QLabel(this);
valueLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter);
layout->addWidget(valueLabel);
// get updates..
connect(context, SIGNAL(telemetryUpdate(RealtimeData)), this, SLOT(telemetryUpdate(RealtimeData)));
connect(context, SIGNAL(configChanged()), this, SLOT(seriesChanged()));
connect(context, SIGNAL(stop()), this, SLOT(stop()));
connect(context, SIGNAL(start()), this, SLOT(start()));
connect(context, SIGNAL(newLap()), this, SLOT(onNewLap()));
connect(seriesSelector, SIGNAL(currentIndexChanged(int)), this, SLOT(seriesChanged()));
connect(averageSlider, SIGNAL(valueChanged(int)),this, SLOT(setAverageFromSlider()));
connect(averageEdit, SIGNAL(textChanged(const QString)), this, SLOT(setAverageFromText(const QString)));
// setup colors
seriesChanged();
// setup fontsize etc
resizeEvent(NULL);
// set to zero
开发者ID:Walibu,项目名称:GoldenCheetah,代码行数:31,代码来源:DialWindow.cpp
示例14: GcCrashDialog
//.........这里部分代码省略.........
if (hrzonesFile.exists()) {
if (!hrzones_->read(hrzonesFile)) {
QMessageBox::critical(context->mainWindow, tr("HR Zones File Error"),
hrzones_->errorString());
} else if (! hrzones_->warningString().isEmpty())
QMessageBox::warning(context->mainWindow, tr("Reading HR Zones File"), hrzones_->warningString());
}
// read athlete's charts.xml and translate etc
LTMSettings reader;
reader.readChartXML(context->athlete->home, context->athlete->useMetricUnits, presets);
translateDefaultCharts(presets);
// Metadata
rideMetadata_ = new RideMetadata(context,true);
rideMetadata_->hide();
// Date Ranges
seasons = new Seasons(home);
// Search / filter
#ifdef GC_HAVE_LUCENE
namedSearches = new NamedSearches(this); // must be before navigator
lucene = new Lucene(context, context); // before metricDB attempts to refresh
#endif
// metrics DB
metricDB = new MetricAggregator(context); // just to catch config updates!
metricDB->refreshMetrics();
// the model atop the metric DB
sqlModel = new QSqlTableModel(this, metricDB->db()->connection());
sqlModel->setTable("metrics");
sqlModel->setEditStrategy(QSqlTableModel::OnManualSubmit);
// Downloaders
withingsDownload = new WithingsDownload(context);
zeoDownload = new ZeoDownload(context);
calendarDownload = new CalendarDownload(context);
// Calendar
#ifdef GC_HAVE_ICAL
rideCalendar = new ICalendar(context); // my local/remote calendar entries
davCalendar = new CalDAV(context); // remote caldav
davCalendar->download(); // refresh the diary window
#endif
// RIDE TREE -- transitionary
treeWidget = new QTreeWidget;
treeWidget->setColumnCount(3);
treeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
treeWidget->header()->resizeSection(0,60);
treeWidget->header()->resizeSection(1,100);
treeWidget->header()->resizeSection(2,70);
treeWidget->header()->hide();
treeWidget->setAlternatingRowColors (false);
treeWidget->setIndentation(5);
treeWidget->hide();
allRides = new QTreeWidgetItem(context->athlete->treeWidget, FOLDER_TYPE);
allRides->setText(0, tr("All Activities"));
treeWidget->expandItem(context->athlete->allRides);
treeWidget->setFirstItemColumnSpanned (context->athlete->allRides, true);
//.INTERVALS TREE -- transitionary
intervalWidget = new IntervalTreeView(context);
intervalWidget->setColumnCount(1);
intervalWidget->setIndentation(5);
intervalWidget->setSortingEnabled(false);
intervalWidget->header()->hide();
intervalWidget->setAlternatingRowColors (false);
intervalWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
intervalWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
intervalWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
intervalWidget->setContextMenuPolicy(Qt::CustomContextMenu);
intervalWidget->setFrameStyle(QFrame::NoFrame);
allIntervals = context->athlete->intervalWidget->invisibleRootItem();
allIntervals->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDropEnabled);
allIntervals->setText(0, tr("Intervals"));
// populate ride list
QTreeWidgetItem *last = NULL;
QStringListIterator i(RideFileFactory::instance().listRideFiles(home));
while (i.hasNext()) {
QString name = i.next();
QDateTime dt;
if (RideFile::parseRideFileName(name, &dt)) {
last = new RideItem(RIDE_TYPE, home.path(), name, dt, zones(), hrZones(), context);
allRides->addChild(last);
}
}
// trap signals
connect(context, SIGNAL(configChanged()), this, SLOT(configChanged()));
connect(treeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(rideTreeWidgetSelectionChanged()));
connect(context,SIGNAL(rideAdded(RideItem*)),this,SLOT(checkCPX(RideItem*)));
connect(context,SIGNAL(rideDeleted(RideItem*)),this,SLOT(checkCPX(RideItem*)));
connect(intervalWidget,SIGNAL(itemSelectionChanged()), this, SLOT(intervalTreeWidgetSelectionChanged()));
connect(intervalWidget,SIGNAL(itemChanged(QTreeWidgetItem *,int)), this, SLOT(updateRideFileIntervals()));
}
开发者ID:ejchet,项目名称:GoldenCheetah,代码行数:101,代码来源:Athlete.cpp
示例15: QWidget
IntervalSidebar::IntervalSidebar(Context *context) : QWidget(context->mainWindow), context(context)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0,0,0,0);
mainLayout->setSpacing(0);
setContentsMargins(0,0,0,0);
splitter = new GcSplitter(Qt::Vertical);
mainLayout->addWidget(splitter);
// Route
routeNavigator = new IntervalNavigator(context, "Route", true);
routeNavigator->setProperty("nomenu", true);
groupByMapper = NULL;
// Bests
bestNavigator = new IntervalNavigator(context, "Best", true);
bestNavigator->setProperty("nomenu", true);
// retrieve settings (properties are saved when we close the window)
if (appsettings->cvalue(context->athlete->cyclist, GC_ROUTEHEADINGS, "").toString() != "") {
routeNavigator->setSortByIndex(appsettings->cvalue(context->athlete->cyclist, GC_ROUTESORTBY).toInt());
routeNavigator->setSortByOrder(appsettings->cvalue(context->athlete->cyclist, GC_ROUTESORTBYORDER).toInt());
//routeNavigator->setGroupBy(appsettings->cvalue(context->athlete->cyclist, GC_ROUTEGROUPBY).toInt());
routeNavigator->setColumns(appsettings->cvalue(context->athlete->cyclist, GC_ROUTEHEADINGS).toString());
routeNavigator->setWidths(appsettings->cvalue(context->athlete->cyclist, GC_ROUTEHEADINGWIDTHS).toString());
}
if (appsettings->cvalue(context->athlete->cyclist, GC_BESTHEADINGS, "").toString() != "") {
bestNavigator->setSortByIndex(appsettings->cvalue(context->athlete->cyclist, GC_BESTSORTBY).toInt());
bestNavigator->setSortByOrder(appsettings->cvalue(context->athlete->cyclist, GC_BESTSORTBYORDER).toInt());
bestNavigator->setColumns(appsettings->cvalue(context->athlete->cyclist, GC_BESTHEADINGS).toString());
bestNavigator->setWidths(appsettings->cvalue(context->athlete->cyclist, GC_BESTHEADINGWIDTHS).toString());
}
QWidget *routeWidget = new QWidget(this);
routeWidget->setContentsMargins(0,0,0,0);
#ifndef Q_OS_MAC // not on mac thanks
routeWidget->setStyleSheet("padding: 0px; border: 0px; margin: 0px;");
#endif
QVBoxLayout *routeLayout = new QVBoxLayout(routeWidget);
routeLayout->setSpacing(0);
routeLayout->setContentsMargins(0,0,0,0);
routeLayout->addWidget(routeNavigator);
routeItem = new GcSplitterItem(tr("Routes"), iconFromPNG(":images/sidebar/folder.png"), this);
QAction *routeAction = new QAction(iconFromPNG(":images/sidebar/extra.png"), tr("Menu"), this);
routeItem->addAction(routeAction);
connect(routeAction, SIGNAL(triggered(void)), this, SLOT(routePopup()));
routeItem->addWidget(routeWidget);
QWidget *bestWidget = new QWidget(this);
bestWidget->setContentsMargins(0,0,0,0);
#ifndef Q_OS_MAC // not on mac thanks
bestWidget->setStyleSheet("padding: 0px; border: 0px; margin: 0px;");
#endif
QVBoxLayout *bestLayout = new QVBoxLayout(bestWidget);
bestLayout->setSpacing(0);
bestLayout->setContentsMargins(0,0,0,0);
bestLayout->addWidget(bestNavigator);
bestItem = new GcSplitterItem(tr("Bests"), iconFromPNG(":images/sidebar/folder.png"), this);
QAction *bestAction = new QAction(iconFromPNG(":images/sidebar/extra.png"), tr("Menu"), this);
bestItem->addAction(bestAction);
connect(bestAction, SIGNAL(triggered(void)), this, SLOT(bestPopup()));
bestItem->addWidget(bestWidget);
splitter->addWidget(routeItem);
splitter->addWidget(bestItem);
splitter->prepare(context->athlete->cyclist, "interval");
// GC signal
connect(context, SIGNAL(configChanged()), this, SLOT(configChanged()));
// right click menus...
connect(routeNavigator,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showRouteMenu(const QPoint &)));
//connect(context->athlete->intervalWidget,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showIntervalMenu(const QPoint &)));
connect(bestNavigator,SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(showBestMenu(const QPoint &)));
connect (context, SIGNAL(filterChanged()), this, SLOT(filterChanged()));
configChanged();
}
开发者ID:cernst72,项目名称:GoldenCheetah,代码行数:87,代码来源:IntervalSidebar.cpp
|
请发表评论