本文整理汇总了C++中sizeHint函数的典型用法代码示例。如果您正苦于以下问题:C++ sizeHint函数的具体用法?C++ sizeHint怎么用?C++ sizeHint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sizeHint函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QDialog
MySqlLogin::MySqlLogin(QString msg,QString *username,QString *password,
QWidget *parent)
: QDialog(parent,"",true)
{
setCaption(tr("mySQL Admin"));
login_name=username;
login_password=password;
//
// Create Fonts
//
QFont font=QFont("Helvetica",10,QFont::Normal);
font.setPixelSize(10);
//
// Message Label
//
RDLabel *label=new RDLabel(msg,this);
label->setFont(font);
label->setGeometry(10,10,sizeHint().width()-20,sizeHint().height()-130);
label->setAlignment(AlignCenter);
//
// MySql Login Name
//
login_name_edit=new QLineEdit(this);
login_name_edit->setFont(font);
login_name_edit->setGeometry(100,sizeHint().height()-110,100,19);
login_name_edit->setMaxLength(16);
login_name_edit->setFocus();
QLabel *login_name_label=new QLabel(login_name_edit,tr("User &Name:"),this);
login_name_label->setFont(font);
login_name_label->setGeometry(10,sizeHint().height()-109,85,19);
login_name_label->setAlignment(AlignRight|ShowPrefix);
//
// MySql Login Password
//
login_password_edit=new QLineEdit(this);
login_password_edit->setFont(font);
login_password_edit->setGeometry(100,sizeHint().height()-90,100,19);
login_password_edit->setMaxLength(16);
login_password_edit->setEchoMode(QLineEdit::Password);
QLabel *login_password_label=new QLabel(login_password_edit,tr("&Password:"));
login_password_label->setFont(font);
login_password_label->setGeometry(10,sizeHint().height()-88,85,19);
login_password_label->setAlignment(AlignRight|ShowPrefix);
//
// OK Button
//
QPushButton *ok_button=new QPushButton(this);
ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
ok_button->setFont(font);
ok_button->setText(tr("&OK"));
ok_button->setDefault(true);
connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));
//
// Cancel Button
//
QPushButton *cancel_button=new QPushButton(this);
cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
80,50);
cancel_button->setFont(font);
cancel_button->setText(tr("&Cancel"));
connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
}
开发者ID:radio-helsinki-graz,项目名称:rivendell,代码行数:69,代码来源:mysql_login.cpp
示例2: sizeHint
//***************************************************************************
QSize Kwave::AboutContainer::minimumSizeHint(void) const
{
return sizeHint();
}
开发者ID:KDE,项目名称:kwave,代码行数:5,代码来源:AboutContainer.cpp
示例3: adjustSize
void Popup::realign()
{
adjustSize();
setGeometry(mPlugin->calculatePopupWindowPos(sizeHint()));
}
开发者ID:jsm222,项目名称:lxqt-panel,代码行数:5,代码来源:popup.cpp
示例4: sizeHint
QSize EditableLabelQt::minimumSizeHint() const { return sizeHint(); }
开发者ID:ResearchDaniel,项目名称:inviwo,代码行数:1,代码来源:editablelabelqt.cpp
示例5: sizeHint
/*!
\reimp
\since 4.8
*/
QSize QRadioButton::minimumSizeHint() const
{
return sizeHint();
}
开发者ID:maxxant,项目名称:qt,代码行数:8,代码来源:qradiobutton.cpp
示例6: QDialog
FindDialog::FindDialog(Stack* documents)
: QDialog(documents->window(), Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint),
m_documents(documents)
{
// Create widgets
QLabel* find_label = new QLabel(tr("Search for:"), this);
m_find_string = new QLineEdit(this);
m_replace_label = new QLabel(tr("Replace with:"), this);
m_replace_string = new QLineEdit(this);
connect(m_find_string, SIGNAL(textChanged(QString)), this, SLOT(findChanged(QString)));
m_ignore_case = new QCheckBox(tr("Ignore case"), this);
m_whole_words = new QCheckBox(tr("Whole words only"), this);
m_regular_expressions = new QCheckBox(tr("Regular expressions"), this);
connect(m_regular_expressions, SIGNAL(toggled(bool)), m_whole_words, SLOT(setDisabled(bool)));
m_search_backwards = new QRadioButton(tr("Search up"), this);
QRadioButton* search_forwards = new QRadioButton(tr("Search down"), this);
search_forwards->setChecked(true);
// Create buttons
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
m_find_button = buttons->addButton(tr("&Find"), QDialogButtonBox::ActionRole);
m_find_button->setEnabled(false);
connect(m_find_button, SIGNAL(clicked()), this, SLOT(find()));
m_replace_button = buttons->addButton(tr("&Replace"), QDialogButtonBox::ActionRole);
m_replace_button->setEnabled(false);
connect(m_replace_button, SIGNAL(clicked()), this, SLOT(replace()));
m_replace_all_button = buttons->addButton(tr("Replace &All"), QDialogButtonBox::ActionRole);
m_replace_all_button->setEnabled(false);
connect(m_replace_all_button, SIGNAL(clicked()), this, SLOT(replaceAll()));
if (!buttons->button(QDialogButtonBox::Close)->icon().isNull()) {
m_find_button->setIcon(QIcon::fromTheme("edit-find"));
m_replace_button->setIcon(QIcon::fromTheme("edit-find-replace"));
}
// Lay out dialog
QGridLayout* layout = new QGridLayout(this);
layout->setColumnStretch(1, 1);
layout->addWidget(find_label, 0, 0, Qt::AlignRight | Qt::AlignVCenter);
layout->addWidget(m_find_string, 0, 1, 1, 2);
layout->addWidget(m_replace_label, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
layout->addWidget(m_replace_string, 1, 1, 1, 2);
layout->addWidget(m_ignore_case, 2, 1);
layout->addWidget(m_whole_words, 3, 1);
layout->addWidget(m_regular_expressions, 4, 1);
layout->addWidget(m_search_backwards, 2, 2);
layout->addWidget(search_forwards, 3, 2);
layout->addWidget(buttons, 5, 0, 1, 3);
setFixedWidth(sizeHint().width());
// Load settings
QSettings settings;
m_ignore_case->setChecked(!settings.value("FindDialog/CaseSensitive", false).toBool());
m_whole_words->setChecked(settings.value("FindDialog/WholeWords", false).toBool());
m_regular_expressions->setChecked(settings.value("FindDialog/RegularExpressions", false).toBool());
m_search_backwards->setChecked(settings.value("FindDialog/SearchBackwards", false).toBool());
m_find_string->installEventFilter(this);
m_replace_string->installEventFilter(this);
}
开发者ID:barak,项目名称:focuswriter,代码行数:66,代码来源:find_dialog.cpp
示例7: QFrame
CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
{
setFrameStyle(QFrame::NoFrame);
setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Sunken);
QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect;
dropShadowEffect->setBlurRadius(6);
dropShadowEffect->setOffset(2, 2);
setGraphicsEffect(dropShadowEffect);
setAutoFillBackground(true);
m_hueControl = new HueControl(this);
m_colorBox = new ColorBox(this);
QWidget *colorFrameWidget = new QWidget(this);
QVBoxLayout* vBox = new QVBoxLayout(colorFrameWidget);
colorFrameWidget->setLayout(vBox);
vBox->setSpacing(0);
vBox->setMargin(0);
vBox->setContentsMargins(0,5,0,28);
m_beforeColorWidget = new QFrame(colorFrameWidget);
m_beforeColorWidget->setFixedSize(30, 18);
m_beforeColorWidget->setAutoFillBackground(true);
m_currentColorWidget = new QFrame(colorFrameWidget);
m_currentColorWidget->setFixedSize(30, 18);
m_currentColorWidget->setAutoFillBackground(true);
vBox->addWidget(m_beforeColorWidget);
vBox->addWidget(m_currentColorWidget);
m_rSpinBox = new QDoubleSpinBox(this);
m_gSpinBox = new QDoubleSpinBox(this);
m_bSpinBox = new QDoubleSpinBox(this);
m_alphaSpinBox = new QDoubleSpinBox(this);
QGridLayout *gridLayout = new QGridLayout(this);
gridLayout->setSpacing(4);
gridLayout->setVerticalSpacing(4);
gridLayout->setMargin(4);
setLayout(gridLayout);
gridLayout->addWidget(m_colorBox, 0, 0, 4, 1);
gridLayout->addWidget(m_hueControl, 0, 1, 4, 1);
gridLayout->addWidget(colorFrameWidget, 0, 2, 2, 1);
gridLayout->addWidget(new QLabel("R", this), 0, 3, 1, 1);
gridLayout->addWidget(new QLabel("G", this), 1, 3, 1, 1);
gridLayout->addWidget(new QLabel("B", this), 2, 3, 1, 1);
gridLayout->addWidget(new QLabel("A", this), 3, 3, 1, 1);
gridLayout->addWidget(m_rSpinBox, 0, 4, 1, 1);
gridLayout->addWidget(m_gSpinBox, 1, 4, 1, 1);
gridLayout->addWidget(m_bSpinBox, 2, 4, 1, 1);
gridLayout->addWidget(m_alphaSpinBox, 3, 4, 1, 1);
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
QPushButton *cancelButton = buttonBox->addButton(QDialogButtonBox::Cancel);
QPushButton *applyButton = buttonBox->addButton(QDialogButtonBox::Apply);
gridLayout->addWidget(buttonBox, 4, 0, 1, 2);
resize(sizeHint());
connect(m_colorBox, SIGNAL(colorChanged()), this, SLOT(onColorBoxChanged()));
connect(m_alphaSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_rSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_gSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_bSpinBox, SIGNAL(valueChanged(double)), this, SLOT(spinBoxChanged()));
connect(m_hueControl, SIGNAL(hueChanged(int)), this, SLOT(onHueChanged(int)));
connect(applyButton, SIGNAL(pressed()), this, SLOT(onAccept()));
connect(cancelButton, SIGNAL(pressed()), this, SIGNAL(rejected()));
m_alphaSpinBox->setMaximum(1);
m_rSpinBox->setMaximum(1);
m_gSpinBox->setMaximum(1);
m_bSpinBox->setMaximum(1);
m_alphaSpinBox->setSingleStep(0.1);
m_rSpinBox->setSingleStep(0.1);
m_gSpinBox->setSingleStep(0.1);
m_bSpinBox->setSingleStep(0.1);
m_blockUpdate = false;
}
开发者ID:NoobSaibot,项目名称:qtcreator-minimap,代码行数:91,代码来源:customcolordialog.cpp
示例8: QDialog
ListSvcs::ListSvcs(QWidget *parent,const char *name)
: QDialog(parent,name,true)
{
setCaption(tr("Rivendell Services"));
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
//
// Create Fonts
//
QFont bold_font=QFont("Helvetica",12,QFont::Bold);
bold_font.setPixelSize(12);
QFont font=QFont("Helvetica",12,QFont::Normal);
font.setPixelSize(12);
//
// Log List
//
list_log_list=new QListView(this,"list_log_list");
list_log_list->setAllColumnsShowFocus(true);
list_log_list->setItemMargin(5);
list_log_list->addColumn(tr("SERVICE"));
list_log_list->setColumnAlignment(0,Qt::AlignLeft);
list_log_list->addColumn(tr("OLDEST REPORT"));
list_log_list->setColumnAlignment(1,Qt::AlignCenter);
connect(list_log_list,
SIGNAL(doubleClicked(QListViewItem *,const QPoint &,int)),
this,
SLOT(listDoubleClickedData(QListViewItem *,const QPoint &,int)));
//
// Generate Report Button
//
list_generate_button=new QPushButton(this,"list_generate_button");
list_generate_button->setFont(bold_font);
list_generate_button->setText(tr("&Generate\nReports"));
connect(list_generate_button,SIGNAL(clicked()),this,SLOT(generateData()));
//
// Purge Button
//
list_purge_button=new QPushButton(this,"list_purge_button");
list_purge_button->setFont(bold_font);
list_purge_button->setText(tr("&Purge\nData"));
connect(list_purge_button,SIGNAL(clicked()),this,SLOT(purgeData()));
//
// Close Button
//
list_close_button=new QPushButton(this,"close_button");
list_close_button->setDefault(true);
list_close_button->setFont(bold_font);
list_close_button->setText(tr("C&lose"));
connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData()));
RefreshList();
}
开发者ID:WMTH,项目名称:rivendell,代码行数:61,代码来源:list_svcs.cpp
示例9: sizeHint
/*!
\reimp
*/
QSize QToolButton::minimumSizeHint() const
{
return sizeHint();
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:7,代码来源:qtoolbutton.cpp
示例10: QDialog
//.........这里部分代码省略.........
propertiesLayout->addWidget(leMinFluxLabel, 6, 1, Qt::AlignRight);
propertiesLayout->addWidget(leMinFluxSpin, 6, 2);
propertiesLayout->addWidget(gasTitleLabel, 7, 0);
propertiesLayout->addWidget(co2MinFluxLabel, 8, 1, Qt::AlignRight);
propertiesLayout->addWidget(co2MinFluxSpin, 8, 2);
propertiesLayout->addWidget(ch4MinFluxLabel, 9, 1, Qt::AlignRight);
propertiesLayout->addWidget(ch4MinFluxSpin, 9, 2);
propertiesLayout->addWidget(gas4MinFluxLabel, 10, 1, Qt::AlignRight);
propertiesLayout->addWidget(gas4MinFluxSpin, 10, 2);
propertiesLayout->addWidget(searchWindowLabel, 11, 0);
propertiesLayout->addWidget(minLabel, 12, 1);
propertiesLayout->addWidget(maxLabel, 12, 2);
propertiesLayout->addWidget(co2Label, 13, 0, Qt::AlignRight);
propertiesLayout->addWidget(minCo2TlSpin, 13, 1);
propertiesLayout->addWidget(maxCo2TlSpin, 13, 2);
propertiesLayout->addWidget(h2oLabel, 14, 0, Qt::AlignRight);
propertiesLayout->addWidget(minH2oTlSpin, 14, 1);
propertiesLayout->addWidget(maxH2oTlSpin, 14, 2);
propertiesLayout->addWidget(ch4Label, 15, 0, Qt::AlignRight);
propertiesLayout->addWidget(minCh4TlSpin, 15, 1);
propertiesLayout->addWidget(maxCh4TlSpin, 15, 2);
propertiesLayout->addWidget(gas4Label, 16, 0, Qt::AlignRight);
propertiesLayout->addWidget(minGas4TlSpin, 16, 1);
propertiesLayout->addWidget(maxGas4TlSpin, 16, 2);
propertiesLayout->setVerticalSpacing(3);
propertiesLayout->setRowMinimumHeight(2, 10);
propertiesLayout->setContentsMargins(3, 3, 3, 3);
auto propertiesFrame = new QWidget;
propertiesFrame->setLayout(propertiesLayout);
propertiesFrame->setMinimumWidth(propertiesFrame->sizeHint().width());
auto okButton = WidgetUtils::createCommonButton(this, tr("Ok"));
auto mainLayout = new QGridLayout(this);
mainLayout->addWidget(groupTitle, 0, 0);
mainLayout->addWidget(hrLabel, 1, 0);
mainLayout->addWidget(propertiesFrame, 2, 0);
mainLayout->addWidget(okButton, 3, 0, 1, 1, Qt::AlignCenter);
mainLayout->setVerticalSpacing(10);
mainLayout->setContentsMargins(30, 30, 30, 30);
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
setLayout(mainLayout);
connect(radioGroup, SIGNAL(buttonClicked(int)),
this, SLOT(updateTlMode(int)));
connect(radioGroup, SIGNAL(buttonClicked(int)),
this, SLOT(radioClicked(int)));
connect(fileBrowse, &FileBrowseWidget::pathChanged,
this, &TimeLagSettingsDialog::updateFile);
connect(fileBrowse, &FileBrowseWidget::pathSelected,
this, &TimeLagSettingsDialog::testSelectedFile);
connect(subsetCheckBox, &QCheckBox::toggled,
this, &TimeLagSettingsDialog::updateSubsetSelection);
connect(startDateLabel, &ClickLabel::clicked,
this, &TimeLagSettingsDialog::onStartDateLabelClicked);
connect(startDateEdit, &QDateEdit::dateChanged,
this, &TimeLagSettingsDialog::updateStartDate);
connect(startTimeEdit, &QTimeEdit::timeChanged,
开发者ID:LI-COR,项目名称:eddypro-gui,代码行数:67,代码来源:timelagsettingsdialog.cpp
示例11: QDialog
RenameGroup::RenameGroup(QString group,QWidget *parent,const char *name)
: QDialog(parent,name,true)
{
group_name=group;
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
setCaption(tr("Rename Group"));
//
// Create Fonts
//
QFont font=QFont("Helvetica",12,QFont::Bold);
font.setPixelSize(12);
//
// Text Validator
//
RDTextValidator *validator=new RDTextValidator(this,"validator");
//
// Current Group Name
//
group_name_edit=new QLineEdit(this,"group_name_edit");
group_name_edit->setGeometry(165,11,sizeHint().width()-175,19);
group_name_edit->setMaxLength(10);
group_name_edit->setReadOnly(true);
QLabel *group_name_label=
new QLabel(group_name_edit,tr("Current Group Name:"),
this,"group_name_label");
group_name_label->setGeometry(10,11,150,19);
group_name_label->setFont(font);
group_name_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// New Group Name
//
group_newname_edit=new QLineEdit(this,"group_newname_edit");
group_newname_edit->setGeometry(165,33,sizeHint().width()-175,19);
group_newname_edit->setMaxLength(10);
group_newname_edit->setValidator(validator);
QLabel *group_newname_label=
new QLabel(group_newname_edit,tr("New &Group Name:"),
this,"group_newname_label");
group_newname_label->setGeometry(10,33,150,19);
group_newname_label->setFont(font);
group_newname_label->setAlignment(AlignRight|AlignVCenter|ShowPrefix);
//
// Ok Button
//
QPushButton *ok_button=new QPushButton(this,"ok_button");
ok_button->setGeometry(sizeHint().width()-180,sizeHint().height()-60,80,50);
ok_button->setDefault(true);
ok_button->setFont(font);
ok_button->setText(tr("&OK"));
connect(ok_button,SIGNAL(clicked()),this,SLOT(okData()));
//
// Cancel Button
//
QPushButton *cancel_button=new QPushButton(this,"cancel_button");
cancel_button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,
80,50);
cancel_button->setFont(font);
cancel_button->setText(tr("&Cancel"));
connect(cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
//
// Populate Fields
//
group_name_edit->setText(group_name);
}
开发者ID:WMTH,项目名称:rivendell,代码行数:79,代码来源:rename_group.cpp
示例12: sizeHint
void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow)
{
QRect scr = QApplication::desktop()->screenGeometry(pos);
QSize sh = sizeHint();
const int border = 1;
const int ah = 18, ao = 18, aw = 18, rc = 7;
bool arrowAtTop = (pos.y() + sh.height() + ah < scr.height());
bool arrowAtLeft = (pos.x() + sh.width() - ao < scr.width());
setContentsMargins(border + 3, border + (arrowAtTop ? ah : 0) + 2, border + 3, border + (arrowAtTop ? 0 : ah) + 2);
updateGeometry();
sh = sizeHint();
int ml, mr, mt, mb;
QSize sz = sizeHint();
if (!arrowAtTop) {
ml = mt = 0;
mr = sz.width() - 1;
mb = sz.height() - ah - 1;
} else {
ml = 0;
mt = ah;
mr = sz.width() - 1;
mb = sz.height() - 1;
}
QPainterPath path;
#if defined(QT_NO_XSHAPE) && defined(Q_WS_X11)
// XShape is required for setting the mask, so we just
// draw an ugly square when its not available
path.moveTo(0, 0);
path.lineTo(sz.width() - 1, 0);
path.lineTo(sz.width() - 1, sz.height() - 1);
path.lineTo(0, sz.height() - 1);
path.lineTo(0, 0);
move(qMax(pos.x() - sz.width(), scr.left()), pos.y());
#else
path.moveTo(ml + rc, mt);
if (arrowAtTop && arrowAtLeft) {
if (showArrow) {
path.lineTo(ml + ao, mt);
path.lineTo(ml + ao, mt - ah);
path.lineTo(ml + ao + aw, mt);
}
move(qMax(pos.x() - ao, scr.left() + 2), pos.y());
} else if (arrowAtTop && !arrowAtLeft) {
if (showArrow) {
path.lineTo(mr - ao - aw, mt);
path.lineTo(mr - ao, mt - ah);
path.lineTo(mr - ao, mt);
}
move(qMin(pos.x() - sh.width() + ao, scr.right() - sh.width() - 2), pos.y());
}
path.lineTo(mr - rc, mt);
path.arcTo(QRect(mr - rc*2, mt, rc*2, rc*2), 90, -90);
path.lineTo(mr, mb - rc);
path.arcTo(QRect(mr - rc*2, mb - rc*2, rc*2, rc*2), 0, -90);
if (!arrowAtTop && !arrowAtLeft) {
if (showArrow) {
path.lineTo(mr - ao, mb);
path.lineTo(mr - ao, mb + ah);
path.lineTo(mr - ao - aw, mb);
}
move(qMin(pos.x() - sh.width() + ao, scr.right() - sh.width() - 2),
pos.y() - sh.height());
} else if (!arrowAtTop && arrowAtLeft) {
if (showArrow) {
path.lineTo(ao + aw, mb);
path.lineTo(ao, mb + ah);
path.lineTo(ao, mb);
}
move(qMax(pos.x() - ao, scr.x() + 2), pos.y() - sh.height());
}
path.lineTo(ml + rc, mb);
path.arcTo(QRect(ml, mb - rc*2, rc*2, rc*2), -90, -90);
path.lineTo(ml, mt + rc);
path.arcTo(QRect(ml, mt, rc*2, rc*2), 180, -90);
// Set the mask
QBitmap bitmap = QBitmap(sizeHint());
bitmap.fill(Qt::color0);
QPainter painter1(&bitmap);
painter1.setPen(QPen(Qt::color1, border));
painter1.setBrush(QBrush(Qt::color1));
painter1.drawPath(path);
setMask(bitmap);
#endif
// Draw the border
pixmap = QPixmap(sz);
QPainter painter2(&pixmap);
painter2.setPen(QPen(palette().color(QPalette::Window).darker(160), border));
painter2.setBrush(palette().color(QPalette::Window));
painter2.drawPath(path);
if (msecs > 0)
timerId = startTimer(msecs);
show();
}
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:98,代码来源:qsystemtrayicon.cpp
示例13: QDialog
ListLogs::ListLogs(QString *logname,QWidget *parent)
: QDialog(parent,"",true)
{
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
//
// Generate Fonts
//
QFont button_font("Helvetica",12,QFont::Bold);
button_font.setPixelSize(12);
list_logname=logname;
setCaption(tr("Select a Log"));
//
// Log List
//
list_log_list=new Q3ListView(this);
list_log_list->setGeometry(10,10,
sizeHint().width()-20,sizeHint().height()-80);
list_log_list->setAllColumnsShowFocus(true);
list_log_list->setItemMargin(5);
connect(list_log_list,
SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
this,
SLOT(doubleClickedData(Q3ListViewItem *,const QPoint &,int)));
list_log_list->addColumn(tr("NAME"));
list_log_list->setColumnAlignment(0,Qt::AlignLeft);
list_log_list->addColumn(tr("DESCRIPTION"));
list_log_list->setColumnAlignment(1,Qt::AlignLeft);
list_log_list->addColumn(tr("SERVICE"));
list_log_list->setColumnAlignment(2,Qt::AlignLeft);
//
// Load Button
//
QPushButton *button=new QPushButton(this);
button->setGeometry(10,sizeHint().height()-60,80,50);
button->setFont(button_font);
button->setText(tr("&OK"));
connect(button,SIGNAL(clicked()),this,SLOT(okButtonData()));
//
// Cancel Button
//
button=new QPushButton(this);
button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50);
button->setFont(button_font);
button->setText(tr("&Cancel"));
button->setDefault(true);
connect(button,SIGNAL(clicked()),this,SLOT(cancelButtonData()));
RefreshList();
}
开发者ID:WMFO,项目名称:rivendell,代码行数:61,代码来源:list_logs.cpp
示例14: QDialog
OptionsDialog::OptionsDialog(QWidget* parent)
: QDialog(parent)
{
QTabWidget* tabs = new QTabWidget(this);
QDirModel* dirModel = new QDirModel(QStringList("*"),
QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable,
QDir::Name | QDir::DirsLast | QDir::IgnoreCase,
this);
// "General" (programs) tab
QWidget* tabProgs = new QWidget(tabs);
fPrpEditorPath = new QLineEdit(tabProgs);
fPrpEditorPath->setCompleter(new QCompleter(dirModel, fPrpEditorPath));
QToolButton* browsePrpEditor = new QToolButton(tabProgs);
browsePrpEditor->setText("...");
fVaultEditorPath = new QLineEdit(tabProgs);
fVaultEditorPath->setCompleter(new QCompleter(dirModel, fVaultEditorPath));
QToolButton* browseVaultEditor = new QToolButton(tabProgs);
browseVaultEditor->setText("...");
fImageEditorPath = new QLineEdit(tabProgs);
fImageEditorPath->setCompleter(new QCompleter(dirModel, fImageEditorPath));
QToolButton* browseImageEditor = new QToolButton(tabProgs);
browseImageEditor->setText("...");
QLabel* lblPrpEditor = new QLabel(tr("&PRP Editor:"), tabProgs);
lblPrpEditor->setBuddy(fPrpEditorPath);
QLabel* lblVaultEditor = new QLabel(tr("&Vault Editor:"), tabProgs);
lblVaultEditor->setBuddy(fVaultEditorPath);
QLabel* lblImgEditor = new QLabel(tr("&Image Editor:"), tabProgs);
lblImgEditor->setBuddy(fImageEditorPath);
QGridLayout* layProgs = new QGridLayout(tabProgs);
layProgs->setContentsMargins(8, 8, 8, 8);
layProgs->addItem(new QSpacerItem(16, 0, QSizePolicy::Maximum, QSizePolicy::Minimum), 1, 0);
layProgs->addWidget(lblPrpEditor, 0, 0, 1, 3);
layProgs->addWidget(fPrpEditorPath, 1, 1);
layProgs->addWidget(browsePrpEditor, 1, 2);
layProgs->addItem(new QSpacerItem(0, 8, QSizePolicy::Minimum, QSizePolicy::Minimum), 2, 0, 1, 3);
layProgs->addWidget(lblVaultEditor, 3, 0, 1, 3);
layProgs->addWidget(fVaultEditorPath, 4, 1);
layProgs->addWidget(browseVaultEditor, 4, 2);
layProgs->addItem(new QSpacerItem(0, 8, QSizePolicy::Minimum, QSizePolicy::Minimum), 5, 0, 1, 3);
layProgs->addWidget(lblImgEditor, 6, 0, 1, 3);
layProgs->addWidget(fImageEditorPath, 7, 1);
layProgs->addWidget(browseImageEditor, 7, 2);
layProgs->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 8, 0, 1, 3);
tabs->addTab(tabProgs, tr("&General"));
// Editor tab
QWidget* tabEditor = new QWidget(tabs);
fSciLineNumbers = new QCheckBox(tr("&Line numbers"), tabEditor);
fSciUseSpaces = new QCheckBox(tr("Use &spaces instead of tabs"), tabEditor);
fSciAutoIndent = new QCheckBox(tr("&Auto-indent"), tabEditor);
fSciIndentGuides = new QCheckBox(tr("Show in&dentation guides"), tabEditor);
fSciShowWhitespace = new QCheckBox(tr("Show &whitespace"), tabEditor);
fSciFont = new QPushButton(tr("Editor &Font"), tabEditor);
fSciTabWidth = new QLineEdit(tabEditor);
fSciLongLineMark = new QCheckBox(tr("Long line mar&ker:"), tabEditor);
fSciLongLineSize = new QLineEdit(tabEditor);
fSciTabWidth->setValidator(new QIntValidator(fSciTabWidth));
((QIntValidator*)fSciTabWidth->validator())->setRange(1, 80);
fSciLongLineSize->setValidator(new QIntValidator(fSciLongLineSize));
((QIntValidator*)fSciLongLineSize->validator())->setRange(1, 9999);
QLabel* lblTabWidth = new QLabel(tr("&Tab Width:"), tabEditor);
lblTabWidth->setBuddy(fSciTabWidth);
QGridLayout* layEditor = new QGridLayout(tabEditor);
layEditor->setContentsMargins(8, 8, 8, 8);
layEditor->setVerticalSpacing(4);
layEditor->addWidget(fSciLineNumbers, 0, 0);
layEditor->addWidget(fSciUseSpaces, 1, 0);
layEditor->addWidget(fSciAutoIndent, 2, 0);
layEditor->addWidget(fSciIndentGuides, 3, 0);
layEditor->addWidget(fSciShowWhitespace, 4, 0);
layEditor->addItem(new QSpacerItem(32, 0, QSizePolicy::Minimum, QSizePolicy::Minimum), 0, 1);
layEditor->addWidget(fSciFont, 0, 2, 1, 2);
layEditor->addItem(new QSpacerItem(0, 16, QSizePolicy::Minimum, QSizePolicy::Minimum), 1, 2, 1, 2);
layEditor->addWidget(lblTabWidth, 2, 2);
layEditor->addWidget(fSciTabWidth, 2, 3);
layEditor->addWidget(fSciLongLineMark, 3, 2);
layEditor->addWidget(fSciLongLineSize, 3, 3);
fSciTabWidth->setMaximumWidth(40);
fSciLongLineSize->setMaximumWidth(40);
layEditor->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding), 6, 5);
tabs->addTab(tabEditor, tr("Text &Editor"));
// Lay out the dialog itself
QGridLayout* dlgLayout = new QGridLayout(this);
dlgLayout->setContentsMargins(4, 4, 4, 4);
dlgLayout->setVerticalSpacing(4);
dlgLayout->addWidget(tabs, 0, 0);
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel,
Qt::Horizontal, this);
dlgLayout->addWidget(buttons, 1, 0);
setFixedSize(sizeHint());
setWindowTitle(tr("PlasmaShop Preferences"));
// Populate the current/default settings
QSettings settings("PlasmaShop", "PlasmaShop");
//.........这里部分代码省略.........
开发者ID:H-uru,项目名称:PlasmaShop,代码行数:101,代码来源:OptionsDialog.cpp
示例15: sizeHint
QSize CategoryFilterWidget::minimumSizeHint() const
{
QSize size = sizeHint();
size.setWidth(6);
return size;
}
开发者ID:paolo-sz,项目名称:qBittorrent,代码行数:6,代码来源:categoryfilterwidget.cpp
示例16: QDialog
TestSetupDialog::TestSetupDialog(QWidget* parent)
: QDialog(parent)
{
setWindowTitle(tr("Setup testing parameters"));
QSettings settings("CCTools", "CCEdit");
QCompleter* exeCompleter = new QCompleter(this);
exeCompleter->setModel(new QDirModel(EXE_LIST,
QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable,
QDir::Name, exeCompleter));
QCompleter* winExeCompleter = new QCompleter(this);
winExeCompleter->setModel(new QDirModel(QStringList() << "*.exe",
QDir::AllDirs | QDir::AllEntries | QDir::NoDotAndDotDot,
QDir::Name, winExeCompleter));
#ifndef Q_OS_WIN
m_winePath = new QLineEdit(settings.value("WineExe").toString(), this);
m_winePath->setCompleter(exeCompleter);
QLabel* lblWinePath = new QLabel(tr("&WINE Path:"), this);
lblWinePath->setBuddy(m_winePath);
QToolButton* browseWine = new QToolButton(this);
browseWine->setIcon(QIcon(":/res/document-open-folder-sm.png"));
browseWine->setAutoRaise(true);
#endif
m_msccPath = new QLineEdit(settings.value("ChipsExe").toString(), this);
m_msccPath->setCompleter(winExeCompleter);
QLabel* lblMsccPath = new QLabel(tr("MS&CC Path:"), this);
lblMsccPath->setBuddy(m_msccPath);
QToolButton* browseChips = new QToolButton(this);
browseChips->setIcon(QIcon(":/res/document-open-folder-sm.png"));
browseChips->setAutoRaise(true);
m_tworldPath = new QLineEdit(settings.value("TWorldExe").toString(), this);
m_tworldPath->setCompleter(exeCompleter);
QLabel* lblTWorldPath = new QLabel(tr("&Tile World Path:"), this);
lblTWorldPath->setBuddy(m_tworldPath);
QToolButton* browseTWorld = new QToolButton(this);
browseTWorld->setIcon(QIcon(":/res/document-open-folder-sm.png"));
browseTWorld->setAutoRaise(true);
QDialogButtonBox* buttons = new QDialogButtonBox(
QDialogButtonBox::Save | QDialogButtonBox::Cancel,
Qt::Horizontal, this);
m_useCCPatch = new QCheckBox(tr("MSCC: Use CCPatch"), this);
m_useCCPatch->setChecked(settings.value("TestCCPatch", true).toBool());
m_usePGPatch = new QCheckBox(tr("MSCC: Use PGChip (Ice Blocks)"), this);
m_usePGPatch->setChecked(settings.value("TestPGPatch", false).toBool());
QGridLayout* layout = new QGridLayout(this);
layout->setContentsMargins(8, 8, 8, 8);
layout->setVerticalSpacing(4);
layout->setHorizontalSpacing(4);
#ifndef Q_OS_WIN
layout->addWidget(lblWinePath, 0, 0);
layout->addWidget(m_winePath, 0, 1);
layout->addWidget(browseWine, 0, 2);
#endif
layout->addWidget(lblMsccPath, POSIX_OFFSET + 0, 0);
layout->addWidget(m_msccPath, POSIX_OFFSET + 0, 1);
layout->addWidget(browseChips, POSIX_OFFSET + 0, 2);
layout->addWidget(m_useCCPatch, POSIX_OFFSET + 1, 1);
layout->addWidget(m_usePGPatch, POSIX_OFFSET + 2, 1);
layout->addWidget(lblTWorldPath, POSIX_OFFSET + 3, 0);
layout->addWidget(m_tworldPath, POSIX_OFFSET + 3, 1);
layout->addWidget(browseTWorld, POSIX_OFFSET + 3, 2);
#ifndef Q_OS_WIN
layout->addWidget(new QLabel(
tr("Note: Leave WINE or Tile World paths empty to use system-installed locations"),
this), POSIX_OFFSET + 4, 0, 1, 3);
#else
layout->addWidget(new QLabel(
tr("Note: MSCC will not work on 64-bit Windows platforms"),
this), POSIX_OFFSET + 4, 0, 1, 3);
#endif
layout->addItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding), POSIX_OFFSET + 5, 0, 1, 3);
layout->addWidget(buttons, POSIX_OFFSET + 6, 0, 1, 3);
resize(400, sizeHint().height());
connect(buttons, SIGNAL(rejected()), SLOT(reject()));
connect(buttons, SIGNAL(accepted()), SLOT(onSaveSettings()));
#ifndef Q_OS_WIN
connect(browseWine, SIGNAL(clicked()), SLOT(onBrowseWine()));
#endif
connect(browseChips, SIGNAL(clicked()), SLOT(onBrowseChips()));
connect(browseTWorld, SIGNAL(clicked()), SLOT(onBrowseTWorld()));
}
开发者ID:zrax,项目名称:cctools,代码行数:86,代码来源:TestSetup.cpp
示例17: QDialog
NovelDialog::NovelDialog(const QString& novel, Database* data, QWidget* parent) :
QDialog(parent),
m_data(data),
m_new(novel.isEmpty())
{
// Create name widget
m_name = new QLineEdit(this);
connect(m_name, &QLineEdit::textChanged, this, &NovelDialog::checkAcceptAllowed);
QHBoxLayout* name_layout = new QHBoxLayout;
name_layout->addWidget(new QLabel(tr("Name:"), this));
name_layout->addWidget(m_name);
// Create goals widgets
QGroupBox* goals = new QGroupBox(tr("Goals"), this);
m_total = new QSpinBox(goals);
m_total->setCorrectionMode(QSpinBox::CorrectToNearestValue);
m_total->setRange(0, 9999999);
m_total->setSpecialValueText(tr("N/A"));
m_daily = new QSpinBox(goals);
m_daily->setCorrectionMode(QSpinBox::CorrectToNearestValue);
m_daily->setRange(0, 9999999);
m_daily->setSpecialValueText(tr("N/A"));
// Create date widgets
QGroupBox* dates = new QGroupBox(tr("Date Range"), this);
m_start = new QDateEdit(dates);
m_start->setCalendarPopup(true);
connect(m_start, &QDateEdit::dateChanged, this, &NovelDialog::checkAcceptAllowed);
m_end = new QDateEdit(dates);
m_end->setCalendarPopup(true);
connect(m_end, &QDateEdit::dateChanged, this, &NovelDialog::checkAcceptAllowed);
// Create word count widgets
QGroupBox* wordcount = new QGroupBox(tr("Word Count"), this);
m_start_value = new QSpinBox(wordcount);
m_start_value->setCorrectionMode(QSpinBox::CorrectToNearestValue);
m_start_value->setRange(0, 9999999);
// Create buttons
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
m_accept = buttons->button(QDialogButtonBox::Ok);
connect(buttons, &QDialogButtonBox::accepted, this, &NovelDialog::accept);
connect(buttons, &QDialogButtonBox::rejected, this, &NovelDialog::reject);
// Lay out window
QFormLayout* goals_layout = new QFormLayout(goals);
goals_layout->addRow(tr("Total:"), m_total);
goals_layout->addRow(tr("Daily:"), m_daily);
QFormLayout* dates_layout = new QFormLayout(dates);
dates_layout->addRow(tr("Start On:"), m_start);
dates_layout->addRow(tr("End On:"), m_end);
QFormLayout* wordcount_layout = new QFormLayout(wordcount);
wordcount_layout->addRow(tr("Start At:"), m_start_value);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->addLayout(name_layout);
layout->addWidget(goals);
layout->addWidget(dates);
layout->addWidget(wordcount);
layout->addStretch();
layout->addWidget(buttons);
resize(sizeHint().width() * 1.25, sizeHint().height());
// Load values
if (m_new) {
setWindowTitle(tr("Add Novel"));
m_accept->setEnabled(false);
m_total->setValue(50000);
m_daily->setValue(2000);
m_start_value->setValue(0);
QDate date = QDate::currentDate();
m_start->setDate(QDate(date.year(), date.month(), 1));
m_end->setDate(QDate(date.year(), date.month(), date.daysInMonth()));
} else {
setWindowTitle(tr("Edit Novel"));
m_name->setText(novel);
m_total->setValue(m_data->goal(Database::Total));
m_daily->setValue(m_data->goal(Database::Daily));
m_start_value->setValue(m_data->startValue());
m_start->setDate(m_data->startDate());
m_end->setDate(m_data->endDate());
}
}
开发者ID:gottcode,项目名称:novprog,代码行数:92,代码来源:novel_dialog.cpp
示例18: displayOrNotListOfValidity
void ValidityDialog::changeIndexType(int _index)
{
bool activate = (_index != 0);
allowEmptyCell->setEnabled(activate);
message->setEnabled(activate);
title->setEnabled(activate);
chooseAction->setEnabled(activate);
displayMessage->setEnabled(activate);
displayHelp->setEnabled(activate);
messageHelp->setEnabled(activate);
titleHelp->setEnabled(activate);
if (_index == 7)
displayOrNotListOfValidity(true);
else
displayOrNotListOfValidity(false);
switch (_index) {
case 0:
edit1->setText("");
edit2->setText("");
val_max->setEnabled(false);
val_min->setEnabled(false);
choose->setEnabled(false);
break;
case 1:
val_min->setEnabled(true);
choose->setEnabled(true);
val_min->setValidator(new KDoubleValidator(val_min));
val_max->setValidator(new KDoubleValidator(val_max));
if (choose->currentIndex() <= 4) {
edit1->setText(i18n("Number:"));
edit2->setText("");
val_max->setEnabled(false);
} else {
edit1->setText(i18n("Minimum:"));
edit2->setText(i18n("Maximum:"));
val_max->setEnabled(true);
}
break;
case 2:
case 6:
val_min->setEnabled(true);
choose->setEnabled(true);
val_min->setValidator(new KIntValidator(val_min));
val_max->setValidator(new KIntValidator(val_max));
if (choose->currentIndex() <= 4) {
edit1->setText(i18n("Number:"));
edit2->setText("");
val_max->setEnabled(false);
} else {
edit1->setText(i18n("Minimum:"));
edit2->setText(i18n("Maximum:"));
val_max->setEnabled(true);
}
break;
case 3:
edit1->setText("");
edit2->setText("");
val_max->setEnabled(false);
val_min->setEnabled(false);
choose->setEnabled(false);
break;
case 4:
edit1->setText(i18n("Date:"));
edit2->setText("");
val_min->setEnabled(true);
choose->setEnabled(true);
val_min->setValidator(0);
val_max->setValidator(0);
if (choose->currentIndex() <= 4) {
edit1->setText(i18n("Date:"));
edit2->setText("");
val_max->setEnabled(false);
} else {
edit1->setText(i18n("Date minimum:"));
edit2->setText(i18n("Date maximum:"));
val_max->setEnabled(true);
}
break;
case 5:
val_min->setEnabled(true);
choose->setEnabled(true);
val_min->setValidator(0);
val_max->setValidator(0);
if (choose->currentIndex() <= 4) {
edit1->setText(i18n("Time:"));
edit2->s
|
请发表评论