UI: Don't use Qt::AA_EnableHighDpiScaling attribute.

To avoid label's left side clipping bugs.
This commit is contained in:
Nodir Temirkhodjaev 2020-01-11 10:18:05 +05:00
parent 5e45e308a7
commit 2f7f073430
4 changed files with 6 additions and 10 deletions

View File

@ -12,8 +12,6 @@
#include <QToolButton>
#include <QWidgetAction>
#include "widebutton.h"
QCheckBox *ControlUtil::createCheckBox(bool checked,
const std::function<void (bool checked)> &onToggled)
{
@ -39,7 +37,7 @@ QComboBox *ControlUtil::createComboBox(const QStringList &texts,
QPushButton *ControlUtil::createButton(const QString &iconPath,
const std::function<void ()> &onClicked)
{
auto c = new WideButton(QIcon(iconPath));
auto c = new QPushButton(QIcon(iconPath), QString());
c->connect(c, &QPushButton::clicked, onClicked);
@ -72,7 +70,6 @@ QPushButton *ControlUtil::createLinkButton(const QString &iconPath,
QLabel *ControlUtil::createLabel(const QString &text)
{
auto c = new QLabel(text);
c->setIndent(2); // Workaround for clipping bug
return c;
}

View File

@ -90,9 +90,9 @@ QLayout *MainPage::setupDialogButtons()
buttonsLayout->addStretch();
m_btOk = new WideButton(QIcon(":/images/tick.png"));
m_btApply = new WideButton(QIcon(":/images/accept.png"));
m_btCancel = new WideButton(QIcon(":/images/cancel.png"));
m_btOk = new QPushButton(QIcon(":/images/tick.png"), QString());
m_btApply = new QPushButton(QIcon(":/images/accept.png"), QString());
m_btCancel = new QPushButton(QIcon(":/images/cancel.png"), QString());
connect(m_btOk, &QAbstractButton::clicked, ctrl(), &OptionsController::saveChanges);
connect(m_btApply, &QAbstractButton::clicked, ctrl(), &OptionsController::applyChanges);

View File

@ -287,8 +287,8 @@ void ProgramsWindow::setupAppEditForm()
// OK/Cancel
auto buttonsLayout = new QHBoxLayout();
m_btEditOk = new WideButton(QIcon(":/images/tick.png"));
m_btEditCancel = new WideButton(QIcon(":/images/cancel.png"));
m_btEditOk = new QPushButton(QIcon(":/images/tick.png"), QString());
m_btEditCancel = new QPushButton(QIcon(":/images/cancel.png"), QString());
buttonsLayout->addWidget(m_btEditOk, 1, Qt::AlignRight);
buttonsLayout->addWidget(m_btEditCancel);

View File

@ -21,7 +21,6 @@ static void registerMetaTypes(void)
int main(int argc, char *argv[])
{
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);