forked from qt-creator/qt-creator
Debugger: Improve type formats dialog.
- Add title, suppress whatsthis, change layout to grid. Change-Id: I2a6819c913321062c050bebdc84799f847e9bc13 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
#include <QtGui/QScrollArea>
|
#include <QtGui/QScrollArea>
|
||||||
#include <QtGui/QSortFilterProxyModel>
|
#include <QtGui/QSortFilterProxyModel>
|
||||||
#include <QtGui/QStandardItemModel>
|
#include <QtGui/QStandardItemModel>
|
||||||
|
#include <QtGui/QGridLayout>
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
@@ -989,38 +990,33 @@ class TypeFormatsDialogPage : public QWidget
|
|||||||
public:
|
public:
|
||||||
TypeFormatsDialogPage()
|
TypeFormatsDialogPage()
|
||||||
{
|
{
|
||||||
m_layout = new QVBoxLayout;
|
m_layout = new QGridLayout;
|
||||||
m_layout->setMargin(5);
|
m_layout->setColumnStretch(0, 2);
|
||||||
m_layout->setSpacing(0);
|
QVBoxLayout *vboxLayout = new QVBoxLayout;
|
||||||
m_layout->addItem(new QSpacerItem(1, 1, QSizePolicy::MinimumExpanding,
|
vboxLayout->addLayout(m_layout);
|
||||||
QSizePolicy::MinimumExpanding));
|
vboxLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Ignored,
|
||||||
setLayout(m_layout);
|
QSizePolicy::MinimumExpanding));
|
||||||
|
setLayout(vboxLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addTypeFormats(const QString &type,
|
void addTypeFormats(const QString &type,
|
||||||
const QStringList &typeFormats, int current)
|
const QStringList &typeFormats, int current)
|
||||||
{
|
{
|
||||||
QHBoxLayout *hl = new QHBoxLayout;
|
const int row = m_layout->rowCount();
|
||||||
|
int column = 0;
|
||||||
QButtonGroup *group = new QButtonGroup(this);
|
QButtonGroup *group = new QButtonGroup(this);
|
||||||
QLabel *typeLabel = new QLabel(type, this);
|
m_layout->addWidget(new QLabel(type), row, column++);
|
||||||
hl->addWidget(typeLabel);
|
|
||||||
for (int i = -1; i != typeFormats.size(); ++i) {
|
for (int i = -1; i != typeFormats.size(); ++i) {
|
||||||
QRadioButton *choice = new QRadioButton(this);
|
QRadioButton *choice = new QRadioButton(this);
|
||||||
if (i == -1)
|
choice->setText(i == -1 ? tr("Reset") : typeFormats.at(i));
|
||||||
choice->setText(tr("Reset"));
|
m_layout->addWidget(choice, row, column++);
|
||||||
else
|
|
||||||
choice->setText(typeFormats.at(i));
|
|
||||||
hl->addWidget(choice);
|
|
||||||
if (i == current)
|
if (i == current)
|
||||||
choice->setChecked(true);
|
choice->setChecked(true);
|
||||||
group->addButton(choice, i);
|
group->addButton(choice, i);
|
||||||
}
|
}
|
||||||
hl->addItem(new QSpacerItem(1, 1, QSizePolicy::MinimumExpanding,
|
|
||||||
QSizePolicy::MinimumExpanding));
|
|
||||||
m_layout->insertLayout(m_layout->count() - 1, hl);
|
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
QVBoxLayout *m_layout;
|
QGridLayout *m_layout;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TypeFormatsDialogUi
|
class TypeFormatsDialogUi
|
||||||
@@ -1069,6 +1065,8 @@ private:
|
|||||||
TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
|
TypeFormatsDialog::TypeFormatsDialog(QWidget *parent)
|
||||||
: QDialog(parent), m_ui(new TypeFormatsDialogUi(this))
|
: QDialog(parent), m_ui(new TypeFormatsDialogUi(this))
|
||||||
{
|
{
|
||||||
|
setWindowTitle(tr("Type Formats"));
|
||||||
|
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
m_ui->addPage(tr("Qt Types"));
|
m_ui->addPage(tr("Qt Types"));
|
||||||
m_ui->addPage(tr("Standard Types"));
|
m_ui->addPage(tr("Standard Types"));
|
||||||
m_ui->addPage(tr("Misc Types"));
|
m_ui->addPage(tr("Misc Types"));
|
||||||
|
|||||||
Reference in New Issue
Block a user