Port to QStringLiteral operator
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
|
||||
#include "busyindicator.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
class QHideEvent;
|
||||
class QShowEvent;
|
||||
|
||||
@@ -48,7 +50,7 @@ BusyIndicator::BusyIndicator(QWidget *parent)
|
||||
|
||||
void BusyIndicator::Init(const QString &text) {
|
||||
|
||||
movie_ = new QMovie(QStringLiteral(":/pictures/spinner.gif")),
|
||||
movie_ = new QMovie(u":/pictures/spinner.gif"_s),
|
||||
label_ = new QLabel;
|
||||
|
||||
QLabel *icon = new QLabel;
|
||||
|
||||
@@ -119,7 +119,7 @@ void FancyTabWidget::LoadSettings(const QString &settings_group) {
|
||||
s.beginGroup(settings_group);
|
||||
QMultiMap <int, FancyTabData*> tabs;
|
||||
for (FancyTabData *tab : std::as_const(tabs_)) {
|
||||
int idx = s.value(QStringLiteral("tab_") + tab->name(), tab->index()).toInt();
|
||||
int idx = s.value(u"tab_"_s + tab->name(), tab->index()).toInt();
|
||||
while (tabs.contains(idx)) { ++idx; }
|
||||
tabs.insert(idx, tab);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void FancyTabWidget::SaveSettings(const QString &settings_group) {
|
||||
s.setValue("current_tab", currentIndex());
|
||||
|
||||
for (FancyTabData *tab : std::as_const(tabs_)) {
|
||||
QString k = QStringLiteral("tab_") + tab->name();
|
||||
QString k = u"tab_"_s + tab->name();
|
||||
int idx = QTabWidget::indexOf(tab->page());
|
||||
if (idx < 0) {
|
||||
if (s.contains(k)) s.remove(k);
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "favoritewidget.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
namespace {
|
||||
constexpr int kStarSize = 15;
|
||||
}
|
||||
@@ -38,8 +40,8 @@ FavoriteWidget::FavoriteWidget(const int tab_index, const bool favorite, QWidget
|
||||
: QWidget(parent),
|
||||
tab_index_(tab_index),
|
||||
favorite_(favorite),
|
||||
on_(IconLoader::Load(QStringLiteral("star"))),
|
||||
off_(IconLoader::Load(QStringLiteral("star-grey"))),
|
||||
on_(IconLoader::Load(u"star"_s)),
|
||||
off_(IconLoader::Load(u"star-grey"_s)),
|
||||
rect_(0, 0, kStarSize, kStarSize) {}
|
||||
|
||||
void FavoriteWidget::SetFavorite(const bool favorite) {
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "settings/appearancesettingspage.h"
|
||||
|
||||
using std::make_unique;
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
const char *FileView::kFileFilter =
|
||||
"*.wav *.flac *.wv *.ogg *.oga *.opus *.spx *.ape *.mpc "
|
||||
@@ -66,15 +67,15 @@ FileView::FileView(QWidget *parent)
|
||||
model_(nullptr),
|
||||
undo_stack_(new QUndoStack(this)),
|
||||
task_manager_(nullptr),
|
||||
storage_(new FilesystemMusicStorage(Song::Source::LocalFile, QStringLiteral("/"))) {
|
||||
storage_(new FilesystemMusicStorage(Song::Source::LocalFile, u"/"_s)) {
|
||||
|
||||
ui_->setupUi(this);
|
||||
|
||||
// Icons
|
||||
ui_->back->setIcon(IconLoader::Load(QStringLiteral("go-previous")));
|
||||
ui_->forward->setIcon(IconLoader::Load(QStringLiteral("go-next")));
|
||||
ui_->home->setIcon(IconLoader::Load(QStringLiteral("go-home")));
|
||||
ui_->up->setIcon(IconLoader::Load(QStringLiteral("go-up")));
|
||||
ui_->back->setIcon(IconLoader::Load(u"go-previous"_s));
|
||||
ui_->forward->setIcon(IconLoader::Load(u"go-next"_s));
|
||||
ui_->home->setIcon(IconLoader::Load(u"go-home"_s));
|
||||
ui_->up->setIcon(IconLoader::Load(u"go-up"_s));
|
||||
|
||||
QObject::connect(ui_->back, &QToolButton::clicked, undo_stack_, &QUndoStack::undo);
|
||||
QObject::connect(ui_->forward, &QToolButton::clicked, undo_stack_, &QUndoStack::redo);
|
||||
@@ -216,6 +217,7 @@ FileView::UndoCommand::UndoCommand(FileView *view, const QString &new_path) : vi
|
||||
old_state_.index = view_->ui_->list->currentIndex();
|
||||
|
||||
new_state_.path = new_path;
|
||||
|
||||
}
|
||||
|
||||
void FileView::UndoCommand::redo() {
|
||||
|
||||
@@ -36,22 +36,24 @@
|
||||
#include "utilities/filemanagerutils.h"
|
||||
#include "fileviewlist.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
FileViewList::FileViewList(QWidget *parent)
|
||||
: QListView(parent),
|
||||
menu_(new QMenu(this)) {
|
||||
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("media-playback-start")), tr("Append to current playlist"), this, &FileViewList::AddToPlaylistSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("media-playback-start")), tr("Replace current playlist"), this, &FileViewList::LoadSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("document-new")), tr("Open in new playlist"), this, &FileViewList::OpenInNewPlaylistSlot);
|
||||
menu_->addAction(IconLoader::Load(u"media-playback-start"_s), tr("Append to current playlist"), this, &FileViewList::AddToPlaylistSlot);
|
||||
menu_->addAction(IconLoader::Load(u"media-playback-start"_s), tr("Replace current playlist"), this, &FileViewList::LoadSlot);
|
||||
menu_->addAction(IconLoader::Load(u"document-new"_s), tr("Open in new playlist"), this, &FileViewList::OpenInNewPlaylistSlot);
|
||||
menu_->addSeparator();
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("edit-copy")), tr("Copy to collection..."), this, &FileViewList::CopyToCollectionSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("go-jump")), tr("Move to collection..."), this, &FileViewList::MoveToCollectionSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("device")), tr("Copy to device..."), this, &FileViewList::CopyToDeviceSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("edit-delete")), tr("Delete from disk..."), this, &FileViewList::DeleteSlot);
|
||||
menu_->addAction(IconLoader::Load(u"edit-copy"_s), tr("Copy to collection..."), this, &FileViewList::CopyToCollectionSlot);
|
||||
menu_->addAction(IconLoader::Load(u"go-jump"_s), tr("Move to collection..."), this, &FileViewList::MoveToCollectionSlot);
|
||||
menu_->addAction(IconLoader::Load(u"device"_s), tr("Copy to device..."), this, &FileViewList::CopyToDeviceSlot);
|
||||
menu_->addAction(IconLoader::Load(u"edit-delete"_s), tr("Delete from disk..."), this, &FileViewList::DeleteSlot);
|
||||
|
||||
menu_->addSeparator();
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("edit-rename")), tr("Edit track information..."), this, &FileViewList::EditTagsSlot);
|
||||
menu_->addAction(IconLoader::Load(QStringLiteral("document-open-folder")), tr("Show in file browser..."), this, &FileViewList::ShowInBrowser);
|
||||
menu_->addAction(IconLoader::Load(u"edit-rename"_s), tr("Edit track information..."), this, &FileViewList::EditTagsSlot);
|
||||
menu_->addAction(IconLoader::Load(u"document-open-folder"_s), tr("Show in file browser..."), this, &FileViewList::ShowInBrowser);
|
||||
|
||||
setAttribute(Qt::WA_MacShowFocusRect, false);
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
#include "utilities/strutils.h"
|
||||
#include "freespacebar.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
class QPaintEvent;
|
||||
|
||||
namespace {
|
||||
@@ -239,7 +241,7 @@ QString FreeSpaceBar::TextForSize(const QString &prefix, const quint64 size) {
|
||||
ret = Utilities::PrettySize(size);
|
||||
}
|
||||
else {
|
||||
ret = QStringLiteral("0 MB");
|
||||
ret = u"0 MB"_s;
|
||||
}
|
||||
|
||||
if (!prefix.isEmpty()) ret.prepend(prefix + QLatin1Char(' '));
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
#include "core/multisortfilterproxy.h"
|
||||
#include "groupediconview.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
namespace {
|
||||
constexpr int kBarThickness = 2;
|
||||
constexpr int kBarMarginTop = 3;
|
||||
@@ -59,7 +61,7 @@ GroupedIconView::GroupedIconView(QWidget *parent)
|
||||
header_spacing_(10),
|
||||
header_indent_(5),
|
||||
item_indent_(10),
|
||||
header_text_(QStringLiteral("%1")) {
|
||||
header_text_(u"%1"_s) {
|
||||
|
||||
setFlow(LeftToRight);
|
||||
setViewMode(IconMode);
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
#include "core/iconloader.h"
|
||||
#include "lineedit.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
ExtendedEditor::ExtendedEditor(QWidget *widget, int extra_right_padding, bool draw_hint)
|
||||
: LineEditInterface(widget),
|
||||
has_clear_button_(true),
|
||||
@@ -51,10 +53,10 @@ ExtendedEditor::ExtendedEditor(QWidget *widget, int extra_right_padding, bool dr
|
||||
font_point_size_(widget->font().pointSizeF() - 1),
|
||||
is_rtl_(false) {
|
||||
|
||||
clear_button_->setIcon(IconLoader::Load(QStringLiteral("edit-clear-locationbar-ltr")));
|
||||
clear_button_->setIcon(IconLoader::Load(u"edit-clear-locationbar-ltr"_s));
|
||||
clear_button_->setIconSize(QSize(16, 16));
|
||||
clear_button_->setCursor(Qt::ArrowCursor);
|
||||
clear_button_->setStyleSheet(QStringLiteral("QToolButton { border: none; padding: 0px; }"));
|
||||
clear_button_->setStyleSheet(u"QToolButton { border: none; padding: 0px; }"_s);
|
||||
clear_button_->setToolTip(QWidget::tr("Clear"));
|
||||
clear_button_->setFocusPolicy(Qt::NoFocus);
|
||||
|
||||
@@ -64,7 +66,7 @@ ExtendedEditor::ExtendedEditor(QWidget *widget, int extra_right_padding, bool dr
|
||||
reset_button_->setIcon(widget->style()->standardIcon(QStyle::SP_DialogResetButton, &opt, widget));
|
||||
reset_button_->setIconSize(QSize(16, 16));
|
||||
reset_button_->setCursor(Qt::ArrowCursor);
|
||||
reset_button_->setStyleSheet(QStringLiteral("QToolButton { border: none; padding: 0px; }"));
|
||||
reset_button_->setStyleSheet(u"QToolButton { border: none; padding: 0px; }"_s);
|
||||
reset_button_->setToolTip(QWidget::tr("Reset"));
|
||||
reset_button_->setFocusPolicy(Qt::NoFocus);
|
||||
reset_button_->hide();
|
||||
@@ -251,7 +253,7 @@ void CheckBox::resizeEvent(QResizeEvent *e) {
|
||||
QString SpinBox::textFromValue(int val) const {
|
||||
|
||||
if (val <= 0 && !hint_.isEmpty()) {
|
||||
return QStringLiteral("-");
|
||||
return u"-"_s;
|
||||
}
|
||||
return QSpinBox::textFromValue(val);
|
||||
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "linetextedit.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
LineTextEdit::LineTextEdit(QWidget *parent) : QTextEdit(parent) {
|
||||
|
||||
setWordWrapMode(QTextOption::NoWrap);
|
||||
@@ -45,7 +47,7 @@ QSize LineTextEdit::sizeHint() const {
|
||||
|
||||
static const int kMargin = 5;
|
||||
int h = 2 * kMargin + qMax(fm.height(), 14);
|
||||
int w = 2 * kMargin + fm.horizontalAdvance(QStringLiteral("W")) * 15;
|
||||
int w = 2 * kMargin + fm.horizontalAdvance(u"W"_s) * 15;
|
||||
|
||||
return QSize(w, h);
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
LoginStateWidget::LoginStateWidget(QWidget *parent)
|
||||
: QWidget(parent),
|
||||
ui_(new Ui_LoginStateWidget),
|
||||
@@ -44,10 +46,10 @@ LoginStateWidget::LoginStateWidget(QWidget *parent)
|
||||
ui_->account_type->hide();
|
||||
ui_->busy->hide();
|
||||
|
||||
ui_->sign_out->setIcon(IconLoader::Load(QStringLiteral("list-remove")));
|
||||
ui_->signed_in_icon_label->setPixmap(IconLoader::Load(QStringLiteral("dialog-ok-apply")).pixmap(22));
|
||||
ui_->expires_icon_label->setPixmap(IconLoader::Load(QStringLiteral("dialog-password")).pixmap(22));
|
||||
ui_->account_type_icon_label->setPixmap(IconLoader::Load(QStringLiteral("dialog-warning")).pixmap(22));
|
||||
ui_->sign_out->setIcon(IconLoader::Load(u"list-remove"_s));
|
||||
ui_->signed_in_icon_label->setPixmap(IconLoader::Load(u"dialog-ok-apply"_s).pixmap(22));
|
||||
ui_->expires_icon_label->setPixmap(IconLoader::Load(u"dialog-password"_s).pixmap(22));
|
||||
ui_->account_type_icon_label->setPixmap(IconLoader::Load(u"dialog-warning"_s).pixmap(22));
|
||||
|
||||
QFont bold_font(font());
|
||||
bold_font.setBold(true);
|
||||
@@ -81,8 +83,8 @@ void LoginStateWidget::SetLoggedIn(const State state, const QString &account_nam
|
||||
ui_->signed_out->setVisible(state != State::LoggedIn);
|
||||
ui_->busy->setVisible(state == State::LoginInProgress);
|
||||
|
||||
if (account_name.isEmpty()) ui_->signed_in_label->setText(QStringLiteral("<b>") + tr("You are signed in.") + QStringLiteral("</b>"));
|
||||
else ui_->signed_in_label->setText(tr("You are signed in as %1.").arg(QStringLiteral("<b>") + account_name + QStringLiteral("</b>")));
|
||||
if (account_name.isEmpty()) ui_->signed_in_label->setText(u"<b>"_s + tr("You are signed in.") + u"</b>"_s);
|
||||
else ui_->signed_in_label->setText(tr("You are signed in as %1.").arg(u"<b>"_s + account_name + u"</b>"_s));
|
||||
|
||||
for (QWidget *widget : std::as_const(credential_groups_)) {
|
||||
widget->setVisible(state != State::LoggedIn);
|
||||
@@ -153,7 +155,7 @@ void LoginStateWidget::SetExpires(const QDate expires) {
|
||||
|
||||
if (expires.isValid()) {
|
||||
const QString expires_text = QLocale().toString(expires, QLocale::LongFormat);
|
||||
ui_->expires_label->setText(tr("Expires on %1").arg(QStringLiteral("<b>") + expires_text + QStringLiteral("</b>")));
|
||||
ui_->expires_label->setText(tr("Expires on %1").arg(u"<b>"_s + expires_text + u"</b>"_s));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ PlayingWidget::PlayingWidget(QWidget *parent)
|
||||
details_->setUndoRedoEnabled(false);
|
||||
// add placeholder text to get the correct height
|
||||
if (mode_ == Mode::LargeSongDetails) {
|
||||
details_->setDefaultStyleSheet(QStringLiteral("p { font-size: small; font-weight: bold; }"));
|
||||
details_->setHtml(QStringLiteral("<p align=center><i></i><br/><br/></p>"));
|
||||
details_->setDefaultStyleSheet(u"p { font-size: small; font-weight: bold; }"_s);
|
||||
details_->setHtml(u"<p align=center><i></i><br/><br/></p>"_s);
|
||||
}
|
||||
|
||||
UpdateHeight();
|
||||
@@ -404,7 +404,7 @@ void PlayingWidget::UpdateHeight() {
|
||||
void PlayingWidget::UpdateDetailsText() {
|
||||
|
||||
QString html;
|
||||
details_->setDefaultStyleSheet(QStringLiteral("p { font-size: small; font-weight: bold; }"));
|
||||
details_->setDefaultStyleSheet(u"p { font-size: small; font-weight: bold; }"_s);
|
||||
switch (mode_) {
|
||||
case Mode::SmallSongDetails:
|
||||
details_->setTextWidth(-1);
|
||||
@@ -549,7 +549,7 @@ void PlayingWidget::SearchCoverInProgress() {
|
||||
downloading_covers_ = true;
|
||||
|
||||
// Show a spinner animation
|
||||
spinner_animation_ = make_unique<QMovie>(QStringLiteral(":/pictures/spinner.gif"), QByteArray(), this);
|
||||
spinner_animation_ = make_unique<QMovie>(u":/pictures/spinner.gif"_s, QByteArray(), this);
|
||||
QObject::connect(&*spinner_animation_, &QMovie::updated, this, &PlayingWidget::Update);
|
||||
spinner_animation_->start();
|
||||
update();
|
||||
|
||||
@@ -29,13 +29,15 @@
|
||||
#include <QPainter>
|
||||
#include <QMouseEvent>
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
RatingPainter::RatingPainter() {
|
||||
|
||||
// Load the base pixmaps
|
||||
QIcon star_on(QStringLiteral(":/pictures/star-on.png"));
|
||||
QIcon star_on(u":/pictures/star-on.png"_s);
|
||||
QList<QSize> star_on_sizes = star_on.availableSizes();
|
||||
QPixmap on(star_on.pixmap(star_on_sizes.last()));
|
||||
QIcon star_off(QStringLiteral(":/pictures/star-off.png"));
|
||||
QIcon star_off(u":/pictures/star-off.png"_s);
|
||||
QList<QSize> star_off_sizes = star_off.availableSizes();
|
||||
QPixmap off(star_off.pixmap(star_off_sizes.last()));
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ THE SOFTWARE.
|
||||
|
||||
#include "core/iconloader.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
SearchField::SearchField(QWidget *parent) : QWidget(parent) {
|
||||
|
||||
QLineEdit *lineEdit = new QLineEdit(this);
|
||||
@@ -47,11 +49,11 @@ SearchField::SearchField(QWidget *parent) : QWidget(parent) {
|
||||
QObject::connect(lineEdit, &QLineEdit::textChanged, this, &SearchField::setText);
|
||||
|
||||
QPushButton *clearbutton = new QPushButton(this);
|
||||
QIcon clearIcon(IconLoader::Load(QStringLiteral("edit-clear-locationbar-ltr")));
|
||||
QIcon clearIcon(IconLoader::Load(u"edit-clear-locationbar-ltr"_s));
|
||||
|
||||
clearbutton->setIcon(clearIcon);
|
||||
clearbutton->setIconSize(QSize(20, 20));
|
||||
clearbutton->setStyleSheet(QStringLiteral("border: none; padding: 2px;"));
|
||||
clearbutton->setStyleSheet(u"border: none; padding: 2px;"_s);
|
||||
clearbutton->resize(clearbutton->sizeHint());
|
||||
|
||||
QObject::connect(clearbutton, &QPushButton::clicked, this, &SearchField::clear);
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
# include "moodbar/moodbarproxystyle.h"
|
||||
#endif
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
namespace {
|
||||
constexpr char kSettingsGroup[] = "MainWindow";
|
||||
}
|
||||
@@ -97,8 +99,8 @@ void TrackSlider::SetApplication(Application *app) {
|
||||
void TrackSlider::UpdateLabelWidth() {
|
||||
|
||||
// We set the label's minimum size, so it won't resize itself when the user is dragging the slider.
|
||||
UpdateLabelWidth(ui_->elapsed, QStringLiteral("0:00:00"));
|
||||
UpdateLabelWidth(ui_->remaining, QStringLiteral("-0:00:00"));
|
||||
UpdateLabelWidth(ui_->elapsed, u"0:00:00"_s);
|
||||
UpdateLabelWidth(ui_->remaining, u"-0:00:00"_s);
|
||||
|
||||
}
|
||||
|
||||
@@ -161,8 +163,8 @@ void TrackSlider::UpdateTimes(const int elapsed) {
|
||||
void TrackSlider::SetStopped() {
|
||||
|
||||
setEnabled(false);
|
||||
ui_->elapsed->setText(QStringLiteral("0:00:00"));
|
||||
ui_->remaining->setText(QStringLiteral("0:00:00"));
|
||||
ui_->elapsed->setText(u"0:00:00"_s);
|
||||
ui_->remaining->setText(u"0:00:00"_s);
|
||||
|
||||
setting_value_ = true;
|
||||
ui_->slider->setValue(0);
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
#include "volumeslider.h"
|
||||
|
||||
using namespace Qt::Literals::StringLiterals;
|
||||
|
||||
VolumeSlider::VolumeSlider(QWidget *parent, const uint max)
|
||||
: SliderSlider(Qt::Horizontal, parent, static_cast<int>(max)),
|
||||
wheel_accumulator_(0),
|
||||
@@ -131,7 +133,7 @@ void VolumeSlider::paintEvent(QPaintEvent *e) {
|
||||
|
||||
void VolumeSlider::generateGradient() {
|
||||
|
||||
const QImage mask(QStringLiteral(":/pictures/volumeslider-gradient.png"));
|
||||
const QImage mask(u":/pictures/volumeslider-gradient.png"_s);
|
||||
|
||||
QImage gradient_image(mask.size(), QImage::Format_ARGB32_Premultiplied);
|
||||
QPainter p(&gradient_image);
|
||||
@@ -194,8 +196,8 @@ QPixmap VolumeSlider::drawVolumePixmap() const {
|
||||
|
||||
void VolumeSlider::drawVolumeSliderHandle() {
|
||||
|
||||
QImage pixmapHandle(QStringLiteral(":/pictures/volumeslider-handle.png"));
|
||||
QImage pixmapHandleGlow(QStringLiteral(":/pictures/volumeslider-handle_glow.png"));
|
||||
QImage pixmapHandle(u":/pictures/volumeslider-handle.png"_s);
|
||||
QImage pixmapHandleGlow(u":/pictures/volumeslider-handle_glow.png"_s);
|
||||
|
||||
QImage pixmapHandleGlow_image(pixmapHandleGlow.size(), QImage::Format_ARGB32_Premultiplied);
|
||||
QPainter painter(&pixmapHandleGlow_image);
|
||||
@@ -259,13 +261,13 @@ void VolumeSlider::contextMenuEvent(QContextMenuEvent *e) {
|
||||
|
||||
QHash<QAction*, int> values;
|
||||
QMenu menu;
|
||||
menu.setTitle(QStringLiteral("Volume"));
|
||||
values[menu.addAction(QStringLiteral("100%"))] = 100;
|
||||
values[menu.addAction(QStringLiteral("80%"))] = 80;
|
||||
values[menu.addAction(QStringLiteral("60%"))] = 60;
|
||||
values[menu.addAction(QStringLiteral("40%"))] = 40;
|
||||
values[menu.addAction(QStringLiteral("20%"))] = 20;
|
||||
values[menu.addAction(QStringLiteral("0%"))] = 0;
|
||||
menu.setTitle(u"Volume"_s);
|
||||
values[menu.addAction(u"100%"_s)] = 100;
|
||||
values[menu.addAction(u"80%"_s)] = 80;
|
||||
values[menu.addAction(u"60%"_s)] = 60;
|
||||
values[menu.addAction(u"40%"_s)] = 40;
|
||||
values[menu.addAction(u"20%"_s)] = 20;
|
||||
values[menu.addAction(u"0%"_s)] = 0;
|
||||
|
||||
QAction *ret = menu.exec(mapToGlobal(e->pos()));
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user