").arg(name());
- str += tr("This plugin provides DMX loopback. Data written to each output is forwarded to the respective input." );
+ str += tr("This plugin provides DMX loopback. Data written to each output is forwarded to the respective input.");
str += QString("
");
return str;
diff --git a/plugins/midi/src/alsa/alsamidiinputthread.cpp b/plugins/midi/src/alsa/alsamidiinputthread.cpp
index 4ecbe7b82c..c3ed98a1f9 100644
--- a/plugins/midi/src/alsa/alsamidiinputthread.cpp
+++ b/plugins/midi/src/alsa/alsamidiinputthread.cpp
@@ -273,11 +273,11 @@ void AlsaMidiInputThread::readEvent()
continue;
if (ev->type == SND_SEQ_EVENT_START)
cmd = MIDI_BEAT_START;
- else if(ev->type == SND_SEQ_EVENT_STOP)
+ else if (ev->type == SND_SEQ_EVENT_STOP)
cmd = MIDI_BEAT_STOP;
- else if(ev->type == SND_SEQ_EVENT_CONTINUE)
+ else if (ev->type == SND_SEQ_EVENT_CONTINUE)
cmd = MIDI_BEAT_CONTINUE;
- else if(ev->type == SND_SEQ_EVENT_CLOCK)
+ else if (ev->type == SND_SEQ_EVENT_CLOCK)
cmd = MIDI_BEAT_CLOCK;
qDebug() << "MIDI clock: " << cmd;
diff --git a/plugins/midi/src/alsa/alsamidioutputdevice.cpp b/plugins/midi/src/alsa/alsamidioutputdevice.cpp
index a23d19d334..9f5f368a28 100644
--- a/plugins/midi/src/alsa/alsamidioutputdevice.cpp
+++ b/plugins/midi/src/alsa/alsamidioutputdevice.cpp
@@ -244,7 +244,7 @@ void AlsaMidiOutputDevice::writeFeedback(uchar cmd, uchar data1, uchar data2)
void AlsaMidiOutputDevice::writeSysEx(QByteArray message)
{
- if(message.isEmpty())
+ if (message.isEmpty())
return;
if (isOpen() == false)
diff --git a/plugins/midi/src/common/midiplugin.cpp b/plugins/midi/src/common/midiplugin.cpp
index 31d56b7c49..452a690b7d 100644
--- a/plugins/midi/src/common/midiplugin.cpp
+++ b/plugins/midi/src/common/midiplugin.cpp
@@ -348,7 +348,7 @@ void MidiPlugin::configure()
// walk the universe map to update/add the
// plugin custom parameters
- foreach(quint32 universe, m_universesMap.keys())
+ foreach (quint32 universe, m_universesMap.keys())
{
m_universesMap[universe].inputParameters.clear();
diff --git a/plugins/midi/src/macx/coremidioutputdevice.cpp b/plugins/midi/src/macx/coremidioutputdevice.cpp
index c1743855e4..bd468e66be 100644
--- a/plugins/midi/src/macx/coremidioutputdevice.cpp
+++ b/plugins/midi/src/macx/coremidioutputdevice.cpp
@@ -201,7 +201,7 @@ void CoreMidiOutputDevice::writeFeedback(uchar cmd, uchar data1, uchar data2)
void CoreMidiOutputDevice::writeSysEx(QByteArray message)
{
- if(message.isEmpty())
+ if (message.isEmpty())
return;
if (isOpen() == false)
diff --git a/plugins/midi/src/win32/win32midioutputdevice.cpp b/plugins/midi/src/win32/win32midioutputdevice.cpp
index 0faf7ba67d..167216bee1 100644
--- a/plugins/midi/src/win32/win32midioutputdevice.cpp
+++ b/plugins/midi/src/win32/win32midioutputdevice.cpp
@@ -170,7 +170,7 @@ void Win32MidiOutputDevice::sendData(BYTE command, BYTE channel, BYTE value)
void Win32MidiOutputDevice::writeSysEx(QByteArray message)
{
- if(message.isEmpty())
+ if (message.isEmpty())
return;
if (isOpen() == false)
diff --git a/plugins/osc/configureosc.cpp b/plugins/osc/configureosc.cpp
index 97c2b9c33d..aa31245221 100644
--- a/plugins/osc/configureosc.cpp
+++ b/plugins/osc/configureosc.cpp
@@ -72,7 +72,7 @@ void ConfigureOSC::fillMappingTree()
QTreeWidgetItem* outputItem = NULL;
QList IOmap = m_plugin->getIOMapping();
- foreach(OSCIO io, IOmap)
+ foreach (OSCIO io, IOmap)
{
if (io.controller == NULL)
continue;
@@ -94,7 +94,7 @@ void ConfigureOSC::fillMappingTree()
outputItem->setText(KMapColumnInterface, tr("Outputs"));
outputItem->setExpanded(true);
}
- foreach(quint32 universe, controller->universesList())
+ foreach (quint32 universe, controller->universesList())
{
UniverseInfo *info = controller->getUniverseInfo(universe);
QString networkIP = controller->getNetworkIP().toString();
@@ -182,10 +182,10 @@ void ConfigureOSC::showIPAlert(QString ip)
void ConfigureOSC::accept()
{
- for(int i = 0; i < m_uniMapTree->topLevelItemCount(); i++)
+ for (int i = 0; i < m_uniMapTree->topLevelItemCount(); i++)
{
QTreeWidgetItem *topItem = m_uniMapTree->topLevelItem(i);
- for(int c = 0; c < topItem->childCount(); c++)
+ for (int c = 0; c < topItem->childCount(); c++)
{
QTreeWidgetItem *item = topItem->child(c);
if (item->data(KMapColumnInterface, PROP_UNIVERSE).isValid() == false)
diff --git a/plugins/osc/osccontroller.cpp b/plugins/osc/osccontroller.cpp
index d89484a2d9..b79146295e 100644
--- a/plugins/osc/osccontroller.cpp
+++ b/plugins/osc/osccontroller.cpp
@@ -120,7 +120,7 @@ bool OSCController::setInputPort(quint32 universe, quint16 port)
QSharedPointer OSCController::getInputSocket(quint16 port)
{
- foreach(UniverseInfo const& info, m_universeMap)
+ foreach (UniverseInfo const& info, m_universeMap)
{
if (info.inputSocket && info.inputPort == port)
return info.inputSocket;
@@ -199,7 +199,7 @@ UniverseInfo* OSCController::getUniverseInfo(quint32 universe)
OSCController::Type OSCController::type() const
{
int type = Unknown;
- foreach(UniverseInfo info, m_universeMap.values())
+ foreach (UniverseInfo info, m_universeMap.values())
{
type |= info.type;
}
@@ -371,7 +371,7 @@ void OSCController::handlePacket(QUdpSocket* socket, QByteArray const& datagram,
if (values.length() > 1)
{
info.multipartCache[path] = values;
- for(int i = 0; i < values.length(); i++)
+ for (int i = 0; i < values.length(); i++)
{
QString modPath = QString("%1_%2").arg(path).arg(i);
emit valueChanged(universe, m_line, getHash(modPath), (uchar)values.at(i), modPath);
diff --git a/plugins/osc/oscplugin.cpp b/plugins/osc/oscplugin.cpp
index 9dd01d5051..e807898b80 100644
--- a/plugins/osc/oscplugin.cpp
+++ b/plugins/osc/oscplugin.cpp
@@ -41,7 +41,7 @@ void OSCPlugin::init()
else
m_ifaceWaitTime = 0;
- foreach(QNetworkInterface iface, QNetworkInterface::allInterfaces())
+ foreach (QNetworkInterface iface, QNetworkInterface::allInterfaces())
{
foreach (QNetworkAddressEntry entry, iface.addressEntries())
{
@@ -53,7 +53,7 @@ void OSCPlugin::init()
tmpIO.controller = NULL;
bool alreadyInList = false;
- for(int j = 0; j < m_IOmapping.count(); j++)
+ for (int j = 0; j < m_IOmapping.count(); j++)
{
if (m_IOmapping.at(j).IPAddress == tmpIO.IPAddress)
{
diff --git a/plugins/peperoni/unix/peperoni.cpp b/plugins/peperoni/unix/peperoni.cpp
index c3c01a7927..582e5d5119 100644
--- a/plugins/peperoni/unix/peperoni.cpp
+++ b/plugins/peperoni/unix/peperoni.cpp
@@ -81,7 +81,7 @@ QStringList Peperoni::outputs()
int i = 0;
QList devList = m_devices.values();
- foreach(PeperoniDevice* dev, devList)
+ foreach (PeperoniDevice* dev, devList)
list << dev->name(i++);
return list;
@@ -175,7 +175,7 @@ QStringList Peperoni::inputs()
int i = 0;
QList devList = m_devices.values();
- foreach(PeperoniDevice* dev, devList)
+ foreach (PeperoniDevice* dev, devList)
list << dev->name(i++);
return list;
@@ -273,7 +273,7 @@ void Peperoni::rescanDevices()
//qDebug() << "[Peperoni] Need to destroy" << destroyList.count() << "devices";
QHashIterator it(destroyList);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
PeperoniDevice *dev = m_devices.take(it.key());
diff --git a/plugins/peperoni/unix/peperonidevice.cpp b/plugins/peperoni/unix/peperonidevice.cpp
index 5f463bf350..874589c348 100644
--- a/plugins/peperoni/unix/peperonidevice.cpp
+++ b/plugins/peperoni/unix/peperonidevice.cpp
@@ -364,7 +364,7 @@ void PeperoniDevice::run()
qDebug() << "[Peperoni] input thread started correctly";
- while(m_running == true)
+ while (m_running == true)
{
QByteArray tmpBuffer(512, 0);
diff --git a/plugins/spi/spioutthread.cpp b/plugins/spi/spioutthread.cpp
index e857ba98af..079224cb06 100644
--- a/plugins/spi/spioutthread.cpp
+++ b/plugins/spi/spioutthread.cpp
@@ -48,15 +48,15 @@ void SPIOutThread::runThread(int fd, int speed)
int status = -1;
status = ioctl (m_spifd, SPI_IOC_WR_MODE, &mode);
- if(status < 0)
+ if (status < 0)
qWarning() << "Could not set SPIMode (WR)...ioctl fail";
status = ioctl (m_spifd, SPI_IOC_WR_BITS_PER_WORD, &m_bitsPerWord);
- if(status < 0)
+ if (status < 0)
qWarning() << "Could not set SPI bitsPerWord (WR)...ioctl fail";
status = ioctl (m_spifd, SPI_IOC_WR_MAX_SPEED_HZ, &m_speed);
- if(status < 0)
+ if (status < 0)
qWarning() << "Could not set SPI speed (WR)...ioctl fail";
m_isRunning = true;
diff --git a/plugins/spi/spiplugin.cpp b/plugins/spi/spiplugin.cpp
index 75b4aced2e..7809483534 100644
--- a/plugins/spi/spiplugin.cpp
+++ b/plugins/spi/spiplugin.cpp
@@ -79,7 +79,7 @@ bool SPIPlugin::openOutput(quint32 output, quint32 universe)
return true;
m_spifd = open(SPI_DEFAULT_DEVICE, O_RDWR);
- if(m_spifd < 0)
+ if (m_spifd < 0)
{
qWarning() << "Cannot open SPI device!";
return false;
diff --git a/plugins/uart/uartwidget.cpp b/plugins/uart/uartwidget.cpp
index f187d85d3e..d2e5ee34fd 100644
--- a/plugins/uart/uartwidget.cpp
+++ b/plugins/uart/uartwidget.cpp
@@ -70,7 +70,7 @@ bool UARTWidget::close(UARTWidget::WidgetMode mode)
void UARTWidget::updateMode()
{
- if(m_mode != Closed && m_running == false)
+ if (m_mode != Closed && m_running == false)
start();
else if (m_mode == Closed && m_running == true)
stop();
@@ -155,10 +155,10 @@ void UARTWidget::run()
if (m_mode & Output)
{
m_serialPort->setBreakEnabled(true);
- if(m_granularity == Good)
+ if (m_granularity == Good)
usleep(DMX_BREAK);
m_serialPort->setBreakEnabled(false);
- if(m_granularity == Good)
+ if (m_granularity == Good)
usleep(DMX_MAB);
if (m_serialPort->write(m_outputBuffer) == 0)
diff --git a/qmlui/app.cpp b/qmlui/app.cpp
index 663c50993d..daf8b5240c 100644
--- a/qmlui/app.cpp
+++ b/qmlui/app.cpp
@@ -488,7 +488,7 @@ void App::slotItemReadyForPrinting()
{
QPrinter printer;
QPrintDialog *dlg = new QPrintDialog(&printer);
- if(dlg->exec() == QDialog::Accepted)
+ if (dlg->exec() == QDialog::Accepted)
{
QRectF pageRect = printer.pageLayout().paintRect();
QSize imgSize = m_printerImage->image().size();
@@ -511,7 +511,7 @@ void App::slotItemReadyForPrinting()
}
// handle multi-page printing
- while(totalHeight > 0)
+ while (totalHeight > 0)
{
painter.drawImage(QPoint(0, 0), img, QRectF(0, yOffset, actualWidth, pageRect.height()));
yOffset += pageRect.height();
diff --git a/qmlui/audioeditor.cpp b/qmlui/audioeditor.cpp
index 7a27ce7e7a..d5e1e9ef2d 100644
--- a/qmlui/audioeditor.cpp
+++ b/qmlui/audioeditor.cpp
@@ -144,7 +144,7 @@ int AudioEditor::cardLineIndex() const
int i = 1;
QString device = m_audio->audioDevice();
- foreach(AudioDeviceInfo info, devList)
+ foreach (AudioDeviceInfo info, devList)
{
if (info.capabilities & AUDIO_CAP_OUTPUT)
{
@@ -174,7 +174,7 @@ void AudioEditor::setCardLineIndex(int cardLineIndex)
QList devList = m_doc->audioPluginCache()->audioDevicesList();
int i = 1;
- foreach(AudioDeviceInfo info, devList)
+ foreach (AudioDeviceInfo info, devList)
{
if (info.capabilities & AUDIO_CAP_OUTPUT)
{
diff --git a/qmlui/collectioneditor.cpp b/qmlui/collectioneditor.cpp
index 0588f8ea57..c4ac0c0f1e 100644
--- a/qmlui/collectioneditor.cpp
+++ b/qmlui/collectioneditor.cpp
@@ -51,7 +51,7 @@ bool CollectionEditor::addFunction(quint32 fid, int insertIndex)
{
if (m_collection != nullptr)
{
- if(m_collection->addFunction(fid, insertIndex) == true)
+ if (m_collection->addFunction(fid, insertIndex) == true)
{
Tardis::instance()->enqueueAction(Tardis::CollectionAddFunction, m_collection->id(), QVariant(),
QVariant::fromValue(UIntPair(fid, insertIndex)));
diff --git a/qmlui/contextmanager.cpp b/qmlui/contextmanager.cpp
index f2d1b49f3b..17f5e15e3b 100644
--- a/qmlui/contextmanager.cpp
+++ b/qmlui/contextmanager.cpp
@@ -354,7 +354,7 @@ void ContextManager::setPositionPickPoint(QVector3D point)
panDeg = 90.0 + (90.0 - panDeg);
else if (!xLeft && !zBack)
panDeg = 180.0 + panDeg;
- else if(!xLeft && zBack)
+ else if (!xLeft && zBack)
panDeg = 270.0 + (90.0 - panDeg);
if (itemFlags & MonitorProperties::InvertedPanFlag)
diff --git a/qmlui/fixturebrowser.cpp b/qmlui/fixturebrowser.cpp
index 2e94b12b25..519af76408 100644
--- a/qmlui/fixturebrowser.cpp
+++ b/qmlui/fixturebrowser.cpp
@@ -154,7 +154,7 @@ QStringList FixtureBrowser::modesList()
if (definition != nullptr)
{
QList fxModesList = definition->modes();
- foreach(QLCFixtureMode *mode, fxModesList)
+ foreach (QLCFixtureMode *mode, fxModesList)
{
modesList.append(mode->name());
if (m_selectedMode.isEmpty())
diff --git a/qmlui/fixturegroupeditor.cpp b/qmlui/fixturegroupeditor.cpp
index 316f2e13d1..c717635a78 100644
--- a/qmlui/fixturegroupeditor.cpp
+++ b/qmlui/fixturegroupeditor.cpp
@@ -52,7 +52,7 @@ QVariant FixtureGroupEditor::groupsListModel()
{
QVariantList groupsList;
- foreach(FixtureGroup *grp, m_doc->fixtureGroups())
+ foreach (FixtureGroup *grp, m_doc->fixtureGroups())
{
QVariantMap grpMap;
grpMap.insert("mIcon", "qrc:/group.svg");
diff --git a/qmlui/fixturemanager.cpp b/qmlui/fixturemanager.cpp
index 2ceff06846..95b798e3bb 100644
--- a/qmlui/fixturemanager.cpp
+++ b/qmlui/fixturemanager.cpp
@@ -1424,7 +1424,7 @@ QVariantList FixtureManager::fixturesMap()
continue;
quint32 startAddress = fx->address();
- for(quint32 cn = 0; cn < fx->channels(); cn++)
+ for (quint32 cn = 0; cn < fx->channels(); cn++)
{
m_fixturesMap.append(fx->id());
m_fixturesMap.append(startAddress + cn);
@@ -1583,7 +1583,7 @@ bool FixtureManager::loadColorFilters(const QDir &dir, bool user)
void FixtureManager::resetColorFilters()
{
- while(!m_colorFilters.isEmpty())
+ while (!m_colorFilters.isEmpty())
{
ColorFilters *cf = m_colorFilters.takeLast();
delete cf;
@@ -1752,7 +1752,7 @@ QMultiHash FixtureManager::getFixtureCapabilities(quint32 itemI
for (quint32 ch : channelIndices)
{
const QLCChannel* channel(fixture->channel(ch));
- if(channel == nullptr)
+ if (channel == nullptr)
continue;
int chType = channel->group();
diff --git a/qmlui/fixtureutils.cpp b/qmlui/fixtureutils.cpp
index b4035ea351..f22864c601 100644
--- a/qmlui/fixtureutils.cpp
+++ b/qmlui/fixtureutils.cpp
@@ -271,7 +271,7 @@ QPointF FixtureUtils::available2DPosition(Doc *doc, int pointOfView, QRectF fxRe
qreal itemHeight = fxSize.height();
// store the next Y row in case we need to lower down
- if (itemYPos + itemHeight > maxYOffset )
+ if (itemYPos + itemHeight > maxYOffset)
maxYOffset = itemYPos + itemHeight;
QRectF itemRect(itemXPos, itemYPos, itemWidth, itemHeight);
diff --git a/qmlui/functionmanager.cpp b/qmlui/functionmanager.cpp
index 69789f357b..90e887e5f5 100644
--- a/qmlui/functionmanager.cpp
+++ b/qmlui/functionmanager.cpp
@@ -1033,7 +1033,7 @@ void FunctionManager::createFolder()
if (m_emptyFolderList.contains(fName) == false)
break;
index++;
- } while(1);
+ } while (1);
// check if there is some selected folder
if (m_selectedFolderList.count())
diff --git a/qmlui/importmanager.cpp b/qmlui/importmanager.cpp
index d4518517ab..f16293f355 100644
--- a/qmlui/importmanager.cpp
+++ b/qmlui/importmanager.cpp
@@ -753,7 +753,7 @@ void ImportManager::updateFunctionsTree()
{
m_functionTree->clear();
- for(Function *func : m_importDoc->functions()) // C++11
+ for (Function *func : m_importDoc->functions()) // C++11
{
if (func == nullptr || func->isVisible() == false)
return;
diff --git a/qmlui/inputoutputmanager.cpp b/qmlui/inputoutputmanager.cpp
index 7fd94d8584..1b2e3a813a 100644
--- a/qmlui/inputoutputmanager.cpp
+++ b/qmlui/inputoutputmanager.cpp
@@ -236,7 +236,7 @@ QVariant InputOutputManager::audioInputDevice()
}
QList devList = m_doc->audioPluginCache()->audioDevicesList();
- foreach(AudioDeviceInfo info, devList)
+ foreach (AudioDeviceInfo info, devList)
{
if (info.capabilities & AUDIO_CAP_INPUT &&
info.deviceName == devName)
@@ -268,7 +268,7 @@ QVariant InputOutputManager::audioOutputDevice()
}
QList devList = m_doc->audioPluginCache()->audioDevicesList();
- foreach(AudioDeviceInfo info, devList)
+ foreach (AudioDeviceInfo info, devList)
{
if (info.capabilities & AUDIO_CAP_OUTPUT &&
info.deviceName == devName)
@@ -388,11 +388,11 @@ QVariant InputOutputManager::universeInputSources(int universe)
currLine = ip->input();
}
- foreach(QString pluginName, m_ioMap->inputPluginNames())
+ foreach (QString pluginName, m_ioMap->inputPluginNames())
{
QLCIOPlugin *plugin = m_doc->ioPluginCache()->plugin(pluginName);
int i = 0;
- foreach(QString pLine, m_ioMap->pluginInputs(pluginName))
+ foreach (QString pLine, m_ioMap->pluginInputs(pluginName))
{
if (pluginName == currPlugin && i == currLine)
{
@@ -429,11 +429,11 @@ QVariant InputOutputManager::universeOutputSources(int universe)
currLine = op->output();
}
- foreach(QString pluginName, m_ioMap->outputPluginNames())
+ foreach (QString pluginName, m_ioMap->outputPluginNames())
{
QLCIOPlugin *plugin = m_doc->ioPluginCache()->plugin(pluginName);
int i = 0;
- foreach(QString pLine, m_ioMap->pluginOutputs(pluginName))
+ foreach (QString pLine, m_ioMap->pluginOutputs(pluginName))
{
if (pluginName == currPlugin && i == currLine)
{
@@ -719,7 +719,7 @@ QVariant InputOutputManager::beatGeneratorsList()
genList.append(internalMap);
// add the currently open MIDI input devices
- foreach(Universe *uni, m_ioMap->universes())
+ foreach (Universe *uni, m_ioMap->universes())
{
InputPatch *ip = uni->inputPatch();
if (ip == nullptr || ip->pluginName() != "MIDI")
@@ -754,7 +754,7 @@ QVariant InputOutputManager::beatGeneratorsList()
else
{
QList devList = m_doc->audioPluginCache()->audioDevicesList();
- foreach(AudioDeviceInfo info, devList)
+ foreach (AudioDeviceInfo info, devList)
{
if (info.capabilities & AUDIO_CAP_INPUT &&
info.deviceName == devName)
diff --git a/qmlui/mainview2d.cpp b/qmlui/mainview2d.cpp
index fca8e34fca..68113991a3 100644
--- a/qmlui/mainview2d.cpp
+++ b/qmlui/mainview2d.cpp
@@ -68,7 +68,7 @@ void MainView2D::setUniverseFilter(quint32 universeFilter)
{
PreviewContext::setUniverseFilter(universeFilter);
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 itemID = it.key();
@@ -89,7 +89,7 @@ void MainView2D::setUniverseFilter(quint32 universeFilter)
void MainView2D::resetItems()
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
delete it.value();
@@ -570,13 +570,13 @@ void MainView2D::selectFixture(QQuickItem *fxItem, bool enable)
void MainView2D::updateFixtureSelection(QList fixtures)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 fxID = it.key();
bool enable = false;
- if(fixtures.contains(fxID))
+ if (fixtures.contains(fxID))
enable = true;
selectFixture(it.value(), enable);
diff --git a/qmlui/mainview3d.cpp b/qmlui/mainview3d.cpp
index f6ca82d637..6bcf45a857 100644
--- a/qmlui/mainview3d.cpp
+++ b/qmlui/mainview3d.cpp
@@ -160,7 +160,7 @@ void MainView3D::resetItems()
QMetaObject::invokeMethod(m_scene3D, "updateFrameGraph", Q_ARG(QVariant, false));
QMapIterator it(m_entitiesMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
SceneItem *e = it.value();
@@ -179,7 +179,7 @@ void MainView3D::resetItems()
m_entitiesMap.clear();
QMapIterator it2(m_genericMap);
- while(it2.hasNext())
+ while (it2.hasNext())
{
it2.next();
SceneItem *e = it2.value();
@@ -214,7 +214,7 @@ void MainView3D::setUniverseFilter(quint32 universeFilter)
PreviewContext::setUniverseFilter(universeFilter);
QMapIterator it(m_entitiesMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 itemID = it.key();
@@ -1303,7 +1303,7 @@ void MainView3D::updateFixtureItem(Fixture *fixture, quint16 headIndex, quint16
void MainView3D::updateFixtureSelection(QList fixtures)
{
QMapIterator it(m_entitiesMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 fxID = it.key();
diff --git a/qmlui/mainviewdmx.cpp b/qmlui/mainviewdmx.cpp
index f8dcc0c685..a1aae20cc0 100644
--- a/qmlui/mainviewdmx.cpp
+++ b/qmlui/mainviewdmx.cpp
@@ -58,7 +58,7 @@ void MainViewDMX::setUniverseFilter(quint32 universeFilter)
{
PreviewContext::setUniverseFilter(universeFilter);
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 fxID = it.key();
@@ -77,7 +77,7 @@ void MainViewDMX::setUniverseFilter(quint32 universeFilter)
void MainViewDMX::reset()
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
Fixture *fixture = m_doc->fixture(it.key());
@@ -150,7 +150,7 @@ void MainViewDMX::updateFixture(Fixture *fixture)
void MainViewDMX::updateFixtureSelection(QListfixtures)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
quint32 itemID = FixtureUtils::fixtureItemID(it.key(), 0, 0);
diff --git a/qmlui/rgbmatrixeditor.cpp b/qmlui/rgbmatrixeditor.cpp
index 6865f19678..348620b636 100644
--- a/qmlui/rgbmatrixeditor.cpp
+++ b/qmlui/rgbmatrixeditor.cpp
@@ -125,7 +125,7 @@ void RGBMatrixEditor::setAlgorithmIndex(int algoIndex)
{
qDebug() << "Set algorithm:" << algoIndex;
QStringList algoList = algorithms();
- if(algoIndex < 0 || algoIndex >= algorithms().count())
+ if (algoIndex < 0 || algoIndex >= algorithms().count())
return;
RGBAlgorithm *algo = RGBAlgorithm::algorithm(m_doc, algoList.at(algoIndex));
@@ -408,7 +408,7 @@ void RGBMatrixEditor::createScriptObjects(QQuickItem *parent)
RGBScript *script = static_cast (m_matrix->algorithm());
QList properties = script->properties();
- foreach(RGBScriptProperty prop, properties)
+ foreach (RGBScriptProperty prop, properties)
{
// always create a label first
QMetaObject::invokeMethod(parent, "addLabel",
@@ -423,7 +423,7 @@ void RGBMatrixEditor::createScriptObjects(QQuickItem *parent)
int currIdx = 0;
QString pValue = m_matrix->property(prop.m_name);
- foreach(QString val, prop.m_listValues)
+ foreach (QString val, prop.m_listValues)
{
if (val == pValue)
currIdx = idx;
@@ -598,7 +598,7 @@ void RGBMatrixEditor::slotPreviewTimeout()
return;
QMapIterator it(m_group->headsMap());
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
diff --git a/qmlui/sceneeditor.cpp b/qmlui/sceneeditor.cpp
index 6c85feffe2..1f3ca2bd50 100644
--- a/qmlui/sceneeditor.cpp
+++ b/qmlui/sceneeditor.cpp
@@ -108,7 +108,7 @@ void SceneEditor::setPreviewEnabled(bool enable)
if (enable == true)
{
- foreach(SceneValue sv, m_scene->values())
+ foreach (SceneValue sv, m_scene->values())
m_source->set(sv.fxi, sv.channel, sv.value);
}
else
diff --git a/qmlui/showmanager.cpp b/qmlui/showmanager.cpp
index 9e25eeba9a..d071085ff1 100644
--- a/qmlui/showmanager.cpp
+++ b/qmlui/showmanager.cpp
@@ -558,7 +558,7 @@ void ShowManager::resetContents()
void ShowManager::resetView()
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
delete it.value();
@@ -687,7 +687,7 @@ void ShowManager::setItemSelection(int trackIdx, ShowFunction *sf, QQuickItem *i
void ShowManager::resetItemsSelection()
{
- foreach(SelectedShowItem ssi, m_selectedItems)
+ foreach (SelectedShowItem ssi, m_selectedItems)
{
if (ssi.m_item != nullptr)
ssi.m_item->setProperty("isSelected", false);
@@ -751,7 +751,7 @@ bool ShowManager::checkOverlapping(Track *track, ShowFunction *sourceFunc,
if (track == nullptr)
return false;
- foreach(ShowFunction *sf, track->showFunctions())
+ foreach (ShowFunction *sf, track->showFunctions())
{
if (sf == sourceFunc)
continue;
diff --git a/qmlui/tardis/networkmanager.cpp b/qmlui/tardis/networkmanager.cpp
index 6518fcbcaa..9bafa10168 100644
--- a/qmlui/tardis/networkmanager.cpp
+++ b/qmlui/tardis/networkmanager.cpp
@@ -166,7 +166,7 @@ bool NetworkManager::sendTCPPacket(QTcpSocket *socket, QByteArray &packet, bool
if (encrypt)
{
QByteArray encPacket = m_packetizer->encryptPacket(packet, m_crypt);
- while(totalBytesSent < (quint64)encPacket.length())
+ while (totalBytesSent < (quint64)encPacket.length())
{
sent = socket->write(encPacket.data() + totalBytesSent, encPacket.length() - totalBytesSent);
totalBytesSent += sent;
@@ -176,7 +176,7 @@ bool NetworkManager::sendTCPPacket(QTcpSocket *socket, QByteArray &packet, bool
}
else
{
- while(totalBytesSent < (quint64)packet.length())
+ while (totalBytesSent < (quint64)packet.length())
{
sent = socket->write(packet.data() + totalBytesSent, packet.length() - totalBytesSent);
totalBytesSent += sent;
@@ -329,7 +329,7 @@ bool NetworkManager::sendWorkspaceToClient(QString hostName, QString filename)
m_packetizer->addSection(packet, QVariant((int)workspace.size()));
}
- else if(data.length() < WORKSPACE_CHUNK_SIZE)
+ else if (data.length() < WORKSPACE_CHUNK_SIZE)
{
m_packetizer->addSection(packet, QVariant(2));
}
@@ -410,7 +410,7 @@ bool NetworkManager::initializeClient()
m_packetizer->addSection(packet, QVariant(m_hostName));
/* now send the packet on every network interface */
- foreach(QNetworkInterface iface, QNetworkInterface::allInterfaces())
+ foreach (QNetworkInterface iface, QNetworkInterface::allInterfaces())
{
foreach (QNetworkAddressEntry entry, iface.addressEntries())
{
diff --git a/qmlui/uimanager.cpp b/qmlui/uimanager.cpp
index b063b27c83..2941d3539c 100644
--- a/qmlui/uimanager.cpp
+++ b/qmlui/uimanager.cpp
@@ -164,7 +164,7 @@ bool UiManager::saveSettings()
/** Add parameters to JSON objects representing categories */
QMapIterator it(m_parameterMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
QString paramName = it.key();
@@ -179,7 +179,7 @@ bool UiManager::saveSettings()
/** Add each JSON object to the root object */
QMapIterator cIt(objMap);
- while(cIt.hasNext())
+ while (cIt.hasNext())
{
cIt.next();
objRoot[cIt.key()] = *cIt.value();
diff --git a/qmlui/virtualconsole/vcbutton.cpp b/qmlui/virtualconsole/vcbutton.cpp
index e059361ee7..84debd96e8 100644
--- a/qmlui/virtualconsole/vcbutton.cpp
+++ b/qmlui/virtualconsole/vcbutton.cpp
@@ -168,7 +168,7 @@ void VCButton::setFunctionID(quint32 fid)
if ((isEditing() && caption().isEmpty()) || caption() == defaultCaption())
setCaption(function->name());
- if(running)
+ if (running)
{
function->start(m_doc->masterTimer(), functionParent());
setState(Active);
diff --git a/qmlui/virtualconsole/vcclock.cpp b/qmlui/virtualconsole/vcclock.cpp
index bcfc7ea9c8..df7214a5e7 100644
--- a/qmlui/virtualconsole/vcclock.cpp
+++ b/qmlui/virtualconsole/vcclock.cpp
@@ -238,7 +238,7 @@ void VCClock::slotTimerTimeout()
return;
}
- for(VCClockSchedule *sch : m_scheduleList) // C++11
+ for (VCClockSchedule *sch : m_scheduleList) // C++11
{
if (sch->m_cachedDuration == -1)
{
@@ -258,7 +258,7 @@ void VCClock::slotTimerTimeout()
* Each case must be checked against days of the week
*/
- if(dayTimeSecs >= sch->startTime())
+ if (dayTimeSecs >= sch->startTime())
{
// if there's a stop time and we past it, then skip
if (sch->stopTime() > 0 && dayTimeSecs > sch->stopTime())
@@ -327,7 +327,7 @@ void VCClock::setEnableSchedule(bool enableSchedule)
/* When disabling, check for running functions and stop them */
if (enableSchedule == false)
{
- for(VCClockSchedule *sch : m_scheduleList) // C++11
+ for (VCClockSchedule *sch : m_scheduleList) // C++11
{
Function *f = m_doc->function(sch->functionID());
if (f != nullptr && f->isRunning())
@@ -343,7 +343,7 @@ void VCClock::setEnableSchedule(bool enableSchedule)
QVariantList VCClock::scheduleList()
{
QVariantList list;
- for(VCClockSchedule *sch : m_scheduleList) // C++11
+ for (VCClockSchedule *sch : m_scheduleList) // C++11
list.append(QVariant::fromValue(sch));
return list;
}
@@ -509,7 +509,7 @@ bool VCClock::saveXML(QXmlStreamWriter *doc)
/* Appearance */
saveXMLAppearance(doc);
- for(VCClockSchedule *sch : m_scheduleList) // C++11
+ for (VCClockSchedule *sch : m_scheduleList) // C++11
sch->saveXML(doc);
/* End the tag */
diff --git a/qmlui/virtualconsole/vccuelist.cpp b/qmlui/virtualconsole/vccuelist.cpp
index 577e46eb78..7a7678d399 100644
--- a/qmlui/virtualconsole/vccuelist.cpp
+++ b/qmlui/virtualconsole/vccuelist.cpp
@@ -260,7 +260,7 @@ void VCCueList::setSideFaderLevel(int level)
if (ch->stepsCount() < 256)
{
float stepSize = 255 / float(ch->stepsCount());
- if(level >= 255 - stepSize)
+ if (level >= 255 - stepSize)
newStep = ch->stepsCount() - 1;
else
newStep = qFloor(qreal(level) / qreal(stepSize));
diff --git a/qmlui/virtualconsole/vcframe.cpp b/qmlui/virtualconsole/vcframe.cpp
index 130e08c279..b3b103a259 100644
--- a/qmlui/virtualconsole/vcframe.cpp
+++ b/qmlui/virtualconsole/vcframe.cpp
@@ -104,7 +104,7 @@ void VCFrame::render(QQuickView *view, QQuickItem *parent)
QString chName = QString("frameDropArea%1").arg(id());
QQuickItem *childrenArea = qobject_cast(m_item->findChild(chName));
- foreach(VCWidget *child, m_pagesMap.keys())
+ foreach (VCWidget *child, m_pagesMap.keys())
child->render(view, childrenArea);
}
}
@@ -194,7 +194,7 @@ QList VCFrame::children(bool recursive)
return m_pagesMap.keys();
else
{
- foreach(VCWidget *widget, m_pagesMap.keys())
+ foreach (VCWidget *widget, m_pagesMap.keys())
{
widgetsList.append(widget);
if (widget->type() == FrameWidget || widget->type() == SoloFrameWidget)
@@ -508,7 +508,7 @@ void VCFrame::deleteChildren()
{
it.next();
VCWidget *widget = it.key();
- if(widget->type() == FrameWidget || widget->type() == SoloFrameWidget)
+ if (widget->type() == FrameWidget || widget->type() == SoloFrameWidget)
{
VCFrame *frame = qobject_cast(widget);
frame->deleteChildren();
@@ -1137,7 +1137,7 @@ bool VCFrame::loadXML(QXmlStreamReader &root)
if (attrs.hasAttribute(KXMLQLCVCFrameCurrentPage))
currentPage = attrs.value(KXMLQLCVCFrameCurrentPage).toInt();
- if(attrs.hasAttribute(KXMLQLCVCFramePagesLoop))
+ if (attrs.hasAttribute(KXMLQLCVCFramePagesLoop))
setPagesLoop(true);
root.skipCurrentElement();
@@ -1285,7 +1285,7 @@ bool VCFrame::saveXML(QXmlStreamWriter *doc)
}
/* Save children */
- foreach(VCWidget *child, children(false))
+ foreach (VCWidget *child, children(false))
child->saveXML(doc);
/* End the tag */
diff --git a/qmlui/virtualconsole/vcpage.cpp b/qmlui/virtualconsole/vcpage.cpp
index 6bea623754..ec50cd8c2a 100644
--- a/qmlui/virtualconsole/vcpage.cpp
+++ b/qmlui/virtualconsole/vcpage.cpp
@@ -100,7 +100,7 @@ void VCPage::unMapInputSource(quint32 id, quint32 universe, quint32 channel,
//qDebug() << "Multihash keys before deletion:" << m_inputSourcesMap.count(key);
- for(QPair, VCWidget *> match : m_inputSourcesMap.values(key)) // C++11
+ for (QPair, VCWidget *> match : m_inputSourcesMap.values(key)) // C++11
{
if (match.first->id() == id && match.first->page() == page)
{
@@ -137,7 +137,7 @@ void VCPage::inputValueChanged(quint32 universe, quint32 channel, uchar value)
* check also if the page matches and finally inform the VC widget
* about the event, including the source ID
*/
- for(QPair, VCWidget *> match : m_inputSourcesMap.values(key)) // C++11
+ for (QPair, VCWidget *> match : m_inputSourcesMap.values(key)) // C++11
{
// make sure input signals always pass to frame widgets
bool passDisable = (match.second->type() == VCWidget::FrameWidget) ||
@@ -184,7 +184,7 @@ void VCPage::unMapKeySequence(QKeySequence sequence, quint32 id, VCWidget *widge
if (checkChildren && children(true).contains(widget) == false)
return;
- for(QPair match : m_keySequencesMap.values(sequence)) // C++11
+ for (QPair match : m_keySequencesMap.values(sequence)) // C++11
{
if (match.first == id && match.second == widget)
{
@@ -208,7 +208,7 @@ void VCPage::updateKeySequenceIDInMap(QKeySequence sequence, quint32 id, VCWidge
quint32 oldId = UINT_MAX;
/** Perform a lookup of the existing map to find the old control ID */
- for(QPair match : m_keySequencesMap.values(sequence)) // C++11
+ for (QPair match : m_keySequencesMap.values(sequence)) // C++11
{
if (match.second == widget)
{
@@ -248,7 +248,7 @@ void VCPage::handleKeyEvent(QKeyEvent *e, bool pressed)
{
QKeySequence seq(e->key() | e->modifiers());
- for(QPair match : m_keySequencesMap.values(seq)) // C++11
+ for (QPair match : m_keySequencesMap.values(seq)) // C++11
{
// make sure input signals always pass to frame widgets
bool passDisable = (match.second->type() == VCWidget::FrameWidget) ||
diff --git a/qmlui/virtualconsole/vcslider.cpp b/qmlui/virtualconsole/vcslider.cpp
index c67a4eee43..8d22e3902e 100644
--- a/qmlui/virtualconsole/vcslider.cpp
+++ b/qmlui/virtualconsole/vcslider.cpp
@@ -803,7 +803,7 @@ void VCSlider::setControlledFunction(quint32 fid)
disconnect(current, SIGNAL(attributeChanged(int,qreal)),
this, SLOT(slotControlledFunctionAttributeChanged(int,qreal)));
- if(current->isRunning())
+ if (current->isRunning())
{
running = true;
current->stop(functionParent());
diff --git a/qmlui/virtualconsole/vcsoloframe.cpp b/qmlui/virtualconsole/vcsoloframe.cpp
index f0ccbd567e..c4efa430a1 100644
--- a/qmlui/virtualconsole/vcsoloframe.cpp
+++ b/qmlui/virtualconsole/vcsoloframe.cpp
@@ -58,7 +58,7 @@ void VCSoloFrame::render(QQuickView *view, QQuickItem *parent)
QString chName = QString("frameDropArea%1").arg(id());
QQuickItem *childrenArea = qobject_cast(item->findChild(chName));
- foreach(VCWidget *child, m_pagesMap.keys())
+ foreach (VCWidget *child, m_pagesMap.keys())
child->render(view, childrenArea);
}
}
@@ -95,7 +95,7 @@ bool VCSoloFrame::copyFrom(const VCWidget *widget)
void VCSoloFrame::slotFunctionStarting(VCWidget *widget, quint32 fid, qreal intensity)
{
qDebug() << "[VCSoloFrame] requested to start a Function with ID:" << fid << intensity << widget->caption();
- foreach(VCWidget *child, children(true))
+ foreach (VCWidget *child, children(true))
{
if (child != widget)
child->notifyFunctionStarting(widget, fid, intensity);
diff --git a/qmlui/virtualconsole/vcwidget.cpp b/qmlui/virtualconsole/vcwidget.cpp
index a8cb47b648..65fa66700f 100644
--- a/qmlui/virtualconsole/vcwidget.cpp
+++ b/qmlui/virtualconsole/vcwidget.cpp
@@ -125,7 +125,7 @@ bool VCWidget::copyFrom(const VCWidget* widget)
}
QMapIterator it(m_keySequenceMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -620,7 +620,7 @@ QVariant VCWidget::externalControlsList() const
QVariantList controlsList;
QMapIterator it(m_externalControlList);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
ExternalControlInfo info = it.value();
@@ -802,7 +802,7 @@ QVariantList VCWidget::inputSourcesList()
}
QMapIterator it(m_keySequenceMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
diff --git a/qmlui/virtualconsole/virtualconsole.cpp b/qmlui/virtualconsole/virtualconsole.cpp
index be171774ea..bc17556a08 100644
--- a/qmlui/virtualconsole/virtualconsole.cpp
+++ b/qmlui/virtualconsole/virtualconsole.cpp
@@ -495,7 +495,7 @@ void VirtualConsole::setWidgetSelection(quint32 wID, QQuickItem *item, bool enab
{
// disable any previously selected widget
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
QQuickItem *uiWidget = it.value();
@@ -534,7 +534,7 @@ void VirtualConsole::setWidgetSelection(quint32 wID, QQuickItem *item, bool enab
void VirtualConsole::resetWidgetSelection()
{
- foreach(QQuickItem *widget, m_itemsMap.values())
+ foreach (QQuickItem *widget, m_itemsMap.values())
widget->setProperty("isSelected", false);
m_itemsMap.clear();
@@ -547,7 +547,7 @@ QStringList VirtualConsole::selectedWidgetNames()
QStringList names;
if (m_itemsMap.isEmpty() == false)
{
- foreach(quint32 wID, m_itemsMap.keys())
+ foreach (quint32 wID, m_itemsMap.keys())
{
VCWidget *vcWidget = m_widgetsMap[wID];
if (vcWidget != nullptr)
@@ -573,7 +573,7 @@ QVariantList VirtualConsole::selectedWidgetIDs()
QVariantList ids;
if (m_itemsMap.isEmpty() == false)
{
- foreach(quint32 wID, m_itemsMap.keys())
+ foreach (quint32 wID, m_itemsMap.keys())
ids << wID;
}
@@ -614,7 +614,7 @@ void VirtualConsole::setWidgetsAlignment(VCWidget *refWidget, int alignment)
QRectF refGeom = refWidget->geometry();
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -652,7 +652,7 @@ void VirtualConsole::setWidgetsAlignment(VCWidget *refWidget, int alignment)
void VirtualConsole::setWidgetsCaption(QString caption)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -664,7 +664,7 @@ void VirtualConsole::setWidgetsCaption(QString caption)
void VirtualConsole::setWidgetsForegroundColor(QColor color)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -676,7 +676,7 @@ void VirtualConsole::setWidgetsForegroundColor(QColor color)
void VirtualConsole::setWidgetsBackgroundColor(QColor color)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -688,7 +688,7 @@ void VirtualConsole::setWidgetsBackgroundColor(QColor color)
void VirtualConsole::setWidgetsBackgroundImage(QString path)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -700,7 +700,7 @@ void VirtualConsole::setWidgetsBackgroundImage(QString path)
void VirtualConsole::setWidgetsFont(QFont font)
{
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -711,7 +711,7 @@ void VirtualConsole::setWidgetsFont(QFont font)
void VirtualConsole::deleteVCWidgets(QVariantList IDList)
{
- foreach(QVariant id, IDList)
+ foreach (QVariant id, IDList)
{
quint32 wID = id.toUInt();
VCWidget *w = widget(wID);
@@ -814,7 +814,7 @@ void VirtualConsole::pasteFromClipboard()
QPoint currPos(0, 0);
QMapIterator it(m_itemsMap);
- while(it.hasNext())
+ while (it.hasNext())
{
it.next();
@@ -970,7 +970,7 @@ void VirtualConsole::updateKeySequenceControlID(VCWidget *widget, quint32 id, QS
widget->updateKeySequenceControlID(seq, id);
/** Update also the key sequence maps in VC pages */
- for(VCPage *page : m_pages) // C++11
+ for (VCPage *page : m_pages) // C++11
page->updateKeySequenceIDInMap(seq, id, widget, true);
}
@@ -991,7 +991,7 @@ void VirtualConsole::deleteInputSource(VCWidget *widget, quint32 id, quint32 uni
/** In case an autodetection process is running, stop it */
disableAutoDetection();
- for(VCPage *page : m_pages) // C++11
+ for (VCPage *page : m_pages) // C++11
page->unMapInputSource(id, universe, channel, widget, true);
widget->deleteInputSurce(id, universe, channel);
@@ -1007,7 +1007,7 @@ void VirtualConsole::deleteKeySequence(VCWidget *widget, quint32 id, QString key
QKeySequence seq(keyText);
- for(VCPage *page : m_pages) // C++11
+ for (VCPage *page : m_pages) // C++11
page->unMapKeySequence(seq, id, widget, true);
widget->deleteKeySequence(seq);
@@ -1043,7 +1043,7 @@ void VirtualConsole::handleKeyEvent(QKeyEvent *e, bool pressed)
qDebug() << "Got key sequence:" << seq.toString(QKeySequence::NativeText);
m_autoDetectionWidget->updateKeySequence(m_autoDetectionKey, seq, m_autoDetectionKeyId);
- for(VCPage *page : m_pages) // C++11
+ for (VCPage *page : m_pages) // C++11
page->mapKeySequence(seq, m_autoDetectionKeyId, m_autoDetectionWidget, true);
/** At last, disable the autodetection process */
diff --git a/ui/src/addfixture.cpp b/ui/src/addfixture.cpp
index bd821e2186..948e64f675 100644
--- a/ui/src/addfixture.cpp
+++ b/ui/src/addfixture.cpp
@@ -277,7 +277,7 @@ void AddFixture::fillTree(const QString& selectManufacturer,
parent->setExpanded(true);
m_tree->setCurrentItem(child);
}
- else if(expanded.indexOf(manuf) != -1)
+ else if (expanded.indexOf(manuf) != -1)
{
parent->setExpanded(true);
}
@@ -304,7 +304,7 @@ void AddFixture::fillTree(const QString& selectManufacturer,
parent->setExpanded(true);
m_tree->setCurrentItem(child);
}
- else if(expanded.indexOf(manuf) != -1)
+ else if (expanded.indexOf(manuf) != -1)
{
parent->setExpanded(true);
}
diff --git a/ui/src/addresstool.cpp b/ui/src/addresstool.cpp
index ff41c165ed..4c1c1846f6 100644
--- a/ui/src/addresstool.cpp
+++ b/ui/src/addresstool.cpp
@@ -166,7 +166,7 @@ void DIPSwitchWidget::mousePressEvent(QMouseEvent *e)
quint32 newvalue = m_value ^ (1< 512) newvalue = 512;
m_value = newvalue;
diff --git a/ui/src/app.cpp b/ui/src/app.cpp
index 1f80877e0b..03a44b6c32 100644
--- a/ui/src/app.cpp
+++ b/ui/src/app.cpp
@@ -349,7 +349,7 @@ void App::closeEvent(QCloseEvent* e)
if (m_doc->isKiosk() == false)
{
- if( saveModifiedDoc(tr("Close"), tr("Do you wish to save the current workspace " \
+ if (saveModifiedDoc(tr("Close"), tr("Do you wish to save the current workspace " \
"before closing the application?")) == true)
{
e->accept();
@@ -502,7 +502,7 @@ void App::slotDocModified(bool state)
void App::slotUniverseWritten(quint32 idx, const QByteArray &ua)
{
- foreach(Fixture *fixture, m_doc->fixtures())
+ foreach (Fixture *fixture, m_doc->fixtures())
{
if (fixture->universe() != idx)
continue;
diff --git a/ui/src/audiobar.cpp b/ui/src/audiobar.cpp
index 51e2a618b7..ec46f5fc98 100644
--- a/ui/src/audiobar.cpp
+++ b/ui/src/audiobar.cpp
@@ -112,7 +112,7 @@ void AudioBar::attachDmxChannels(Doc *doc, QList list)
m_dmxChannels.clear();
m_dmxChannels = list;
m_absDmxChannels.clear();
- foreach(SceneValue scv, m_dmxChannels)
+ foreach (SceneValue scv, m_dmxChannels)
{
Fixture *fx = doc->fixture(scv.fxi);
if (fx != NULL)
diff --git a/ui/src/channelmodifiereditor.cpp b/ui/src/channelmodifiereditor.cpp
index 347d873d93..61cc114d6a 100644
--- a/ui/src/channelmodifiereditor.cpp
+++ b/ui/src/channelmodifiereditor.cpp
@@ -96,7 +96,7 @@ void ChannelModifierEditor::updateModifiersList(QString modifier)
std::stable_sort(names.begin(), names.end(), alphabeticSort);
m_templatesTree->clear();
- foreach(QString name, names)
+ foreach (QString name, names)
{
QTreeWidgetItem *item = new QTreeWidgetItem(m_templatesTree);
item->setText(0, name);
diff --git a/ui/src/channelmodifiergraphicsview.cpp b/ui/src/channelmodifiergraphicsview.cpp
index 298385d8fb..2123263099 100644
--- a/ui/src/channelmodifiergraphicsview.cpp
+++ b/ui/src/channelmodifiergraphicsview.cpp
@@ -65,7 +65,7 @@ void ChannelModifierGraphicsView::addNewHandler()
int prevHdlrIdx = 0;
HandlerItem *nextHandler = NULL;
- for(prevHdlrIdx = 0; prevHdlrIdx < m_handlers.count(); prevHdlrIdx++)
+ for (prevHdlrIdx = 0; prevHdlrIdx < m_handlers.count(); prevHdlrIdx++)
{
HandlerItem *hdlr = m_handlers.at(prevHdlrIdx);
if (hdlr == prevHandler)
@@ -127,7 +127,7 @@ void ChannelModifierGraphicsView::setModifierMap(QList > map
QPen(Qt::NoPen), QBrush(QColor(70, 70, 70, 255), Qt::SolidPattern));
m_bgRect->setZValue(0);
- for(int i = 0; i < map.count(); i++)
+ for (int i = 0; i < map.count(); i++)
{
QPair dmxPair = map.at(i);
HandlerItem *handler = new HandlerItem;
@@ -140,7 +140,7 @@ void ChannelModifierGraphicsView::setModifierMap(QList > map
handler->m_line = m_scene->addLine(0,0,1,1,QPen(Qt::yellow));
m_handlers.append(handler);
}
- for(int i = 0; i < map.count(); i++)
+ for (int i = 0; i < map.count(); i++)
updateHandlerBoundingBox(i);
updateView();
}
@@ -148,15 +148,15 @@ void ChannelModifierGraphicsView::setModifierMap(QList > map
QList< QPair > ChannelModifierGraphicsView::modifiersMap()
{
QList< QPair > modMap;
- foreach(HandlerItem *item, m_handlers)
+ foreach (HandlerItem *item, m_handlers)
modMap.append(item->m_dmxMap);
return modMap;
}
HandlerItem *ChannelModifierGraphicsView::getSelectedHandler()
{
- foreach(HandlerItem *handler, m_handlers)
- if(handler->m_item->isSelected())
+ foreach (HandlerItem *handler, m_handlers)
+ if (handler->m_item->isSelected())
return handler;
return NULL;
}
@@ -194,7 +194,7 @@ void ChannelModifierGraphicsView::updateHandlerBoundingBox(int itemIndex)
handler->m_item->setBoundingBox(QRect(m_bgRect->x() - 1, m_bgRect->y(), 1, m_bgRect->rect().height()));
return;
}
- else if(itemIndex == m_handlers.count() - 1)
+ else if (itemIndex == m_handlers.count() - 1)
{
handler->m_item->setBoundingBox(QRect(m_bgRect->rect().right(), m_bgRect->y(), 1, m_bgRect->rect().height()));
return;
@@ -353,7 +353,7 @@ void ChannelModifierGraphicsView::slotItemMoved(HandlerGraphicsItem *item,
********************************************************************/
HandlerGraphicsItem::HandlerGraphicsItem(qreal x, qreal y, qreal w, qreal h,
- const QPen & pen, const QBrush & brush )
+ const QPen & pen, const QBrush &brush)
: QGraphicsEllipseItem(x, y, w, h)
{
setCursor(Qt::OpenHandCursor);
diff --git a/ui/src/channelmodifiergraphicsview.h b/ui/src/channelmodifiergraphicsview.h
index d40c2143e2..b77b5952e7 100644
--- a/ui/src/channelmodifiergraphicsview.h
+++ b/ui/src/channelmodifiergraphicsview.h
@@ -31,7 +31,7 @@ class HandlerGraphicsItem : public QObject, public QGraphicsEllipseItem
public:
HandlerGraphicsItem(qreal x, qreal y, qreal w, qreal h, const QPen & pen = QPen(),
- const QBrush & brush = QBrush() );
+ const QBrush & brush = QBrush());
void setBoundingBox(QRectF rect);
QRectF boundingBox();
@@ -106,7 +106,7 @@ class ChannelModifierGraphicsView : public QGraphicsView
void updateView();
/** Event caught when the GraphicsView is resized */
- void resizeEvent( QResizeEvent *event );
+ void resizeEvent(QResizeEvent *event);
void mouseReleaseEvent(QMouseEvent *e);
diff --git a/ui/src/channelsselection.cpp b/ui/src/channelsselection.cpp
index d53203829e..7b8bbb7b2c 100644
--- a/ui/src/channelsselection.cpp
+++ b/ui/src/channelsselection.cpp
@@ -100,7 +100,7 @@ void ChannelsSelection::updateFixturesTree()
m_channelsTree->setIconSize(QSize(24, 24));
m_channelsTree->setAllColumnsShowFocus(true);
- foreach(Fixture *fxi, m_doc->fixtures())
+ foreach (Fixture *fxi, m_doc->fixtures())
{
QTreeWidgetItem *topItem = NULL;
quint32 uni = fxi->universe();
@@ -256,7 +256,7 @@ void ChannelsSelection::slotItemChecked(QTreeWidgetItem *item, int col)
Qt::CheckState enable = item->checkState(KColumnSelection);
- foreach(QTreeWidgetItem *chItem, getSameChannels(item))
+ foreach (QTreeWidgetItem *chItem, getSameChannels(item))
chItem->setCheckState(KColumnSelection, enable);
m_channelsTree->blockSignals(false);
@@ -279,7 +279,7 @@ void ChannelsSelection::slotComboChanged(int idx)
QVariant var = combo->property("treeItem");
QTreeWidgetItem *item = (QTreeWidgetItem *) var.value();
- foreach(QTreeWidgetItem *chItem, getSameChannels(item))
+ foreach (QTreeWidgetItem *chItem, getSameChannels(item))
{
QComboBox *chCombo = qobject_cast(m_channelsTree->itemWidget(chItem, KColumnBehaviour));
if (chCombo != NULL)
@@ -315,7 +315,7 @@ void ChannelsSelection::slotModifierButtonClicked()
QVariant var = button->property("treeItem");
QTreeWidgetItem *item = (QTreeWidgetItem *) var.value();
- foreach(QTreeWidgetItem *chItem, getSameChannels(item))
+ foreach (QTreeWidgetItem *chItem, getSameChannels(item))
{
QPushButton *chButton = qobject_cast(m_channelsTree->itemWidget(chItem, KColumnModifier));
if (chButton != NULL)
diff --git a/ui/src/chasereditor.cpp b/ui/src/chasereditor.cpp
index 30c407a85a..62e6d38c23 100644
--- a/ui/src/chasereditor.cpp
+++ b/ui/src/chasereditor.cpp
@@ -739,11 +739,11 @@ void ChaserEditor::slotPasteClicked()
Sequence *sequence = qobject_cast(m_chaser);
quint32 sceneID = sequence->boundSceneID();
Scene *scene = qobject_cast(m_doc->function(sceneID));
- foreach(ChaserStep step, pasteList)
+ foreach (ChaserStep step, pasteList)
{
if (step.fid != sceneID) // if IDs are the same then it's a valid step
{
- foreach(SceneValue scv, step.values)
+ foreach (SceneValue scv, step.values)
{
if (scene->checkValue(scv) == false)
{
diff --git a/ui/src/clickandgoslider.cpp b/ui/src/clickandgoslider.cpp
index 743f778170..670650cb4a 100644
--- a/ui/src/clickandgoslider.cpp
+++ b/ui/src/clickandgoslider.cpp
@@ -29,7 +29,7 @@ ClickAndGoSlider::ClickAndGoSlider(QWidget *parent) : QSlider(parent)
void ClickAndGoSlider::setSliderStyleSheet(const QString &styleSheet)
{
- if(isVisible())
+ if (isVisible())
QSlider::setStyleSheet(styleSheet);
else
m_styleSheet = styleSheet;
diff --git a/ui/src/clickandgowidget.cpp b/ui/src/clickandgowidget.cpp
index 0e4d71170c..c75daedcb5 100644
--- a/ui/src/clickandgowidget.cpp
+++ b/ui/src/clickandgowidget.cpp
@@ -210,7 +210,7 @@ QImage ClickAndGoWidget::getImageFromValue(uchar value)
* the pre-loaded resource */
if (m_type == Preset)
{
- foreach(PresetResource res, m_resources)
+ foreach (PresetResource res, m_resources)
{
if (value >= res.m_min && value <= res.m_max)
return res.m_thumbnail;
@@ -242,7 +242,7 @@ void ClickAndGoWidget::createPresetList(const QLCChannel *chan)
//qDebug() << Q_FUNC_INFO << "cap #" << chan->capabilities().size();
- foreach(QLCCapability* cap, chan->capabilities())
+ foreach (QLCCapability* cap, chan->capabilities())
{
if (cap->presetType() == QLCCapability::Picture)
{
diff --git a/ui/src/collectioneditor.cpp b/ui/src/collectioneditor.cpp
index 8691de2999..4c6a41fe25 100644
--- a/ui/src/collectioneditor.cpp
+++ b/ui/src/collectioneditor.cpp
@@ -195,7 +195,7 @@ void CollectionEditor::updateFunctionList()
{
m_tree->clear();
- foreach(QVariant fid, m_collection->functions())
+ foreach (QVariant fid, m_collection->functions())
{
Function* function = m_doc->function(fid.toUInt());
Q_ASSERT(function != NULL);
diff --git a/ui/src/consolechannel.cpp b/ui/src/consolechannel.cpp
index 5186e94bcc..b075b136bb 100644
--- a/ui/src/consolechannel.cpp
+++ b/ui/src/consolechannel.cpp
@@ -292,7 +292,7 @@ void ConsoleChannel::slotChecked(bool state)
void ConsoleChannel::setChannelStyleSheet(const QString &styleSheet)
{
- if(isVisible())
+ if (isVisible())
QGroupBox::setStyleSheet(styleSheet);
else
m_styleSheet = styleSheet;
diff --git a/ui/src/ctkrangeslider.cpp b/ui/src/ctkrangeslider.cpp
index 2acaae20fc..ee3c676765 100644
--- a/ui/src/ctkrangeslider.cpp
+++ b/ui/src/ctkrangeslider.cpp
@@ -33,180 +33,176 @@
class ctkRangeSliderPrivate
{
- Q_DECLARE_PUBLIC(ctkRangeSlider);
+ Q_DECLARE_PUBLIC(ctkRangeSlider);
protected:
- ctkRangeSlider* const q_ptr;
+ ctkRangeSlider *const q_ptr;
public:
- /// Boolean indicates the selected handle
- /// True for the minimum range handle, false for the maximum range handle
- enum Handle {
- NoHandle = 0x0,
- MinimumHandle = 0x1,
- MaximumHandle = 0x2
- };
- Q_DECLARE_FLAGS(Handles, Handle);
+ /// Boolean indicates the selected handle
+ /// True for the minimum range handle, false for the maximum range handle
+ enum Handle {
+ NoHandle = 0x0,
+ MinimumHandle = 0x1,
+ MaximumHandle = 0x2
+ };
+ Q_DECLARE_FLAGS(Handles, Handle);
- ctkRangeSliderPrivate(ctkRangeSlider& object);
- void init();
+ ctkRangeSliderPrivate(ctkRangeSlider& object);
+ void init();
- /// Return the handle at the given pos, or none if no handle is at the pos.
- /// If a handle is selected, handleRect is set to the handle rect.
- /// otherwise return NoHandle and handleRect is set to the combined rect of
- /// the min and max handles
- Handle handleAtPos(const QPoint& pos, QRect& handleRect)const;
+ /// Return the handle at the given pos, or none if no handle is at the pos.
+ /// If a handle is selected, handleRect is set to the handle rect.
+ /// otherwise return NoHandle and handleRect is set to the combined rect of
+ /// the min and max handles
+ Handle handleAtPos(const QPoint& pos, QRect& handleRect)const;
- /// Copied verbatim from QSliderPrivate class (see QSlider.cpp)
- int pixelPosToRangeValue(int pos) const;
- int pixelPosFromRangeValue(int val) const;
+ /// Copied verbatim from QSliderPrivate class (see QSlider.cpp)
+ int pixelPosToRangeValue(int pos) const;
+ int pixelPosFromRangeValue(int val) const;
- /// Draw the bottom and top sliders.
- void drawMinimumSlider( QStylePainter* painter ) const;
- void drawMaximumSlider( QStylePainter* painter ) const;
+ /// Draw the bottom and top sliders.
+ void drawMinimumSlider(QStylePainter *painter) const;
+ void drawMaximumSlider(QStylePainter *painter) const;
- /// End points of the range on the Model
- int m_MaximumValue;
- int m_MinimumValue;
+ /// End points of the range on the Model
+ int m_MaximumValue;
+ int m_MinimumValue;
- /// End points of the range on the GUI. This is synced with the model.
- int m_MaximumPosition;
- int m_MinimumPosition;
+ /// End points of the range on the GUI. This is synced with the model.
+ int m_MaximumPosition;
+ int m_MinimumPosition;
- /// Controls selected ?
- QStyle::SubControl m_MinimumSliderSelected;
- QStyle::SubControl m_MaximumSliderSelected;
+ /// Controls selected ?
+ QStyle::SubControl m_MinimumSliderSelected;
+ QStyle::SubControl m_MaximumSliderSelected;
- /// See QSliderPrivate::clickOffset.
- /// Overrides this ivar
- int m_SubclassClickOffset;
+ /// See QSliderPrivate::clickOffset.
+ /// Overrides this ivar
+ int m_SubclassClickOffset;
- /// See QSliderPrivate::position
- /// Overrides this ivar.
- int m_SubclassPosition;
+ /// See QSliderPrivate::position
+ /// Overrides this ivar.
+ int m_SubclassPosition;
- /// Original width between the 2 bounds before any moves
- int m_SubclassWidth;
+ /// Original width between the 2 bounds before any moves
+ int m_SubclassWidth;
- ctkRangeSliderPrivate::Handles m_SelectedHandles;
+ ctkRangeSliderPrivate::Handles m_SelectedHandles;
- /// When symmetricMoves is true, moving a handle will move the other handle
- /// symmetrically, otherwise the handles are independent.
- bool m_SymmetricMoves;
+ /// When symmetricMoves is true, moving a handle will move the other handle
+ /// symmetrically, otherwise the handles are independent.
+ bool m_SymmetricMoves;
- QString m_HandleToolTip;
+ QString m_HandleToolTip;
private:
- Q_DISABLE_COPY(ctkRangeSliderPrivate);
+ Q_DISABLE_COPY(ctkRangeSliderPrivate);
};
// --------------------------------------------------------------------------
ctkRangeSliderPrivate::ctkRangeSliderPrivate(ctkRangeSlider& object)
- :q_ptr(&object)
+ : q_ptr(&object)
{
- this->m_MinimumValue = 0;
- this->m_MaximumValue = 100;
- this->m_MinimumPosition = 0;
- this->m_MaximumPosition = 100;
- this->m_MinimumSliderSelected = QStyle::SC_None;
- this->m_MaximumSliderSelected = QStyle::SC_None;
- this->m_SubclassClickOffset = 0;
- this->m_SubclassPosition = 0;
- this->m_SubclassWidth = 0;
- this->m_SelectedHandles = NoHandle;
- this->m_SymmetricMoves = false;
+ this->m_MinimumValue = 0;
+ this->m_MaximumValue = 100;
+ this->m_MinimumPosition = 0;
+ this->m_MaximumPosition = 100;
+ this->m_MinimumSliderSelected = QStyle::SC_None;
+ this->m_MaximumSliderSelected = QStyle::SC_None;
+ this->m_SubclassClickOffset = 0;
+ this->m_SubclassPosition = 0;
+ this->m_SubclassWidth = 0;
+ this->m_SelectedHandles = NoHandle;
+ this->m_SymmetricMoves = false;
}
// --------------------------------------------------------------------------
void ctkRangeSliderPrivate::init()
{
- Q_Q(ctkRangeSlider);
- this->m_MinimumValue = q->minimum();
- this->m_MaximumValue = q->maximum();
- this->m_MinimumPosition = q->minimum();
- this->m_MaximumPosition = q->maximum();
- q->connect(q, SIGNAL(rangeChanged(int,int)), q, SLOT(onRangeChanged(int,int)));
+ Q_Q(ctkRangeSlider);
+ this->m_MinimumValue = q->minimum();
+ this->m_MaximumValue = q->maximum();
+ this->m_MinimumPosition = q->minimum();
+ this->m_MaximumPosition = q->maximum();
+ q->connect(q, SIGNAL(rangeChanged(int,int)), q, SLOT(onRangeChanged(int,int)));
}
// --------------------------------------------------------------------------
ctkRangeSliderPrivate::Handle ctkRangeSliderPrivate::handleAtPos(const QPoint& pos, QRect& handleRect)const
{
- Q_Q(const ctkRangeSlider);
+ Q_Q(const ctkRangeSlider);
- QStyleOptionSlider option;
- q->initStyleOption( &option );
+ QStyleOptionSlider option;
+ q->initStyleOption(&option);
- // The functinos hitTestComplexControl only know about 1 handle. As we have
- // 2, we change the position of the handle and test if the pos correspond to
- // any of the 2 positions.
+ // The functinos hitTestComplexControl only know about 1 handle. As we have
+ // 2, we change the position of the handle and test if the pos correspond to
+ // any of the 2 positions.
- // Test the MinimumHandle
- option.sliderPosition = this->m_MinimumPosition;
- option.sliderValue = this->m_MinimumValue;
+ // Test the MinimumHandle
+ option.sliderPosition = this->m_MinimumPosition;
+ option.sliderValue = this->m_MinimumValue;
- QStyle::SubControl minimumControl = q->style()->hitTestComplexControl(
- QStyle::CC_Slider, &option, pos, q);
- QRect minimumHandleRect = q->style()->subControlRect(
- QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, q);
+ QStyle::SubControl minimumControl = q->style()->hitTestComplexControl(QStyle::CC_Slider, &option, pos, q);
+ QRect minimumHandleRect = q->style()->subControlRect(QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, q);
- // Test if the pos is under the Maximum handle
- option.sliderPosition = this->m_MaximumPosition;
- option.sliderValue = this->m_MaximumValue;
+ // Test if the pos is under the Maximum handle
+ option.sliderPosition = this->m_MaximumPosition;
+ option.sliderValue = this->m_MaximumValue;
- QStyle::SubControl maximumControl = q->style()->hitTestComplexControl(
- QStyle::CC_Slider, &option, pos, q);
- QRect maximumHandleRect = q->style()->subControlRect(
- QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, q);
+ QStyle::SubControl maximumControl = q->style()->hitTestComplexControl(QStyle::CC_Slider, &option, pos, q);
+ QRect maximumHandleRect = q->style()->subControlRect(QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, q);
- // The pos is above both handles, select the closest handle
- if (minimumControl == QStyle::SC_SliderHandle &&
- maximumControl == QStyle::SC_SliderHandle)
+ // The pos is above both handles, select the closest handle
+ if (minimumControl == QStyle::SC_SliderHandle &&
+ maximumControl == QStyle::SC_SliderHandle)
{
- int minDist = 0;
- int maxDist = 0;
- if (q->orientation() == Qt::Horizontal)
- {
- minDist = pos.x() - minimumHandleRect.left();
- maxDist = maximumHandleRect.right() - pos.x();
- }
- else //if (q->orientation() == Qt::Vertical)
- {
- minDist = minimumHandleRect.bottom() - pos.y();
- maxDist = pos.y() - maximumHandleRect.top();
- }
- Q_ASSERT( minDist >= 0 && maxDist >= 0);
- minimumControl = minDist < maxDist ? minimumControl : QStyle::SC_None;
+ int minDist = 0;
+ int maxDist = 0;
+ if (q->orientation() == Qt::Horizontal)
+ {
+ minDist = pos.x() - minimumHandleRect.left();
+ maxDist = maximumHandleRect.right() - pos.x();
+ }
+ else //if (q->orientation() == Qt::Vertical)
+ {
+ minDist = minimumHandleRect.bottom() - pos.y();
+ maxDist = pos.y() - maximumHandleRect.top();
+ }
+ Q_ASSERT(minDist >= 0 && maxDist >= 0);
+ minimumControl = minDist < maxDist ? minimumControl : QStyle::SC_None;
}
- if (minimumControl == QStyle::SC_SliderHandle)
+ if (minimumControl == QStyle::SC_SliderHandle)
{
- handleRect = minimumHandleRect;
- return MinimumHandle;
+ handleRect = minimumHandleRect;
+ return MinimumHandle;
}
- else if (maximumControl == QStyle::SC_SliderHandle)
+ else if (maximumControl == QStyle::SC_SliderHandle)
{
- handleRect = maximumHandleRect;
- return MaximumHandle;
+ handleRect = maximumHandleRect;
+ return MaximumHandle;
}
- handleRect = minimumHandleRect.united(maximumHandleRect);
- return NoHandle;
+ handleRect = minimumHandleRect.united(maximumHandleRect);
+ return NoHandle;
}
// --------------------------------------------------------------------------
// Copied verbatim from QSliderPrivate::pixelPosToRangeValue. See QSlider.cpp
//
-int ctkRangeSliderPrivate::pixelPosToRangeValue( int pos ) const
-{
- Q_Q(const ctkRangeSlider);
- QStyleOptionSlider option;
- q->initStyleOption( &option );
-
- QRect gr = q->style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderGroove,
- q );
- QRect sr = q->style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderHandle,
- q );
+int ctkRangeSliderPrivate::pixelPosToRangeValue(int pos) const
+{
+ Q_Q(const ctkRangeSlider);
+ QStyleOptionSlider option;
+ q->initStyleOption(&option);
+
+ QRect gr = q->style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderGroove,
+ q);
+ QRect sr = q->style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderHandle,
+ q);
int sliderMin, sliderMax, sliderLength;
if (option.orientation == Qt::Horizontal)
{
@@ -221,135 +217,135 @@ int ctkRangeSliderPrivate::pixelPosToRangeValue( int pos ) const
sliderMax = gr.bottom() - sliderLength + 1;
}
- return QStyle::sliderValueFromPosition( q->minimum(),
- q->maximum(),
- pos - sliderMin,
- sliderMax - sliderMin,
- option.upsideDown );
+ return QStyle::sliderValueFromPosition(q->minimum(),
+ q->maximum(),
+ pos - sliderMin,
+ sliderMax - sliderMin,
+ option.upsideDown);
}
//---------------------------------------------------------------------------
-int ctkRangeSliderPrivate::pixelPosFromRangeValue( int val ) const
-{
- Q_Q(const ctkRangeSlider);
- QStyleOptionSlider option;
- q->initStyleOption( &option );
-
- QRect gr = q->style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderGroove,
- q );
- QRect sr = q->style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderHandle,
- q );
- int sliderMin, sliderMax, sliderLength;
- if (option.orientation == Qt::Horizontal)
+int ctkRangeSliderPrivate::pixelPosFromRangeValue(int val) const
+{
+ Q_Q(const ctkRangeSlider);
+ QStyleOptionSlider option;
+ q->initStyleOption(&option);
+
+ QRect gr = q->style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderGroove,
+ q);
+ QRect sr = q->style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderHandle,
+ q);
+ int sliderMin, sliderMax, sliderLength;
+ if (option.orientation == Qt::Horizontal)
{
- sliderLength = sr.width();
- sliderMin = gr.x();
- sliderMax = gr.right() - sliderLength + 1;
+ sliderLength = sr.width();
+ sliderMin = gr.x();
+ sliderMax = gr.right() - sliderLength + 1;
}
- else
+ else
{
- sliderLength = sr.height();
- sliderMin = gr.y();
- sliderMax = gr.bottom() - sliderLength + 1;
+ sliderLength = sr.height();
+ sliderMin = gr.y();
+ sliderMax = gr.bottom() - sliderLength + 1;
}
- return QStyle::sliderPositionFromValue( q->minimum(),
- q->maximum(),
- val,
- sliderMax - sliderMin,
- option.upsideDown ) + sliderMin;
+ return QStyle::sliderPositionFromValue(q->minimum(),
+ q->maximum(),
+ val,
+ sliderMax - sliderMin,
+ option.upsideDown) + sliderMin;
}
//---------------------------------------------------------------------------
// Draw slider at the bottom end of the range
-void ctkRangeSliderPrivate::drawMinimumSlider( QStylePainter* painter ) const
+void ctkRangeSliderPrivate::drawMinimumSlider(QStylePainter *painter) const
{
- Q_Q(const ctkRangeSlider);
- QStyleOptionSlider option;
- q->initMinimumSliderStyleOption( &option );
+ Q_Q(const ctkRangeSlider);
+ QStyleOptionSlider option;
+ q->initMinimumSliderStyleOption(&option);
- option.subControls = QStyle::SC_SliderHandle;
- option.sliderValue = m_MinimumValue;
- option.sliderPosition = m_MinimumPosition;
- if (q->isMinimumSliderDown())
+ option.subControls = QStyle::SC_SliderHandle;
+ option.sliderValue = m_MinimumValue;
+ option.sliderPosition = m_MinimumPosition;
+ if (q->isMinimumSliderDown())
{
- option.activeSubControls = QStyle::SC_SliderHandle;
- option.state |= QStyle::State_Sunken;
+ option.activeSubControls = QStyle::SC_SliderHandle;
+ option.state |= QStyle::State_Sunken;
}
#ifdef Q_OS_MAC
- // On mac style, drawing just the handle actually draws also the groove.
- QRect clip = q->style()->subControlRect(QStyle::CC_Slider, &option,
- QStyle::SC_SliderHandle, q);
- painter->setClipRect(clip);
+ // On mac style, drawing just the handle actually draws also the groove.
+ QRect clip = q->style()->subControlRect(QStyle::CC_Slider, &option,
+ QStyle::SC_SliderHandle, q);
+ painter->setClipRect(clip);
#endif
- painter->drawComplexControl(QStyle::CC_Slider, option);
+ painter->drawComplexControl(QStyle::CC_Slider, option);
}
//---------------------------------------------------------------------------
// Draw slider at the top end of the range
-void ctkRangeSliderPrivate::drawMaximumSlider( QStylePainter* painter ) const
+void ctkRangeSliderPrivate::drawMaximumSlider(QStylePainter *painter) const
{
- Q_Q(const ctkRangeSlider);
- QStyleOptionSlider option;
- q->initMaximumSliderStyleOption( &option );
+ Q_Q(const ctkRangeSlider);
+ QStyleOptionSlider option;
+ q->initMaximumSliderStyleOption(&option);
- option.subControls = QStyle::SC_SliderHandle;
- option.sliderValue = m_MaximumValue;
- option.sliderPosition = m_MaximumPosition;
- if (q->isMaximumSliderDown())
+ option.subControls = QStyle::SC_SliderHandle;
+ option.sliderValue = m_MaximumValue;
+ option.sliderPosition = m_MaximumPosition;
+ if (q->isMaximumSliderDown())
{
- option.activeSubControls = QStyle::SC_SliderHandle;
- option.state |= QStyle::State_Sunken;
+ option.activeSubControls = QStyle::SC_SliderHandle;
+ option.state |= QStyle::State_Sunken;
}
#ifdef Q_OS_MAC
- // On mac style, drawing just the handle actually draws also the groove.
- QRect clip = q->style()->subControlRect(QStyle::CC_Slider, &option,
- QStyle::SC_SliderHandle, q);
- painter->setClipRect(clip);
+ // On mac style, drawing just the handle actually draws also the groove.
+ QRect clip = q->style()->subControlRect(QStyle::CC_Slider, &option,
+ QStyle::SC_SliderHandle, q);
+ painter->setClipRect(clip);
#endif
- painter->drawComplexControl(QStyle::CC_Slider, option);
+ painter->drawComplexControl(QStyle::CC_Slider, option);
}
// --------------------------------------------------------------------------
-ctkRangeSlider::ctkRangeSlider(QWidget* _parent)
- : QSlider(_parent)
- , d_ptr(new ctkRangeSliderPrivate(*this))
+ctkRangeSlider::ctkRangeSlider(QWidget *_parent)
+ : QSlider(_parent)
+ , d_ptr(new ctkRangeSliderPrivate(*this))
{
- Q_D(ctkRangeSlider);
- d->init();
+ Q_D(ctkRangeSlider);
+ d->init();
}
// --------------------------------------------------------------------------
-ctkRangeSlider::ctkRangeSlider( Qt::Orientation o,
- QWidget* parentObject )
- :QSlider(o, parentObject)
- , d_ptr(new ctkRangeSliderPrivate(*this))
+ctkRangeSlider::ctkRangeSlider(Qt::Orientation o,
+ QWidget *parentObject)
+ : QSlider(o, parentObject)
+ , d_ptr(new ctkRangeSliderPrivate(*this))
{
- Q_D(ctkRangeSlider);
- d->init();
+ Q_D(ctkRangeSlider);
+ d->init();
}
// --------------------------------------------------------------------------
-ctkRangeSlider::ctkRangeSlider(ctkRangeSliderPrivate* impl, QWidget* _parent)
- : QSlider(_parent)
- , d_ptr(impl)
+ctkRangeSlider::ctkRangeSlider(ctkRangeSliderPrivate *impl, QWidget *_parent)
+ : QSlider(_parent)
+ , d_ptr(impl)
{
- Q_D(ctkRangeSlider);
- d->init();
+ Q_D(ctkRangeSlider);
+ d->init();
}
// --------------------------------------------------------------------------
-ctkRangeSlider::ctkRangeSlider( ctkRangeSliderPrivate* impl, Qt::Orientation o,
- QWidget* parentObject )
- :QSlider(o, parentObject)
- , d_ptr(impl)
+ctkRangeSlider::ctkRangeSlider(ctkRangeSliderPrivate *impl, Qt::Orientation o,
+ QWidget *parentObject)
+ : QSlider(o, parentObject)
+ , d_ptr(impl)
{
- Q_D(ctkRangeSlider);
- d->init();
+ Q_D(ctkRangeSlider);
+ d->init();
}
// --------------------------------------------------------------------------
@@ -360,278 +356,271 @@ ctkRangeSlider::~ctkRangeSlider()
// --------------------------------------------------------------------------
int ctkRangeSlider::minimumValue() const
{
- Q_D(const ctkRangeSlider);
- return d->m_MinimumValue;
+ Q_D(const ctkRangeSlider);
+ return d->m_MinimumValue;
}
// --------------------------------------------------------------------------
-void ctkRangeSlider::setMinimumValue( int min )
+void ctkRangeSlider::setMinimumValue(int min)
{
- Q_D(ctkRangeSlider);
- this->setValues( min, qMax(d->m_MaximumValue,min) );
+ Q_D(ctkRangeSlider);
+ this->setValues(min, qMax(d->m_MaximumValue,min));
}
// --------------------------------------------------------------------------
int ctkRangeSlider::maximumValue() const
{
- Q_D(const ctkRangeSlider);
- return d->m_MaximumValue;
+ Q_D(const ctkRangeSlider);
+ return d->m_MaximumValue;
}
// --------------------------------------------------------------------------
-void ctkRangeSlider::setMaximumValue( int max )
+void ctkRangeSlider::setMaximumValue(int max)
{
- Q_D(ctkRangeSlider);
- this->setValues( qMin(d->m_MinimumValue, max), max );
+ Q_D(ctkRangeSlider);
+ this->setValues(qMin(d->m_MinimumValue, max), max);
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setValues(int l, int u)
{
- Q_D(ctkRangeSlider);
- const int minValue =
- qBound(this->minimum(), qMin(l,u), this->maximum());
- const int maxValue =
- qBound(this->minimum(), qMax(l,u), this->maximum());
- bool emitMinValChanged = (minValue != d->m_MinimumValue);
- bool emitMaxValChanged = (maxValue != d->m_MaximumValue);
+ Q_D(ctkRangeSlider);
+ const int minValue = qBound(this->minimum(), qMin(l,u), this->maximum());
+ const int maxValue = qBound(this->minimum(), qMax(l,u), this->maximum());
+ bool emitMinValChanged = (minValue != d->m_MinimumValue);
+ bool emitMaxValChanged = (maxValue != d->m_MaximumValue);
- d->m_MinimumValue = minValue;
- d->m_MaximumValue = maxValue;
+ d->m_MinimumValue = minValue;
+ d->m_MaximumValue = maxValue;
- bool emitMinPosChanged =
- (minValue != d->m_MinimumPosition);
- bool emitMaxPosChanged =
- (maxValue != d->m_MaximumPosition);
- d->m_MinimumPosition = minValue;
- d->m_MaximumPosition = maxValue;
+ bool emitMinPosChanged = (minValue != d->m_MinimumPosition);
+ bool emitMaxPosChanged = (maxValue != d->m_MaximumPosition);
+ d->m_MinimumPosition = minValue;
+ d->m_MaximumPosition = maxValue;
- if (isSliderDown())
+ if (isSliderDown())
{
- if (emitMinPosChanged || emitMaxPosChanged)
- {
- emit positionsChanged(d->m_MinimumPosition, d->m_MaximumPosition);
- }
- if (emitMinPosChanged)
- {
- emit minimumPositionChanged(d->m_MinimumPosition);
- }
- if (emitMaxPosChanged)
- {
- emit maximumPositionChanged(d->m_MaximumPosition);
- }
+ if (emitMinPosChanged || emitMaxPosChanged)
+ {
+ emit positionsChanged(d->m_MinimumPosition, d->m_MaximumPosition);
+ }
+ if (emitMinPosChanged)
+ {
+ emit minimumPositionChanged(d->m_MinimumPosition);
+ }
+ if (emitMaxPosChanged)
+ {
+ emit maximumPositionChanged(d->m_MaximumPosition);
+ }
}
- if (emitMinValChanged || emitMaxValChanged)
+ if (emitMinValChanged || emitMaxValChanged)
{
- emit valuesChanged(d->m_MinimumValue,
- d->m_MaximumValue);
+ emit valuesChanged(d->m_MinimumValue, d->m_MaximumValue);
}
- if (emitMinValChanged)
+ if (emitMinValChanged)
{
- emit minimumValueChanged(d->m_MinimumValue);
+ emit minimumValueChanged(d->m_MinimumValue);
}
- if (emitMaxValChanged)
+ if (emitMaxValChanged)
{
- emit maximumValueChanged(d->m_MaximumValue);
+ emit maximumValueChanged(d->m_MaximumValue);
}
- if (emitMinPosChanged || emitMaxPosChanged ||
- emitMinValChanged || emitMaxValChanged)
+ if (emitMinPosChanged || emitMaxPosChanged ||
+ emitMinValChanged || emitMaxValChanged)
{
- this->update();
+ this->update();
}
}
// --------------------------------------------------------------------------
int ctkRangeSlider::minimumPosition() const
{
- Q_D(const ctkRangeSlider);
- return d->m_MinimumPosition;
+ Q_D(const ctkRangeSlider);
+ return d->m_MinimumPosition;
}
// --------------------------------------------------------------------------
int ctkRangeSlider::maximumPosition() const
{
- Q_D(const ctkRangeSlider);
- return d->m_MaximumPosition;
+ Q_D(const ctkRangeSlider);
+ return d->m_MaximumPosition;
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setMinimumPosition(int l)
{
- Q_D(const ctkRangeSlider);
- this->setPositions(l, qMax(l, d->m_MaximumPosition));
+ Q_D(const ctkRangeSlider);
+ this->setPositions(l, qMax(l, d->m_MaximumPosition));
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setMaximumPosition(int u)
{
- Q_D(const ctkRangeSlider);
- this->setPositions(qMin(d->m_MinimumPosition, u), u);
+ Q_D(const ctkRangeSlider);
+ this->setPositions(qMin(d->m_MinimumPosition, u), u);
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setPositions(int min, int max)
{
- Q_D(ctkRangeSlider);
- const int minPosition =
- qBound(this->minimum(), qMin(min, max), this->maximum());
- const int maxPosition =
- qBound(this->minimum(), qMax(min, max), this->maximum());
+ Q_D(ctkRangeSlider);
+ const int minPosition = qBound(this->minimum(), qMin(min, max), this->maximum());
+ const int maxPosition = qBound(this->minimum(), qMax(min, max), this->maximum());
- bool emitMinPosChanged = (minPosition != d->m_MinimumPosition);
- bool emitMaxPosChanged = (maxPosition != d->m_MaximumPosition);
+ bool emitMinPosChanged = (minPosition != d->m_MinimumPosition);
+ bool emitMaxPosChanged = (maxPosition != d->m_MaximumPosition);
- if (!emitMinPosChanged && !emitMaxPosChanged)
+ if (!emitMinPosChanged && !emitMaxPosChanged)
{
- return;
+ return;
}
- d->m_MinimumPosition = minPosition;
- d->m_MaximumPosition = maxPosition;
+ d->m_MinimumPosition = minPosition;
+ d->m_MaximumPosition = maxPosition;
- if (!this->hasTracking())
+ if (!this->hasTracking())
{
- this->update();
+ this->update();
}
- if (isSliderDown())
+ if (isSliderDown())
{
- if (emitMinPosChanged)
- {
- emit minimumPositionChanged(d->m_MinimumPosition);
- }
- if (emitMaxPosChanged)
- {
- emit maximumPositionChanged(d->m_MaximumPosition);
- }
- if (emitMinPosChanged || emitMaxPosChanged)
- {
- emit positionsChanged(d->m_MinimumPosition, d->m_MaximumPosition);
- }
+ if (emitMinPosChanged)
+ {
+ emit minimumPositionChanged(d->m_MinimumPosition);
+ }
+ if (emitMaxPosChanged)
+ {
+ emit maximumPositionChanged(d->m_MaximumPosition);
+ }
+ if (emitMinPosChanged || emitMaxPosChanged)
+ {
+ emit positionsChanged(d->m_MinimumPosition, d->m_MaximumPosition);
+ }
}
- if (this->hasTracking())
+ if (this->hasTracking())
{
- this->triggerAction(SliderMove);
- this->setValues(d->m_MinimumPosition, d->m_MaximumPosition);
+ this->triggerAction(SliderMove);
+ this->setValues(d->m_MinimumPosition, d->m_MaximumPosition);
}
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setSymmetricMoves(bool symmetry)
{
- Q_D(ctkRangeSlider);
- d->m_SymmetricMoves = symmetry;
+ Q_D(ctkRangeSlider);
+ d->m_SymmetricMoves = symmetry;
}
// --------------------------------------------------------------------------
bool ctkRangeSlider::symmetricMoves()const
{
- Q_D(const ctkRangeSlider);
- return d->m_SymmetricMoves;
+ Q_D(const ctkRangeSlider);
+ return d->m_SymmetricMoves;
}
// --------------------------------------------------------------------------
void ctkRangeSlider::onRangeChanged(int _minimum, int _maximum)
{
- Q_UNUSED(_minimum);
- Q_UNUSED(_maximum);
- Q_D(ctkRangeSlider);
- this->setValues(d->m_MinimumValue, d->m_MaximumValue);
+ Q_UNUSED(_minimum);
+ Q_UNUSED(_maximum);
+ Q_D(ctkRangeSlider);
+ this->setValues(d->m_MinimumValue, d->m_MaximumValue);
}
// --------------------------------------------------------------------------
// Render
-void ctkRangeSlider::paintEvent( QPaintEvent* )
-{
- Q_D(ctkRangeSlider);
- QStyleOptionSlider option;
- this->initStyleOption(&option);
-
- QStylePainter painter(this);
- option.subControls = QStyle::SC_SliderGroove;
- // Move to minimum to not highlight the SliderGroove.
- // On mac style, drawing just the slider groove also draws the handles,
- // therefore we give a negative (outside of view) position.
- option.sliderValue = this->minimum() - this->maximum();
- option.sliderPosition = this->minimum() - this->maximum();
- painter.drawComplexControl(QStyle::CC_Slider, option);
-
- option.sliderPosition = d->m_MinimumPosition;
- const QRect lr = style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderHandle,
- this);
- option.sliderPosition = d->m_MaximumPosition;
-
- const QRect ur = style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderHandle,
- this);
-
- QRect sr = style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderGroove,
- this);
- QRect rangeBox;
- if (option.orientation == Qt::Horizontal)
+void ctkRangeSlider::paintEvent(QPaintEvent *)
+{
+ Q_D(ctkRangeSlider);
+ QStyleOptionSlider option;
+ this->initStyleOption(&option);
+
+ QStylePainter painter(this);
+ option.subControls = QStyle::SC_SliderGroove;
+ // Move to minimum to not highlight the SliderGroove.
+ // On mac style, drawing just the slider groove also draws the handles,
+ // therefore we give a negative (outside of view) position.
+ option.sliderValue = this->minimum() - this->maximum();
+ option.sliderPosition = this->minimum() - this->maximum();
+ painter.drawComplexControl(QStyle::CC_Slider, option);
+
+ option.sliderPosition = d->m_MinimumPosition;
+ const QRect lr = style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderHandle,
+ this);
+ option.sliderPosition = d->m_MaximumPosition;
+
+ const QRect ur = style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderHandle,
+ this);
+
+ QRect sr = style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderGroove,
+ this);
+ QRect rangeBox;
+ if (option.orientation == Qt::Horizontal)
{
- rangeBox = QRect(
- QPoint(qMin( lr.center().x(), ur.center().x() ), sr.center().y() - 2),
- QPoint(qMax( lr.center().x(), ur.center().x() ), sr.center().y() + 1));
+ rangeBox = QRect(
+ QPoint(qMin(lr.center().x(), ur.center().x()), sr.center().y() - 2),
+ QPoint(qMax(lr.center().x(), ur.center().x()), sr.center().y() + 1));
}
- else
+ else
{
- rangeBox = QRect(
- QPoint(sr.center().x() - 2, qMin( lr.center().y(), ur.center().y() )),
- QPoint(sr.center().x() + 1, qMax( lr.center().y(), ur.center().y() )));
+ rangeBox = QRect(
+ QPoint(sr.center().x() - 2, qMin(lr.center().y(), ur.center().y())),
+ QPoint(sr.center().x() + 1, qMax(lr.center().y(), ur.center().y())));
}
- // -----------------------------
- // Render the range
- //
- QRect groove = this->style()->subControlRect( QStyle::CC_Slider,
- &option,
- QStyle::SC_SliderGroove,
- this );
- groove.adjust(0, 0, -1, 0);
+ // -----------------------------
+ // Render the range
+ //
+ QRect groove = this->style()->subControlRect(QStyle::CC_Slider,
+ &option,
+ QStyle::SC_SliderGroove,
+ this);
+ groove.adjust(0, 0, -1, 0);
- // Create default colors based on the transfer function.
- //
- QColor highlight = this->palette().color(QPalette::Normal, QPalette::Highlight);
- QLinearGradient gradient;
- if (option.orientation == Qt::Horizontal)
+ // Create default colors based on the transfer function.
+ //
+ QColor highlight = this->palette().color(QPalette::Normal, QPalette::Highlight);
+ QLinearGradient gradient;
+ if (option.orientation == Qt::Horizontal)
{
- gradient = QLinearGradient( groove.center().x(), groove.top(),
- groove.center().x(), groove.bottom());
+ gradient = QLinearGradient(groove.center().x(), groove.top(),
+ groove.center().x(), groove.bottom());
}
- else
+ else
{
- gradient = QLinearGradient( groove.left(), groove.center().y(),
- groove.right(), groove.center().y());
+ gradient = QLinearGradient(groove.left(), groove.center().y(),
+ groove.right(), groove.center().y());
}
- // TODO: Set this based on the supplied transfer function
- //QColor l = Qt::darkGray;
- //QColor u = Qt::black;
+ // TODO: Set this based on the supplied transfer function
+ //QColor l = Qt::darkGray;
+ //QColor u = Qt::black;
- gradient.setColorAt(0, highlight.darker(120));
- gradient.setColorAt(1, highlight.lighter(160));
+ gradient.setColorAt(0, highlight.darker(120));
+ gradient.setColorAt(1, highlight.lighter(160));
- painter.setPen(QPen(highlight.darker(150), 0));
- painter.setBrush(gradient);
- painter.drawRect( rangeBox.intersected(groove) );
+ painter.setPen(QPen(highlight.darker(150), 0));
+ painter.setBrush(gradient);
+ painter.drawRect(rangeBox.intersected(groove));
- // -----------------------------------
- // Render the sliders
- //
- if (this->isMinimumSliderDown())
+ // -----------------------------------
+ // Render the sliders
+ //
+ if (this->isMinimumSliderDown())
{
- d->drawMaximumSlider( &painter );
- d->drawMinimumSlider( &painter );
+ d->drawMaximumSlider(&painter);
+ d->drawMinimumSlider(&painter);
}
- else
+ else
{
- d->drawMinimumSlider( &painter );
- d->drawMaximumSlider( &painter );
+ d->drawMinimumSlider(&painter);
+ d->drawMaximumSlider(&painter);
}
}
@@ -639,221 +628,219 @@ void ctkRangeSlider::paintEvent( QPaintEvent* )
// Standard Qt UI events
void ctkRangeSlider::mousePressEvent(QMouseEvent* mouseEvent)
{
- Q_D(ctkRangeSlider);
- if (minimum() == maximum() || (mouseEvent->buttons() ^ mouseEvent->button()))
+ Q_D(ctkRangeSlider);
+ if (minimum() == maximum() || (mouseEvent->buttons() ^ mouseEvent->button()))
{
- mouseEvent->ignore();
- return;
+ mouseEvent->ignore();
+ return;
}
- int mepos = this->orientation() == Qt::Horizontal ?
- mouseEvent->pos().x() : mouseEvent->pos().y();
+ int mepos = this->orientation() == Qt::Horizontal ?
+ mouseEvent->pos().x() : mouseEvent->pos().y();
- QStyleOptionSlider option;
- this->initStyleOption( &option );
+ QStyleOptionSlider option;
+ this->initStyleOption(&option);
- QRect handleRect;
- ctkRangeSliderPrivate::Handle handle_ = d->handleAtPos(mouseEvent->pos(), handleRect);
+ QRect handleRect;
+ ctkRangeSliderPrivate::Handle handle_ = d->handleAtPos(mouseEvent->pos(), handleRect);
- if (handle_ != ctkRangeSliderPrivate::NoHandle)
+ if (handle_ != ctkRangeSliderPrivate::NoHandle)
{
- d->m_SubclassPosition = (handle_ == ctkRangeSliderPrivate::MinimumHandle)?
- d->m_MinimumPosition : d->m_MaximumPosition;
+ d->m_SubclassPosition = (handle_ == ctkRangeSliderPrivate::MinimumHandle) ?
+ d->m_MinimumPosition : d->m_MaximumPosition;
- // save the position of the mouse inside the handle for later
- d->m_SubclassClickOffset = mepos - (this->orientation() == Qt::Horizontal ?
- handleRect.left() : handleRect.top());
+ // save the position of the mouse inside the handle for later
+ d->m_SubclassClickOffset = mepos - (this->orientation() == Qt::Horizontal ?
+ handleRect.left() : handleRect.top());
- this->setSliderDown(true);
+ this->setSliderDown(true);
- if (d->m_SelectedHandles != handle_)
- {
- d->m_SelectedHandles = handle_;
- this->update(handleRect);
- }
- // Accept the mouseEvent
- mouseEvent->accept();
- return;
- }
-
- // if we are here, no handles have been pressed
- // Check if we pressed on the groove between the 2 handles
-
- QStyle::SubControl control = this->style()->hitTestComplexControl(
- QStyle::CC_Slider, &option, mouseEvent->pos(), this);
- QRect sr = style()->subControlRect(
- QStyle::CC_Slider, &option, QStyle::SC_SliderGroove, this);
- int minCenter = (this->orientation() == Qt::Horizontal ?
- handleRect.left() : handleRect.top());
- int maxCenter = (this->orientation() == Qt::Horizontal ?
- handleRect.right() : handleRect.bottom());
- if (control == QStyle::SC_SliderGroove &&
- mepos > minCenter && mepos < maxCenter)
- {
- // warning lost of precision it might be fatal
- d->m_SubclassPosition = (d->m_MinimumPosition + d->m_MaximumPosition) / 2.;
- d->m_SubclassClickOffset = mepos - d->pixelPosFromRangeValue(d->m_SubclassPosition);
- d->m_SubclassWidth = (d->m_MaximumPosition - d->m_MinimumPosition) / 2;
- qMax(d->m_SubclassPosition - d->m_MinimumPosition, d->m_MaximumPosition - d->m_SubclassPosition);
- this->setSliderDown(true);
- if (!this->isMinimumSliderDown() || !this->isMaximumSliderDown())
- {
- d->m_SelectedHandles =
- QFlags(ctkRangeSliderPrivate::MinimumHandle) |
- QFlags(ctkRangeSliderPrivate::MaximumHandle);
- this->update(handleRect.united(sr));
- }
- mouseEvent->accept();
- return;
+ if (d->m_SelectedHandles != handle_)
+ {
+ d->m_SelectedHandles = handle_;
+ this->update(handleRect);
+ }
+ // Accept the mouseEvent
+ mouseEvent->accept();
+ return;
+ }
+
+ // if we are here, no handles have been pressed
+ // Check if we pressed on the groove between the 2 handles
+
+ QStyle::SubControl control = this->style()->hitTestComplexControl(QStyle::CC_Slider, &option, mouseEvent->pos(), this);
+ QRect sr = style()->subControlRect(QStyle::CC_Slider, &option, QStyle::SC_SliderGroove, this);
+ int minCenter = (this->orientation() == Qt::Horizontal ?
+ handleRect.left() : handleRect.top());
+ int maxCenter = (this->orientation() == Qt::Horizontal ?
+ handleRect.right() : handleRect.bottom());
+ if (control == QStyle::SC_SliderGroove &&
+ mepos > minCenter && mepos < maxCenter)
+ {
+ // warning lost of precision it might be fatal
+ d->m_SubclassPosition = (d->m_MinimumPosition + d->m_MaximumPosition) / 2.;
+ d->m_SubclassClickOffset = mepos - d->pixelPosFromRangeValue(d->m_SubclassPosition);
+ d->m_SubclassWidth = (d->m_MaximumPosition - d->m_MinimumPosition) / 2;
+ qMax(d->m_SubclassPosition - d->m_MinimumPosition, d->m_MaximumPosition - d->m_SubclassPosition);
+ this->setSliderDown(true);
+ if (!this->isMinimumSliderDown() || !this->isMaximumSliderDown())
+ {
+ d->m_SelectedHandles =
+ QFlags(ctkRangeSliderPrivate::MinimumHandle) |
+ QFlags(ctkRangeSliderPrivate::MaximumHandle);
+ this->update(handleRect.united(sr));
+ }
+ mouseEvent->accept();
+ return;
}
- mouseEvent->ignore();
+ mouseEvent->ignore();
}
// --------------------------------------------------------------------------
// Standard Qt UI events
void ctkRangeSlider::mouseMoveEvent(QMouseEvent* mouseEvent)
{
- Q_D(ctkRangeSlider);
- if (!d->m_SelectedHandles)
+ Q_D(ctkRangeSlider);
+ if (!d->m_SelectedHandles)
{
- mouseEvent->ignore();
- return;
+ mouseEvent->ignore();
+ return;
}
- int mepos = this->orientation() == Qt::Horizontal ?
- mouseEvent->pos().x() : mouseEvent->pos().y();
+ int mepos = this->orientation() == Qt::Horizontal ?
+ mouseEvent->pos().x() : mouseEvent->pos().y();
- QStyleOptionSlider option;
- this->initStyleOption(&option);
+ QStyleOptionSlider option;
+ this->initStyleOption(&option);
- const int m = style()->pixelMetric( QStyle::PM_MaximumDragDistance, &option, this );
+ const int m = style()->pixelMetric(QStyle::PM_MaximumDragDistance, &option, this);
- int newPosition = d->pixelPosToRangeValue(mepos - d->m_SubclassClickOffset);
+ int newPosition = d->pixelPosToRangeValue(mepos - d->m_SubclassClickOffset);
- if (m >= 0)
+ if (m >= 0)
{
- const QRect r = rect().adjusted(-m, -m, m, m);
- if (!r.contains(mouseEvent->pos()))
- {
- newPosition = d->m_SubclassPosition;
- }
+ const QRect r = rect().adjusted(-m, -m, m, m);
+ if (!r.contains(mouseEvent->pos()))
+ {
+ newPosition = d->m_SubclassPosition;
+ }
}
- // Only the lower/left slider is down
- if (this->isMinimumSliderDown() && !this->isMaximumSliderDown())
+ // Only the lower/left slider is down
+ if (this->isMinimumSliderDown() && !this->isMaximumSliderDown())
{
- double newMinPos = qMin(newPosition,d->m_MaximumPosition);
- this->setPositions(newMinPos, d->m_MaximumPosition +
- (d->m_SymmetricMoves ? d->m_MinimumPosition - newMinPos : 0));
+ double newMinPos = qMin(newPosition,d->m_MaximumPosition);
+ this->setPositions(newMinPos, d->m_MaximumPosition +
+ (d->m_SymmetricMoves ? d->m_MinimumPosition - newMinPos : 0));
}
- // Only the upper/right slider is down
- else if (this->isMaximumSliderDown() && !this->isMinimumSliderDown())
+ // Only the upper/right slider is down
+ else if (this->isMaximumSliderDown() && !this->isMinimumSliderDown())
{
- double newMaxPos = qMax(d->m_MinimumPosition, newPosition);
- this->setPositions(d->m_MinimumPosition -
- (d->m_SymmetricMoves ? newMaxPos - d->m_MaximumPosition: 0),
- newMaxPos);
+ double newMaxPos = qMax(d->m_MinimumPosition, newPosition);
+ this->setPositions(d->m_MinimumPosition -
+ (d->m_SymmetricMoves ? newMaxPos - d->m_MaximumPosition: 0),
+ newMaxPos);
}
- // Both handles are down (the user clicked in between the handles)
- else if (this->isMinimumSliderDown() && this->isMaximumSliderDown())
+ // Both handles are down (the user clicked in between the handles)
+ else if (this->isMinimumSliderDown() && this->isMaximumSliderDown())
{
- this->setPositions(newPosition - d->m_SubclassWidth,
- newPosition + d->m_SubclassWidth );
+ this->setPositions(newPosition - d->m_SubclassWidth,
+ newPosition + d->m_SubclassWidth);
}
- mouseEvent->accept();
+ mouseEvent->accept();
}
// --------------------------------------------------------------------------
// Standard Qt UI mouseEvents
void ctkRangeSlider::mouseReleaseEvent(QMouseEvent* mouseEvent)
{
- Q_D(ctkRangeSlider);
- this->QSlider::mouseReleaseEvent(mouseEvent);
+ Q_D(ctkRangeSlider);
+ this->QSlider::mouseReleaseEvent(mouseEvent);
- setSliderDown(false);
- d->m_SelectedHandles = ctkRangeSliderPrivate::NoHandle;
+ setSliderDown(false);
+ d->m_SelectedHandles = ctkRangeSliderPrivate::NoHandle;
- this->update();
+ this->update();
}
// --------------------------------------------------------------------------
bool ctkRangeSlider::isMinimumSliderDown()const
{
- Q_D(const ctkRangeSlider);
- return d->m_SelectedHandles & ctkRangeSliderPrivate::MinimumHandle;
+ Q_D(const ctkRangeSlider);
+ return d->m_SelectedHandles & ctkRangeSliderPrivate::MinimumHandle;
}
// --------------------------------------------------------------------------
bool ctkRangeSlider::isMaximumSliderDown()const
{
- Q_D(const ctkRangeSlider);
- return d->m_SelectedHandles & ctkRangeSliderPrivate::MaximumHandle;
+ Q_D(const ctkRangeSlider);
+ return d->m_SelectedHandles & ctkRangeSliderPrivate::MaximumHandle;
}
// --------------------------------------------------------------------------
void ctkRangeSlider::initMinimumSliderStyleOption(QStyleOptionSlider* option) const
{
- this->initStyleOption(option);
+ this->initStyleOption(option);
}
// --------------------------------------------------------------------------
void ctkRangeSlider::initMaximumSliderStyleOption(QStyleOptionSlider* option) const
{
- this->initStyleOption(option);
+ this->initStyleOption(option);
}
// --------------------------------------------------------------------------
QString ctkRangeSlider::handleToolTip()const
{
- Q_D(const ctkRangeSlider);
- return d->m_HandleToolTip;
+ Q_D(const ctkRangeSlider);
+ return d->m_HandleToolTip;
}
// --------------------------------------------------------------------------
void ctkRangeSlider::setHandleToolTip(const QString& _toolTip)
{
- Q_D(ctkRangeSlider);
- d->m_HandleToolTip = _toolTip;
+ Q_D(ctkRangeSlider);
+ d->m_HandleToolTip = _toolTip;
}
// --------------------------------------------------------------------------
bool ctkRangeSlider::event(QEvent* _event)
{
- Q_D(ctkRangeSlider);
- switch(_event->type())
+ Q_D(ctkRangeSlider);
+ switch(_event->type())
{
case QEvent::ToolTip:
- {
- QHelpEvent* helpEvent = static_cast(_event);
- QStyleOptionSlider opt;
- // Test the MinimumHandle
- opt.sliderPosition = d->m_MinimumPosition;
- opt.sliderValue = d->m_MinimumValue;
- this->initStyleOption(&opt);
- QStyle::SubControl hoveredControl =
- this->style()->hitTestComplexControl(
- QStyle::CC_Slider, &opt, helpEvent->pos(), this);
- if (!d->m_HandleToolTip.isEmpty() &&
- hoveredControl == QStyle::SC_SliderHandle)
+ {
+ QHelpEvent* helpEvent = static_cast(_event);
+ QStyleOptionSlider opt;
+ // Test the MinimumHandle
+ opt.sliderPosition = d->m_MinimumPosition;
+ opt.sliderValue = d->m_MinimumValue;
+ this->initStyleOption(&opt);
+ QStyle::SubControl hoveredControl =
+ this->style()->hitTestComplexControl(
+ QStyle::CC_Slider, &opt, helpEvent->pos(), this);
+ if (!d->m_HandleToolTip.isEmpty() &&
+ hoveredControl == QStyle::SC_SliderHandle)
{
- QToolTip::showText(helpEvent->globalPos(), d->m_HandleToolTip.arg(this->minimumValue()));
- _event->accept();
- return true;
+ QToolTip::showText(helpEvent->globalPos(), d->m_HandleToolTip.arg(this->minimumValue()));
+ _event->accept();
+ return true;
}
- // Test the MaximumHandle
- opt.sliderPosition = d->m_MaximumPosition;
- opt.sliderValue = d->m_MaximumValue;
- this->initStyleOption(&opt);
- hoveredControl = this->style()->hitTestComplexControl(
- QStyle::CC_Slider, &opt, helpEvent->pos(), this);
- if (!d->m_HandleToolTip.isEmpty() &&
- hoveredControl == QStyle::SC_SliderHandle)
+ // Test the MaximumHandle
+ opt.sliderPosition = d->m_MaximumPosition;
+ opt.sliderValue = d->m_MaximumValue;
+ this->initStyleOption(&opt);
+ hoveredControl = this->style()->hitTestComplexControl(
+ QStyle::CC_Slider, &opt, helpEvent->pos(), this);
+ if (!d->m_HandleToolTip.isEmpty() &&
+ hoveredControl == QStyle::SC_SliderHandle)
{
- QToolTip::showText(helpEvent->globalPos(), d->m_HandleToolTip.arg(this->maximumValue()));
- _event->accept();
- return true;
+ QToolTip::showText(helpEvent->globalPos(), d->m_HandleToolTip.arg(this->maximumValue()));
+ _event->accept();
+ return true;
}
- }
+ }
default:
- break;
+ break;
}
- return this->Superclass::event(_event);
+ return this->Superclass::event(_event);
}
diff --git a/ui/src/ctkrangeslider.h b/ui/src/ctkrangeslider.h
index b53adecab5..99c8b99a02 100644
--- a/ui/src/ctkrangeslider.h
+++ b/ui/src/ctkrangeslider.h
@@ -47,163 +47,163 @@ class ctkRangeSliderPrivate;
/// \sa ctkDoubleRangeSlider, ctkDoubleSlider, ctkRangeWidget
class ctkRangeSlider : public QSlider
{
- Q_OBJECT
- Q_PROPERTY(int minimumValue READ minimumValue WRITE setMinimumValue)
- Q_PROPERTY(int maximumValue READ maximumValue WRITE setMaximumValue)
- Q_PROPERTY(int minimumPosition READ minimumPosition WRITE setMinimumPosition)
- Q_PROPERTY(int maximumPosition READ maximumPosition WRITE setMaximumPosition)
- Q_PROPERTY(bool symmetricMoves READ symmetricMoves WRITE setSymmetricMoves)
- Q_PROPERTY(QString handleToolTip READ handleToolTip WRITE setHandleToolTip)
+ Q_OBJECT
+ Q_PROPERTY(int minimumValue READ minimumValue WRITE setMinimumValue)
+ Q_PROPERTY(int maximumValue READ maximumValue WRITE setMaximumValue)
+ Q_PROPERTY(int minimumPosition READ minimumPosition WRITE setMinimumPosition)
+ Q_PROPERTY(int maximumPosition READ maximumPosition WRITE setMaximumPosition)
+ Q_PROPERTY(bool symmetricMoves READ symmetricMoves WRITE setSymmetricMoves)
+ Q_PROPERTY(QString handleToolTip READ handleToolTip WRITE setHandleToolTip)
public:
- // Superclass typedef
- typedef QSlider Superclass;
- /// Constructor, builds a ctkRangeSlider that ranges from 0 to 100 and has
- /// a lower and upper values of 0 and 100 respectively, other properties
- /// are set the QSlider default properties.
- explicit ctkRangeSlider( Qt::Orientation o, QWidget* par= 0 );
- explicit ctkRangeSlider( QWidget* par = 0 );
- virtual ~ctkRangeSlider();
-
- ///
- /// This property holds the slider's current minimum value.
- /// The slider silently forces minimumValue to be within the legal range:
- /// minimum() <= minimumValue() <= maximumValue() <= maximum().
- /// Changing the minimumValue also changes the minimumPosition.
- int minimumValue() const;
-
- ///
- /// This property holds the slider's current maximum value.
- /// The slider forces the maximum value to be within the legal range:
- /// The slider silently forces maximumValue to be within the legal range:
- /// Changing the maximumValue also changes the maximumPosition.
- int maximumValue() const;
-
- ///
- /// This property holds the current slider minimum position.
- /// If tracking is enabled (the default), this is identical to minimumValue.
- int minimumPosition() const;
- void setMinimumPosition(int min);
-
- ///
- /// This property holds the current slider maximum position.
- /// If tracking is enabled (the default), this is identical to maximumValue.
- int maximumPosition() const;
- void setMaximumPosition(int max);
-
- ///
- /// Utility function that set the minimum position and
- /// maximum position at once.
- void setPositions(int min, int max);
-
- ///
- /// When symmetricMoves is true, moving a handle will move the other handle
- /// symmetrically, otherwise the handles are independent. False by default
- bool symmetricMoves()const;
- void setSymmetricMoves(bool symmetry);
-
- ///
- /// Controls the text to display for the handle tooltip. It is in addition
- /// to the widget tooltip.
- /// "%1" is replaced by the current value of the slider.
- /// Empty string (by default) means no tooltip.
- QString handleToolTip()const;
- void setHandleToolTip(const QString& toolTip);
-
- /// Returns true if the minimum value handle is down, false if it is up.
- /// \sa isMaximumSliderDown()
- bool isMinimumSliderDown()const;
- /// Returns true if the maximum value handle is down, false if it is up.
- /// \sa isMinimumSliderDown()
- bool isMaximumSliderDown()const;
+ // Superclass typedef
+ typedef QSlider Superclass;
+ /// Constructor, builds a ctkRangeSlider that ranges from 0 to 100 and has
+ /// a lower and upper values of 0 and 100 respectively, other properties
+ /// are set the QSlider default properties.
+ explicit ctkRangeSlider(Qt::Orientation o, QWidget *par= 0);
+ explicit ctkRangeSlider(QWidget *par = 0);
+ virtual ~ctkRangeSlider();
+
+ ///
+ /// This property holds the slider's current minimum value.
+ /// The slider silently forces minimumValue to be within the legal range:
+ /// minimum() <= minimumValue() <= maximumValue() <= maximum().
+ /// Changing the minimumValue also changes the minimumPosition.
+ int minimumValue() const;
+
+ ///
+ /// This property holds the slider's current maximum value.
+ /// The slider forces the maximum value to be within the legal range:
+ /// The slider silently forces maximumValue to be within the legal range:
+ /// Changing the maximumValue also changes the maximumPosition.
+ int maximumValue() const;
+
+ ///
+ /// This property holds the current slider minimum position.
+ /// If tracking is enabled (the default), this is identical to minimumValue.
+ int minimumPosition() const;
+ void setMinimumPosition(int min);
+
+ ///
+ /// This property holds the current slider maximum position.
+ /// If tracking is enabled (the default), this is identical to maximumValue.
+ int maximumPosition() const;
+ void setMaximumPosition(int max);
+
+ ///
+ /// Utility function that set the minimum position and
+ /// maximum position at once.
+ void setPositions(int min, int max);
+
+ ///
+ /// When symmetricMoves is true, moving a handle will move the other handle
+ /// symmetrically, otherwise the handles are independent. False by default
+ bool symmetricMoves()const;
+ void setSymmetricMoves(bool symmetry);
+
+ ///
+ /// Controls the text to display for the handle tooltip. It is in addition
+ /// to the widget tooltip.
+ /// "%1" is replaced by the current value of the slider.
+ /// Empty string (by default) means no tooltip.
+ QString handleToolTip()const;
+ void setHandleToolTip(const QString& toolTip);
+
+ /// Returns true if the minimum value handle is down, false if it is up.
+ /// \sa isMaximumSliderDown()
+ bool isMinimumSliderDown()const;
+ /// Returns true if the maximum value handle is down, false if it is up.
+ /// \sa isMinimumSliderDown()
+ bool isMaximumSliderDown()const;
Q_SIGNALS:
- ///
- /// This signal is emitted when the slider minimum value has changed,
- /// with the new slider value as argument.
- void minimumValueChanged(int min);
- ///
- /// This signal is emitted when the slider maximum value has changed,
- /// with the new slider value as argument.
- void maximumValueChanged(int max);
- ///
- /// Utility signal that is fired when minimum or maximum values have changed.
- void valuesChanged(int min, int max);
-
- ///
- /// This signal is emitted when sliderDown is true and the slider moves.
- /// This usually happens when the user is dragging the minimum slider.
- /// The value is the new slider minimum position.
- /// This signal is emitted even when tracking is turned off.
- void minimumPositionChanged(int min);
-
- ///
- /// This signal is emitted when sliderDown is true and the slider moves.
- /// This usually happens when the user is dragging the maximum slider.
- /// The value is the new slider maximum position.
- /// This signal is emitted even when tracking is turned off.
- void maximumPositionChanged(int max);
-
- ///
- /// Utility signal that is fired when minimum or maximum positions
- /// have changed.
- void positionsChanged(int min, int max);
+ ///
+ /// This signal is emitted when the slider minimum value has changed,
+ /// with the new slider value as argument.
+ void minimumValueChanged(int min);
+ ///
+ /// This signal is emitted when the slider maximum value has changed,
+ /// with the new slider value as argument.
+ void maximumValueChanged(int max);
+ ///
+ /// Utility signal that is fired when minimum or maximum values have changed.
+ void valuesChanged(int min, int max);
+
+ ///
+ /// This signal is emitted when sliderDown is true and the slider moves.
+ /// This usually happens when the user is dragging the minimum slider.
+ /// The value is the new slider minimum position.
+ /// This signal is emitted even when tracking is turned off.
+ void minimumPositionChanged(int min);
+
+ ///
+ /// This signal is emitted when sliderDown is true and the slider moves.
+ /// This usually happens when the user is dragging the maximum slider.
+ /// The value is the new slider maximum position.
+ /// This signal is emitted even when tracking is turned off.
+ void maximumPositionChanged(int max);
+
+ ///
+ /// Utility signal that is fired when minimum or maximum positions
+ /// have changed.
+ void positionsChanged(int min, int max);
public Q_SLOTS:
- ///
- /// This property holds the slider's current minimum value.
- /// The slider silently forces min to be within the legal range:
- /// minimum() <= min <= maximumValue() <= maximum().
- /// Note: Changing the minimumValue also changes the minimumPosition.
- /// \sa stMaximumValue, setValues, setMinimum, setMaximum, setRange
- void setMinimumValue(int min);
-
- ///
- /// This property holds the slider's current maximum value.
- /// The slider silently forces max to be within the legal range:
- /// minimum() <= minimumValue() <= max <= maximum().
- /// Note: Changing the maximumValue also changes the maximumPosition.
- /// \sa stMinimumValue, setValues, setMinimum, setMaximum, setRange
- void setMaximumValue(int max);
-
- ///
- /// Utility function that set the minimum value and maximum value at once.
- /// The slider silently forces min and max to be within the legal range:
- /// minimum() <= min <= max <= maximum().
- /// Note: Changing the minimumValue and maximumValue also changes the
- /// minimumPosition and maximumPosition.
- /// \sa setMinimumValue, setMaximumValue, setMinimum, setMaximum, setRange
- void setValues(int min, int max);
+ ///
+ /// This property holds the slider's current minimum value.
+ /// The slider silently forces min to be within the legal range:
+ /// minimum() <= min <= maximumValue() <= maximum().
+ /// Note: Changing the minimumValue also changes the minimumPosition.
+ /// \sa stMaximumValue, setValues, setMinimum, setMaximum, setRange
+ void setMinimumValue(int min);
+
+ ///
+ /// This property holds the slider's current maximum value.
+ /// The slider silently forces max to be within the legal range:
+ /// minimum() <= minimumValue() <= max <= maximum().
+ /// Note: Changing the maximumValue also changes the maximumPosition.
+ /// \sa stMinimumValue, setValues, setMinimum, setMaximum, setRange
+ void setMaximumValue(int max);
+
+ ///
+ /// Utility function that set the minimum value and maximum value at once.
+ /// The slider silently forces min and max to be within the legal range:
+ /// minimum() <= min <= max <= maximum().
+ /// Note: Changing the minimumValue and maximumValue also changes the
+ /// minimumPosition and maximumPosition.
+ /// \sa setMinimumValue, setMaximumValue, setMinimum, setMaximum, setRange
+ void setValues(int min, int max);
protected Q_SLOTS:
- void onRangeChanged(int minimum, int maximum);
+ void onRangeChanged(int minimum, int maximum);
protected:
- ctkRangeSlider( ctkRangeSliderPrivate* impl, Qt::Orientation o, QWidget* par= 0 );
- ctkRangeSlider( ctkRangeSliderPrivate* impl, QWidget* par = 0 );
+ ctkRangeSlider(ctkRangeSliderPrivate *impl, Qt::Orientation o, QWidget *par= 0);
+ ctkRangeSlider(ctkRangeSliderPrivate *impl, QWidget *par = 0);
- // Description:
- // Standard Qt UI events
- virtual void mousePressEvent(QMouseEvent* ev);
- virtual void mouseMoveEvent(QMouseEvent* ev);
- virtual void mouseReleaseEvent(QMouseEvent* ev);
+ // Description:
+ // Standard Qt UI events
+ virtual void mousePressEvent(QMouseEvent *ev);
+ virtual void mouseMoveEvent(QMouseEvent *ev);
+ virtual void mouseReleaseEvent(QMouseEvent *ev);
- // Description:
- // Rendering is done here.
- virtual void paintEvent(QPaintEvent* ev);
- virtual void initMinimumSliderStyleOption(QStyleOptionSlider* option) const;
- virtual void initMaximumSliderStyleOption(QStyleOptionSlider* option) const;
+ // Description:
+ // Rendering is done here.
+ virtual void paintEvent(QPaintEvent *ev);
+ virtual void initMinimumSliderStyleOption(QStyleOptionSlider *option) const;
+ virtual void initMaximumSliderStyleOption(QStyleOptionSlider *option) const;
- // Description:
- // Reimplemented for the tooltips
- virtual bool event(QEvent* event);
+ // Description:
+ // Reimplemented for the tooltips
+ virtual bool event(QEvent *event);
protected:
- QScopedPointer d_ptr;
+ QScopedPointer d_ptr;
private:
- Q_DECLARE_PRIVATE(ctkRangeSlider);
- Q_DISABLE_COPY(ctkRangeSlider);
+ Q_DECLARE_PRIVATE(ctkRangeSlider);
+ Q_DISABLE_COPY(ctkRangeSlider);
};
#endif
diff --git a/ui/src/dmxdumpfactory.cpp b/ui/src/dmxdumpfactory.cpp
index deaa4cc74a..d56f1aab34 100644
--- a/ui/src/dmxdumpfactory.cpp
+++ b/ui/src/dmxdumpfactory.cpp
@@ -80,7 +80,7 @@ DmxDumpFactory::DmxDumpFactory(Doc *doc, DmxDumpFactoryProperties *props, QWidge
else
m_dumpSelectedRadio->setChecked(true);
- if(m_properties->nonZeroValuesMode() == true)
+ if (m_properties->nonZeroValuesMode() == true)
m_nonZeroCheck->setChecked(true);
connect(m_sceneButton, SIGNAL(clicked(bool)),
@@ -94,7 +94,7 @@ DmxDumpFactory::~DmxDumpFactory()
void DmxDumpFactory::slotUpdateChasersTree()
{
m_addtoTree->clear();
- foreach(Function *f, m_doc->functionsByType(Function::ChaserType))
+ foreach (Function *f, m_doc->functionsByType(Function::ChaserType))
{
Chaser *chaser = qobject_cast(f);
QTreeWidgetItem *item = new QTreeWidgetItem(m_addtoTree);
@@ -136,7 +136,7 @@ void DmxDumpFactory::slotSelectSceneButtonClicked()
QByteArray chMask = m_properties->channelsMask();
chMask.fill(0);
- foreach(SceneValue scv, scene->values())
+ foreach (SceneValue scv, scene->values())
{
Fixture *fxi = m_doc->fixture(scv.fxi);
if (fxi == NULL)
diff --git a/ui/src/docbrowser.cpp b/ui/src/docbrowser.cpp
index 483e11400b..7793352d21 100644
--- a/ui/src/docbrowser.cpp
+++ b/ui/src/docbrowser.cpp
@@ -194,7 +194,7 @@ DocBrowser::~DocBrowser()
}
void DocBrowser::slotAnchorClicked(QUrl url){
- if(url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https"))
+ if (url.scheme() == QLatin1String("http") || url.scheme() == QLatin1String("https"))
{
QDesktopServices::openUrl(url);
}
diff --git a/ui/src/efxeditor.cpp b/ui/src/efxeditor.cpp
index f3c4427443..fabad0db76 100644
--- a/ui/src/efxeditor.cpp
+++ b/ui/src/efxeditor.cpp
@@ -343,7 +343,7 @@ void EFXEditor::slotTabChanged(int tab)
m_efx->setUiStateValue(UI_STATE_TAB_INDEX, tab);
//When preview animation is opened restart animation but avoid restart if test is running.
- if(tab == 1 && (m_testButton->isChecked () == false))
+ if (tab == 1 && (m_testButton->isChecked () == false))
m_previewArea->restart ();
}
@@ -615,13 +615,13 @@ void EFXEditor::slotFixtureItemChanged(QTreeWidgetItem* item, int column)
void EFXEditor::slotFixtureModeChanged(int index)
{
- QComboBox* combo = qobject_cast(QObject::sender());
+ QComboBox *combo = qobject_cast(QObject::sender());
Q_ASSERT(combo != NULL);
- EFXFixture* ef = (EFXFixture*) combo->property(PROPERTY_FIXTURE).toULongLong();
+ EFXFixture *ef = (EFXFixture*) combo->property(PROPERTY_FIXTURE).toULongLong();
Q_ASSERT(ef != NULL);
- ef->setMode ( ef->stringToMode (combo->itemText(index)) );
+ ef->setMode(ef->stringToMode (combo->itemText(index)));
// Restart the test after the latest mode change, delayed
m_testTimer.start();
@@ -629,9 +629,9 @@ void EFXEditor::slotFixtureModeChanged(int index)
void EFXEditor::slotFixtureStartOffsetChanged(int startOffset)
{
- QSpinBox* spin = qobject_cast(QObject::sender());
+ QSpinBox *spin = qobject_cast(QObject::sender());
Q_ASSERT(spin != NULL);
- EFXFixture* ef = (EFXFixture*) spin->property(PROPERTY_FIXTURE).toULongLong();
+ EFXFixture *ef = (EFXFixture*) spin->property(PROPERTY_FIXTURE).toULongLong();
Q_ASSERT(ef != NULL);
ef->setStartOffset(startOffset);
diff --git a/ui/src/efxpreviewarea.cpp b/ui/src/efxpreviewarea.cpp
index 2cd8ff7709..b1d29554ed 100644
--- a/ui/src/efxpreviewarea.cpp
+++ b/ui/src/efxpreviewarea.cpp
@@ -60,7 +60,7 @@ void EFXPreviewArea::setFixturePolygons(const QVector &fixturePoints)
m_originalFixturePoints.resize(fixturePoints.size());
m_fixturePoints.resize(fixturePoints.size());
- for(int i = 0; i < m_fixturePoints.size(); ++i)
+ for (int i = 0; i < m_fixturePoints.size(); ++i)
{
m_originalFixturePoints[i] = QPolygonF(fixturePoints[i]);
m_fixturePoints[i] = scale(m_originalFixturePoints[i], size());
diff --git a/ui/src/fixtureconsole.cpp b/ui/src/fixtureconsole.cpp
index 310240e543..22e1aad138 100644
--- a/ui/src/fixtureconsole.cpp
+++ b/ui/src/fixtureconsole.cpp
@@ -261,7 +261,7 @@ QList FixtureConsole::values() const
bool FixtureConsole::hasSelections()
{
- foreach(ConsoleChannel *cc, m_channels)
+ foreach (ConsoleChannel *cc, m_channels)
{
Q_ASSERT(cc != NULL);
if (cc->isChecked() && cc->isSelected())
diff --git a/ui/src/fixturemanager.cpp b/ui/src/fixturemanager.cpp
index 614b8db046..45ed7f9158 100644
--- a/ui/src/fixturemanager.cpp
+++ b/ui/src/fixturemanager.cpp
@@ -587,7 +587,7 @@ void FixtureManager::slotSelectionChanged()
if (uniID.isValid() == true)
uniName = m_doc->inputOutputMap()->getUniverseNameByID(uniID.toUInt());
- foreach(Fixture *fixture, m_doc->fixtures())
+ foreach (Fixture *fixture, m_doc->fixtures())
{
if (fixture == NULL || fixture->universe() != uniID.toUInt() || fixture->fixtureMode() == NULL)
continue;
@@ -629,7 +629,7 @@ void FixtureManager::slotSelectionChanged()
"