forked from qt-creator/qt-creator
ImageView: Modernize
modernize-* Change-Id: I7fcffa4b455355cbcdc91f7e671e0a88f1091042 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -88,18 +88,18 @@ ExportDialog::ExportDialog(QWidget *parent)
|
|||||||
, m_heightSpinBox(new QSpinBox(this))
|
, m_heightSpinBox(new QSpinBox(this))
|
||||||
, m_aspectRatio(1)
|
, m_aspectRatio(1)
|
||||||
{
|
{
|
||||||
typedef void (QSpinBox::*QSpinBoxIntSignal)(int);
|
using QSpinBoxIntSignal = void (QSpinBox::*)(int);
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout(this);
|
auto formLayout = new QFormLayout(this);
|
||||||
|
|
||||||
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
|
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
|
||||||
m_pathChooser->setExpectedKind(Utils::PathChooser::SaveFile);
|
m_pathChooser->setExpectedKind(Utils::PathChooser::SaveFile);
|
||||||
m_pathChooser->setPromptDialogFilter(imageNameFilterString());
|
m_pathChooser->setPromptDialogFilter(imageNameFilterString());
|
||||||
formLayout->addRow(tr("File:"), m_pathChooser);
|
formLayout->addRow(tr("File:"), m_pathChooser);
|
||||||
|
|
||||||
QHBoxLayout *sizeLayout = new QHBoxLayout;
|
auto sizeLayout = new QHBoxLayout;
|
||||||
m_widthSpinBox->setMinimum(exportMinimumSize);
|
m_widthSpinBox->setMinimum(exportMinimumSize);
|
||||||
m_widthSpinBox->setMaximum(exportMaximumSize);
|
m_widthSpinBox->setMaximum(exportMaximumSize);
|
||||||
connect(m_widthSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
connect(m_widthSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
||||||
@@ -112,14 +112,14 @@ ExportDialog::ExportDialog(QWidget *parent)
|
|||||||
connect(m_heightSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
connect(m_heightSpinBox, static_cast<QSpinBoxIntSignal>(&QSpinBox::valueChanged),
|
||||||
this, &ExportDialog::exportHeightChanged);
|
this, &ExportDialog::exportHeightChanged);
|
||||||
sizeLayout->addWidget(m_heightSpinBox);
|
sizeLayout->addWidget(m_heightSpinBox);
|
||||||
QToolButton *resetButton = new QToolButton(this);
|
auto resetButton = new QToolButton(this);
|
||||||
resetButton->setIcon(QIcon(QStringLiteral(":/qt-project.org/styles/commonstyle/images/refresh-32.png")));
|
resetButton->setIcon(QIcon(QStringLiteral(":/qt-project.org/styles/commonstyle/images/refresh-32.png")));
|
||||||
sizeLayout->addWidget(resetButton);
|
sizeLayout->addWidget(resetButton);
|
||||||
sizeLayout->addStretch();
|
sizeLayout->addStretch();
|
||||||
connect(resetButton, &QAbstractButton::clicked, this, &ExportDialog::resetExportSize);
|
connect(resetButton, &QAbstractButton::clicked, this, &ExportDialog::resetExportSize);
|
||||||
formLayout->addRow(tr("Size:"), sizeLayout);
|
formLayout->addRow(tr("Size:"), sizeLayout);
|
||||||
|
|
||||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
|
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
|
||||||
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
|
||||||
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||||
formLayout->addRow(buttonBox);
|
formLayout->addRow(buttonBox);
|
||||||
@@ -143,7 +143,7 @@ void ExportDialog::accept()
|
|||||||
|
|
||||||
QSize ExportDialog::exportSize() const
|
QSize ExportDialog::exportSize() const
|
||||||
{
|
{
|
||||||
return QSize(m_widthSpinBox->value(), m_heightSpinBox->value());
|
return {m_widthSpinBox->value(), m_heightSpinBox->value()};
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExportDialog::setExportSize(const QSize &size)
|
void ExportDialog::setExportSize(const QSize &size)
|
||||||
|
|||||||
@@ -107,9 +107,7 @@ ImageView::ImageView(ImageViewerFile *file)
|
|||||||
setBackgroundBrush(tilePixmap);
|
setBackgroundBrush(tilePixmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageView::~ImageView()
|
ImageView::~ImageView() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void ImageView::reset()
|
void ImageView::reset()
|
||||||
{
|
{
|
||||||
@@ -164,7 +162,7 @@ QImage ImageView::renderSvg(const QSize &imageSize) const
|
|||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin(&image);
|
painter.begin(&image);
|
||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
QGraphicsSvgItem *svgItem = qgraphicsitem_cast<QGraphicsSvgItem *>(m_imageItem);
|
auto svgItem = qgraphicsitem_cast<QGraphicsSvgItem *>(m_imageItem);
|
||||||
QTC_ASSERT(svgItem, return image);
|
QTC_ASSERT(svgItem, return image);
|
||||||
svgItem->renderer()->render(&painter, QRectF(QPointF(), QSizeF(imageSize)));
|
svgItem->renderer()->render(&painter, QRectF(QPointF(), QSizeF(imageSize)));
|
||||||
#endif
|
#endif
|
||||||
@@ -209,7 +207,7 @@ QSize ImageView::svgSize() const
|
|||||||
void ImageView::exportImage()
|
void ImageView::exportImage()
|
||||||
{
|
{
|
||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
QGraphicsSvgItem *svgItem = qgraphicsitem_cast<QGraphicsSvgItem *>(m_imageItem);
|
auto svgItem = qgraphicsitem_cast<QGraphicsSvgItem *>(m_imageItem);
|
||||||
QTC_ASSERT(svgItem, return);
|
QTC_ASSERT(svgItem, return);
|
||||||
|
|
||||||
const QFileInfo origFi = m_file->filePath().toFileInfo();
|
const QFileInfo origFi = m_file->filePath().toFileInfo();
|
||||||
@@ -280,7 +278,7 @@ void ImageView::doScale(qreal factor)
|
|||||||
|
|
||||||
scale(actualFactor, actualFactor);
|
scale(actualFactor, actualFactor);
|
||||||
emitScaleFactor();
|
emitScaleFactor();
|
||||||
if (QGraphicsPixmapItem *pixmapItem = dynamic_cast<QGraphicsPixmapItem *>(m_imageItem))
|
if (auto pixmapItem = dynamic_cast<QGraphicsPixmapItem *>(m_imageItem))
|
||||||
pixmapItem->setTransformationMode(
|
pixmapItem->setTransformationMode(
|
||||||
transform().m11() < 1 ? Qt::SmoothTransformation : Qt::FastTransformation);
|
transform().m11() < 1 ? Qt::SmoothTransformation : Qt::FastTransformation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ImageView : public QGraphicsView
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ImageView(ImageViewerFile *file);
|
ImageView(ImageViewerFile *file);
|
||||||
~ImageView();
|
~ImageView() override;
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
void createScene();
|
void createScene();
|
||||||
@@ -95,15 +95,15 @@ private:
|
|||||||
QImage renderSvg(const QSize &imageSize) const;
|
QImage renderSvg(const QSize &imageSize) const;
|
||||||
bool exportSvg(const ExportData &ed);
|
bool exportSvg(const ExportData &ed);
|
||||||
|
|
||||||
void drawBackground(QPainter *p, const QRectF &rect);
|
void drawBackground(QPainter *p, const QRectF &rect) override;
|
||||||
void hideEvent(QHideEvent *event);
|
void hideEvent(QHideEvent *event) override;
|
||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event) override;
|
||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event) override;
|
||||||
|
|
||||||
ImageViewerFile *m_file;
|
ImageViewerFile *m_file;
|
||||||
QGraphicsItem *m_imageItem = 0;
|
QGraphicsItem *m_imageItem = nullptr;
|
||||||
QGraphicsRectItem *m_backgroundItem = 0;
|
QGraphicsRectItem *m_backgroundItem = nullptr;
|
||||||
QGraphicsRectItem *m_outlineItem = 0;
|
QGraphicsRectItem *m_outlineItem = nullptr;
|
||||||
bool m_showBackground = false;
|
bool m_showBackground = false;
|
||||||
bool m_showOutline = true;
|
bool m_showOutline = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class ImageViewer : public Core::IEditor
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ImageViewer(QWidget *parent = 0);
|
explicit ImageViewer(QWidget *parent = nullptr);
|
||||||
~ImageViewer() override;
|
~ImageViewer() override;
|
||||||
|
|
||||||
Core::IDocument *document() const override;
|
Core::IDocument *document() const override;
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
void togglePlay();
|
void togglePlay();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ImageViewer(const QSharedPointer<ImageViewerFile> &document, QWidget *parent = 0);
|
ImageViewer(const QSharedPointer<ImageViewerFile> &document, QWidget *parent = nullptr);
|
||||||
void ctor();
|
void ctor();
|
||||||
void playToggled();
|
void playToggled();
|
||||||
void updatePauseAction();
|
void updatePauseAction();
|
||||||
|
|||||||
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <qglobal.h>
|
||||||
|
|
||||||
namespace ImageViewer {
|
namespace ImageViewer {
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
|
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ class ImageViewerFactory : public Core::IEditorFactory
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ImageViewerFactory(QObject *parent = 0);
|
explicit ImageViewerFactory(QObject *parent = nullptr);
|
||||||
|
|
||||||
Core::IEditor *createEditor();
|
Core::IEditor *createEditor() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) override
|
||||||
{
|
{
|
||||||
const bool smoothTransform = painter->worldTransform().m11() < 1;
|
const bool smoothTransform = painter->worldTransform().m11() < 1;
|
||||||
painter->setRenderHint(QPainter::SmoothPixmapTransform, smoothTransform);
|
painter->setRenderHint(QPainter::SmoothPixmapTransform, smoothTransform);
|
||||||
@@ -110,7 +110,7 @@ Core::IDocument::OpenResult ImageViewerFile::openImpl(QString *errorString, cons
|
|||||||
QRectF bound = m_tempSvgItem->boundingRect();
|
QRectF bound = m_tempSvgItem->boundingRect();
|
||||||
if (qFuzzyIsNull(bound.width()) && qFuzzyIsNull(bound.height())) {
|
if (qFuzzyIsNull(bound.width()) && qFuzzyIsNull(bound.height())) {
|
||||||
delete m_tempSvgItem;
|
delete m_tempSvgItem;
|
||||||
m_tempSvgItem = 0;
|
m_tempSvgItem = nullptr;
|
||||||
if (errorString)
|
if (errorString)
|
||||||
*errorString = tr("Failed to read SVG image.");
|
*errorString = tr("Failed to read SVG image.");
|
||||||
return OpenResult::CannotHandle;
|
return OpenResult::CannotHandle;
|
||||||
@@ -134,7 +134,7 @@ Core::IDocument::OpenResult ImageViewerFile::openImpl(QString *errorString, cons
|
|||||||
if (errorString)
|
if (errorString)
|
||||||
*errorString = tr("Failed to read image.");
|
*errorString = tr("Failed to read image.");
|
||||||
delete m_pixmap;
|
delete m_pixmap;
|
||||||
m_pixmap = 0;
|
m_pixmap = nullptr;
|
||||||
return OpenResult::CannotHandle;
|
return OpenResult::CannotHandle;
|
||||||
}
|
}
|
||||||
m_type = TypePixmap;
|
m_type = TypePixmap;
|
||||||
@@ -187,7 +187,7 @@ void ImageViewerFile::setPaused(bool paused)
|
|||||||
|
|
||||||
QGraphicsItem *ImageViewerFile::createGraphicsItem() const
|
QGraphicsItem *ImageViewerFile::createGraphicsItem() const
|
||||||
{
|
{
|
||||||
QGraphicsItem *val = 0;
|
QGraphicsItem *val = nullptr;
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case TypeInvalid:
|
case TypeInvalid:
|
||||||
break;
|
break;
|
||||||
@@ -195,7 +195,7 @@ QGraphicsItem *ImageViewerFile::createGraphicsItem() const
|
|||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
if (m_tempSvgItem) {
|
if (m_tempSvgItem) {
|
||||||
val = m_tempSvgItem;
|
val = m_tempSvgItem;
|
||||||
m_tempSvgItem = 0;
|
m_tempSvgItem = nullptr;
|
||||||
} else {
|
} else {
|
||||||
val = new QGraphicsSvgItem(filePath().toString());
|
val = new QGraphicsSvgItem(filePath().toString());
|
||||||
}
|
}
|
||||||
@@ -238,12 +238,12 @@ void ImageViewerFile::updateVisibility()
|
|||||||
void ImageViewerFile::cleanUp()
|
void ImageViewerFile::cleanUp()
|
||||||
{
|
{
|
||||||
delete m_pixmap;
|
delete m_pixmap;
|
||||||
m_pixmap = 0;
|
m_pixmap = nullptr;
|
||||||
delete m_movie;
|
delete m_movie;
|
||||||
m_movie = 0;
|
m_movie = nullptr;
|
||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
delete m_tempSvgItem;
|
delete m_tempSvgItem;
|
||||||
m_tempSvgItem = 0;
|
m_tempSvgItem = nullptr;
|
||||||
#endif
|
#endif
|
||||||
m_type = TypeInvalid;
|
m_type = TypeInvalid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ private:
|
|||||||
|
|
||||||
ImageType m_type = TypeInvalid;
|
ImageType m_type = TypeInvalid;
|
||||||
#ifndef QT_NO_SVG
|
#ifndef QT_NO_SVG
|
||||||
mutable QGraphicsSvgItem *m_tempSvgItem = 0;
|
mutable QGraphicsSvgItem *m_tempSvgItem = nullptr;
|
||||||
#endif
|
#endif
|
||||||
QMovie *m_movie = 0;
|
QMovie *m_movie = nullptr;
|
||||||
QPixmap *m_pixmap = 0;
|
QPixmap *m_pixmap = nullptr;
|
||||||
bool m_isPaused = false;
|
bool m_isPaused = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ QAction *ImageViewerPlugin::registerNewAction(Core::Id id,
|
|||||||
const QString &title, const QKeySequence &key)
|
const QString &title, const QKeySequence &key)
|
||||||
{
|
{
|
||||||
Core::Context context(Constants::IMAGEVIEWER_ID);
|
Core::Context context(Constants::IMAGEVIEWER_ID);
|
||||||
QAction *action = new QAction(title, this);
|
auto action = new QAction(title, this);
|
||||||
Core::Command *command = Core::ActionManager::registerAction(action, id, context);
|
Core::Command *command = Core::ActionManager::registerAction(action, id, context);
|
||||||
if (!key.isEmpty())
|
if (!key.isEmpty())
|
||||||
command->setDefaultKeySequence(key);
|
command->setDefaultKeySequence(key);
|
||||||
|
|||||||
@@ -67,20 +67,20 @@ static const int standardIconSizesValues[] = {16, 24, 32, 48, 64, 128, 256};
|
|||||||
static QSize sizeFromString(const QStringRef &r)
|
static QSize sizeFromString(const QStringRef &r)
|
||||||
{
|
{
|
||||||
if (r.isEmpty())
|
if (r.isEmpty())
|
||||||
return QSize();
|
return {};
|
||||||
const int xPos = r.indexOf('x');
|
const int xPos = r.indexOf('x');
|
||||||
bool ok;
|
bool ok;
|
||||||
const int width = xPos < 0
|
const int width = xPos < 0
|
||||||
? r.toInt(&ok)
|
? r.toInt(&ok)
|
||||||
: r.left(xPos).toInt(&ok);
|
: r.left(xPos).toInt(&ok);
|
||||||
if (!ok || width <= 0)
|
if (!ok || width <= 0)
|
||||||
return QSize();
|
return {};
|
||||||
if (xPos < 0)
|
if (xPos < 0)
|
||||||
return QSize(width, width);
|
return {width, width};
|
||||||
const int height = r.mid(xPos + 1).toInt(&ok);
|
const int height = r.mid(xPos + 1).toInt(&ok);
|
||||||
if (!ok || height <= 0)
|
if (!ok || height <= 0)
|
||||||
return QSize();
|
return {};
|
||||||
return QSize(width, height);
|
return {width, height};
|
||||||
}
|
}
|
||||||
|
|
||||||
static void appendSizeSpec(const QSize &size, QString *target)
|
static void appendSizeSpec(const QSize &size, QString *target)
|
||||||
@@ -119,7 +119,7 @@ static QVector<QSize> stringToSizes(const QString &s)
|
|||||||
for (const QStringRef &sizeSpec : sizes) {
|
for (const QStringRef &sizeSpec : sizes) {
|
||||||
const QSize size = sizeFromString(sizeSpec);
|
const QSize size = sizeFromString(sizeSpec);
|
||||||
if (!size.isValid() || size.isEmpty())
|
if (!size.isValid() || size.isEmpty())
|
||||||
return QVector<QSize>();
|
return {};
|
||||||
else
|
else
|
||||||
result.append(size);
|
result.append(size);
|
||||||
}
|
}
|
||||||
@@ -173,8 +173,8 @@ QVector<QSize> MultiExportDialog::standardIconSizes()
|
|||||||
QVector<QSize> result;
|
QVector<QSize> result;
|
||||||
const int size = int(sizeof(standardIconSizesValues) / sizeof(standardIconSizesValues[0]));
|
const int size = int(sizeof(standardIconSizesValues) / sizeof(standardIconSizesValues[0]));
|
||||||
result.reserve(size);
|
result.reserve(size);
|
||||||
for (int i = 0; i < size; ++i)
|
for (int standardIconSizesValue : standardIconSizesValues)
|
||||||
result.append(QSize(standardIconSizesValues[i], standardIconSizesValues[i]));
|
result.append(QSize(standardIconSizesValue, standardIconSizesValue));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +186,7 @@ MultiExportDialog::MultiExportDialog(QWidget *parent)
|
|||||||
{
|
{
|
||||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
|
|
||||||
QFormLayout *formLayout = new QFormLayout(this);
|
auto formLayout = new QFormLayout(this);
|
||||||
|
|
||||||
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
|
m_pathChooser->setMinimumWidth(QApplication::desktop()->availableGeometry(this).width() / 5);
|
||||||
m_pathChooser->setExpectedKind(Utils::PathChooser::SaveFile);
|
m_pathChooser->setExpectedKind(Utils::PathChooser::SaveFile);
|
||||||
@@ -200,10 +200,10 @@ MultiExportDialog::MultiExportDialog(QWidget *parent)
|
|||||||
pathChooserLabel->setToolTip(pathChooserToolTip);
|
pathChooserLabel->setToolTip(pathChooserToolTip);
|
||||||
formLayout->addRow(pathChooserLabel, m_pathChooser);
|
formLayout->addRow(pathChooserLabel, m_pathChooser);
|
||||||
|
|
||||||
QToolButton *sizeEditButton = new QToolButton;
|
auto sizeEditButton = new QToolButton;
|
||||||
sizeEditButton->setFocusPolicy(Qt::NoFocus);
|
sizeEditButton->setFocusPolicy(Qt::NoFocus);
|
||||||
sizeEditButton->setIcon(Utils::Icons::ARROW_DOWN.icon());
|
sizeEditButton->setIcon(Utils::Icons::ARROW_DOWN.icon());
|
||||||
QMenu *sizeEditMenu = new QMenu(this);
|
auto sizeEditMenu = new QMenu(this);
|
||||||
sizeEditMenu->addAction(tr("Clear"),
|
sizeEditMenu->addAction(tr("Clear"),
|
||||||
m_sizesLineEdit, &QLineEdit::clear);
|
m_sizesLineEdit, &QLineEdit::clear);
|
||||||
sizeEditMenu->addAction(tr("Set Standard Icon Sizes"), this,
|
sizeEditMenu->addAction(tr("Set Standard Icon Sizes"), this,
|
||||||
@@ -215,11 +215,11 @@ MultiExportDialog::MultiExportDialog(QWidget *parent)
|
|||||||
|
|
||||||
const QString sizesToolTip =
|
const QString sizesToolTip =
|
||||||
tr("A comma-separated list of size specifications of the form \"<width>x<height>\".");
|
tr("A comma-separated list of size specifications of the form \"<width>x<height>\".");
|
||||||
QLabel *sizesLabel = new QLabel(tr("Sizes:"));
|
auto sizesLabel = new QLabel(tr("Sizes:"));
|
||||||
sizesLabel->setToolTip(sizesToolTip);
|
sizesLabel->setToolTip(sizesToolTip);
|
||||||
formLayout->addRow(sizesLabel, m_sizesLineEdit);
|
formLayout->addRow(sizesLabel, m_sizesLineEdit);
|
||||||
m_sizesLineEdit->setToolTip(sizesToolTip);
|
m_sizesLineEdit->setToolTip(sizesToolTip);
|
||||||
QWidgetAction *optionsAction = new QWidgetAction(this);
|
auto optionsAction = new QWidgetAction(this);
|
||||||
optionsAction->setDefaultWidget(sizeEditButton);
|
optionsAction->setDefaultWidget(sizeEditButton);
|
||||||
m_sizesLineEdit->addAction(optionsAction, QLineEdit::TrailingPosition);
|
m_sizesLineEdit->addAction(optionsAction, QLineEdit::TrailingPosition);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user