Merge "Don't use deprecated Qt5 functions" (#5156)
This commit is contained in:
@@ -11,8 +11,6 @@ matrix:
|
||||
include:
|
||||
- env: TYPE=style
|
||||
- os: linux
|
||||
- env: TARGET_OS=win32
|
||||
- env: TARGET_OS=win64
|
||||
- env: TARGET_OS=debian-sid TARGET_DEPLOY=True
|
||||
git:
|
||||
depth: false
|
||||
|
||||
@@ -144,7 +144,7 @@ CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)
|
||||
|
||||
LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
FIND_PACKAGE(Qt5 COMPONENTS Core Gui Widgets Xml REQUIRED)
|
||||
FIND_PACKAGE(Qt5 5.6.0 COMPONENTS Core Gui Widgets Xml REQUIRED)
|
||||
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
|
||||
@@ -46,7 +46,6 @@ class QPixmap;
|
||||
class QScrollBar;
|
||||
class QString;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class ComboBox;
|
||||
class NotePlayHandle;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
#include <QWidget>
|
||||
#include <QSignalMapper>
|
||||
#include <QColor>
|
||||
#include <QMimeData>
|
||||
|
||||
|
||||
@@ -366,7 +366,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setRenderHints( QPainter::Antialiasing, false );
|
||||
p.resetMatrix();
|
||||
p.resetTransform();
|
||||
|
||||
// bar lines
|
||||
const int lineSize = 3;
|
||||
|
||||
@@ -47,7 +47,7 @@ FileDialog::FileDialog( QWidget *parent, const QString &caption,
|
||||
// Find downloads directory
|
||||
QDir downloadDir( QDir::homePath() + "/Downloads" );
|
||||
if ( ! downloadDir.exists() )
|
||||
downloadDir = QStandardPaths::writableLocation( QStandardPaths::DownloadLocation );
|
||||
downloadDir.setPath(QStandardPaths::writableLocation( QStandardPaths::DownloadLocation ));
|
||||
if ( downloadDir.exists() )
|
||||
urls << QUrl::fromLocalFile( downloadDir.absolutePath() );
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <QPointer>
|
||||
#include <QScrollBar>
|
||||
#include <QStyleOption>
|
||||
#include <QSignalMapper>
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
@@ -204,20 +203,15 @@ PianoRoll::PianoRoll() :
|
||||
m_nemStr.push_back( tr( "Note Velocity" ) );
|
||||
m_nemStr.push_back( tr( "Note Panning" ) );
|
||||
|
||||
QSignalMapper * signalMapper = new QSignalMapper( this );
|
||||
m_noteEditMenu = new QMenu( this );
|
||||
m_noteEditMenu->clear();
|
||||
for( int i = 0; i < m_nemStr.size(); ++i )
|
||||
{
|
||||
QAction * act = new QAction( m_nemStr.at(i), this );
|
||||
connect( act, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
signalMapper->setMapping( act, i );
|
||||
connect( act, &QAction::triggered, [this, i](){ changeNoteEditMode(i); } );
|
||||
m_noteEditMenu->addAction( act );
|
||||
}
|
||||
connect( signalMapper, SIGNAL(mapped(int)),
|
||||
this, SLOT(changeNoteEditMode(int)) );
|
||||
|
||||
signalMapper = new QSignalMapper( this );
|
||||
m_semiToneMarkerMenu = new QMenu( this );
|
||||
|
||||
QAction* markSemitoneAction = new QAction( tr("Mark/unmark current semitone"), this );
|
||||
@@ -227,19 +221,12 @@ PianoRoll::PianoRoll() :
|
||||
QAction* unmarkAllAction = new QAction( tr("Unmark all"), this );
|
||||
QAction* copyAllNotesAction = new QAction( tr("Select all notes on this key"), this);
|
||||
|
||||
connect( markSemitoneAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
connect( markAllOctaveSemitonesAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
connect( markScaleAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
connect( markChordAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
connect( unmarkAllAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
connect( copyAllNotesAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
|
||||
|
||||
signalMapper->setMapping( markSemitoneAction, static_cast<int>( stmaMarkCurrentSemiTone ) );
|
||||
signalMapper->setMapping( markAllOctaveSemitonesAction, static_cast<int>( stmaMarkAllOctaveSemiTones ) );
|
||||
signalMapper->setMapping( markScaleAction, static_cast<int>( stmaMarkCurrentScale ) );
|
||||
signalMapper->setMapping( markChordAction, static_cast<int>( stmaMarkCurrentChord ) );
|
||||
signalMapper->setMapping( unmarkAllAction, static_cast<int>( stmaUnmarkAll ) );
|
||||
signalMapper->setMapping( copyAllNotesAction, static_cast<int>( stmaCopyAllNotesOnKey ) );
|
||||
connect( markSemitoneAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkCurrentSemiTone); });
|
||||
connect( markAllOctaveSemitonesAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkAllOctaveSemiTones); });
|
||||
connect( markScaleAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkCurrentScale); });
|
||||
connect( markChordAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkCurrentChord); });
|
||||
connect( unmarkAllAction, &QAction::triggered, [this](){ markSemiTone(stmaUnmarkAll); });
|
||||
connect( copyAllNotesAction, &QAction::triggered, [this](){ markSemiTone(stmaCopyAllNotesOnKey); });
|
||||
|
||||
markScaleAction->setEnabled( false );
|
||||
markChordAction->setEnabled( false );
|
||||
@@ -247,8 +234,6 @@ PianoRoll::PianoRoll() :
|
||||
connect( this, SIGNAL(semiToneMarkerMenuScaleSetEnabled(bool)), markScaleAction, SLOT(setEnabled(bool)) );
|
||||
connect( this, SIGNAL(semiToneMarkerMenuChordSetEnabled(bool)), markChordAction, SLOT(setEnabled(bool)) );
|
||||
|
||||
connect( signalMapper, SIGNAL(mapped(int)), this, SLOT(markSemiTone(int)) );
|
||||
|
||||
m_semiToneMarkerMenu->addAction( markSemitoneAction );
|
||||
m_semiToneMarkerMenu->addAction( markAllOctaveSemitonesAction );
|
||||
m_semiToneMarkerMenu->addAction( markScaleAction );
|
||||
|
||||
@@ -90,7 +90,7 @@ void GroupBox::paintEvent( QPaintEvent * pe )
|
||||
p.fillRect( 0, 0, width() - 1, height() - 1, p.background() );
|
||||
|
||||
// outer rect
|
||||
p.setPen( p.background().color().dark( 150 ) );
|
||||
p.setPen( p.background().color().darker( 150 ) );
|
||||
p.drawRect( 0, 0, width() - 1, height() - 1 );
|
||||
|
||||
// draw line below titlebar
|
||||
|
||||
@@ -218,8 +218,8 @@ void BBTCOView::paintEvent( QPaintEvent * )
|
||||
: ( m_bbTCO->m_useStyleColor ? painter.background().color()
|
||||
: m_bbTCO->colorObj() ) );
|
||||
|
||||
lingrad.setColorAt( 0, c.light( 130 ) );
|
||||
lingrad.setColorAt( 1, c.light( 70 ) );
|
||||
lingrad.setColorAt( 0, c.lighter( 130 ) );
|
||||
lingrad.setColorAt( 1, c.lighter( 70 ) );
|
||||
|
||||
// paint a black rectangle under the pattern to prevent glitches with transparent backgrounds
|
||||
p.fillRect( rect(), QColor( 0, 0, 0 ) );
|
||||
|
||||
@@ -1239,6 +1239,7 @@ void InstrumentTrackView::muteChanged()
|
||||
|
||||
|
||||
|
||||
//FIXME: This is identical to SampleTrackView::createFxMenu
|
||||
QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
{
|
||||
int channelIndex = model()->effectChannelModel()->value();
|
||||
@@ -1253,8 +1254,6 @@ QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
QMenu *fxMenu = new QMenu( title );
|
||||
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(fxMenu);
|
||||
|
||||
fxMenu->addAction( newFxLabel, this, SLOT( createFxLine() ) );
|
||||
fxMenu->addSeparator();
|
||||
|
||||
@@ -1264,14 +1263,14 @@ QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
if ( currentChannel != fxChannel )
|
||||
{
|
||||
auto index = currentChannel->m_channelIndex;
|
||||
QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name );
|
||||
QAction * action = fxMenu->addAction( label, fxMenuSignalMapper, SLOT( map() ) );
|
||||
fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex);
|
||||
fxMenu->addAction(label, [this, index](){
|
||||
assignFxLine(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
|
||||
return fxMenu;
|
||||
}
|
||||
|
||||
|
||||
@@ -847,6 +847,7 @@ SampleTrackView::~SampleTrackView()
|
||||
|
||||
|
||||
|
||||
//FIXME: This is identical to InstrumentTrackView::createFxMenu
|
||||
QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
{
|
||||
int channelIndex = model()->effectChannelModel()->value();
|
||||
@@ -861,8 +862,6 @@ QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
QMenu *fxMenu = new QMenu(title);
|
||||
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(fxMenu);
|
||||
|
||||
fxMenu->addAction(newFxLabel, this, SLOT(createFxLine()));
|
||||
fxMenu->addSeparator();
|
||||
|
||||
@@ -872,14 +871,14 @@ QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
if (currentChannel != fxChannel)
|
||||
{
|
||||
const auto index = currentChannel->m_channelIndex;
|
||||
QString label = tr("FX %1: %2").arg(currentChannel->m_channelIndex).arg(currentChannel->m_name);
|
||||
QAction * action = fxMenu->addAction(label, fxMenuSignalMapper, SLOT(map()));
|
||||
fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex);
|
||||
fxMenu->addAction(label, [this, index](){
|
||||
assignFxLine(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
|
||||
return fxMenu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user