forked from qt-creator/qt-creator
Add logo and title to PySide install dialog
Change-Id: I7888ee906334de2c93c24c5da2394c9e73101a28 Fixes: QTCREATORBUG-30041 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
committed by
Cristian Maureira-Fredes
parent
1365ee7cb2
commit
c4464eb072
BIN
src/plugins/python/images/qtforpython_neon.png
Normal file
BIN
src/plugins/python/images/qtforpython_neon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@@ -128,20 +128,40 @@ void PySideInstaller::installPyside(const FilePath &python,
|
|||||||
} else {
|
} else {
|
||||||
QDialog dialog;
|
QDialog dialog;
|
||||||
dialog.setWindowTitle(Tr::tr("Select PySide Version"));
|
dialog.setWindowTitle(Tr::tr("Select PySide Version"));
|
||||||
dialog.setLayout(new QVBoxLayout());
|
|
||||||
dialog.layout()->addWidget(new QLabel(Tr::tr("Select which PySide version to install:")));
|
// Logo for the corner in the QDialog
|
||||||
|
QPixmap logo(":/python/images/qtforpython_neon.png");
|
||||||
|
QLabel *logoLabel = new QLabel();
|
||||||
|
logoLabel->setPixmap(logo);
|
||||||
|
|
||||||
|
QVBoxLayout *dialogLayout = new QVBoxLayout();
|
||||||
|
QHBoxLayout *hlayout = new QHBoxLayout();
|
||||||
|
hlayout->addWidget(logoLabel);
|
||||||
|
hlayout->addWidget(new QLabel("<b>" + Tr::tr("Installing PySide") + "</b>"));
|
||||||
|
dialogLayout->addLayout(hlayout);
|
||||||
|
|
||||||
|
QLabel *installDescription = new QLabel(Tr::tr("You can install PySide "
|
||||||
|
"from PyPi (Community OSS version) or from your Qt "
|
||||||
|
"installation location, if you are using the Qt "
|
||||||
|
"Installer and have a commercial license."));
|
||||||
|
installDescription->setWordWrap(true);
|
||||||
|
dialogLayout->addWidget(installDescription);
|
||||||
|
|
||||||
|
dialogLayout->addWidget(new QLabel(Tr::tr("Select which version to install:")));
|
||||||
QComboBox *pySideSelector = new QComboBox();
|
QComboBox *pySideSelector = new QComboBox();
|
||||||
pySideSelector->addItem(Tr::tr("Latest PySide from the Python Package Index"));
|
pySideSelector->addItem(Tr::tr("Latest PySide from the PyPI"));
|
||||||
for (const Utils::FilePath &version : std::as_const(availablePySides)) {
|
for (const Utils::FilePath &version : std::as_const(availablePySides)) {
|
||||||
const FilePath dir = version.parentDir();
|
const FilePath dir = version.parentDir();
|
||||||
const QString text
|
const QString text
|
||||||
= Tr::tr("PySide %1 Wheel (%2)").arg(dir.fileName(), dir.toUserOutput());
|
= Tr::tr("PySide %1 Wheel (%2)").arg(dir.fileName(), dir.toUserOutput());
|
||||||
pySideSelector->addItem(text, version.toVariant());
|
pySideSelector->addItem(text, version.toVariant());
|
||||||
}
|
}
|
||||||
dialog.layout()->addWidget(pySideSelector);
|
dialogLayout->addWidget(pySideSelector);
|
||||||
QDialogButtonBox box;
|
QDialogButtonBox box;
|
||||||
box.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
box.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
dialog.layout()->addWidget(&box);
|
dialogLayout->addWidget(&box);
|
||||||
|
|
||||||
|
dialog.setLayout(dialogLayout);
|
||||||
connect(&box, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
connect(&box, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||||
connect(&box, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
connect(&box, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||||
|
|
||||||
|
@@ -2,5 +2,6 @@
|
|||||||
<qresource prefix="/python">
|
<qresource prefix="/python">
|
||||||
<file>images/settingscategory_python.png</file>
|
<file>images/settingscategory_python.png</file>
|
||||||
<file>images/settingscategory_python@2x.png</file>
|
<file>images/settingscategory_python@2x.png</file>
|
||||||
|
<file>images/qtforpython_neon.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Reference in New Issue
Block a user