本文整理汇总了C++中setMaximumWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ setMaximumWidth函数的具体用法?C++ setMaximumWidth怎么用?C++ setMaximumWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMaximumWidth函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TsimpleScore
TmultiScore::TmultiScore(QMainWindow* mw, QWidget* parent) :
TsimpleScore(1, parent),
m_mainWindow(mw),
m_inMode(e_multi),
m_scale(1.0),
m_clickedOff(0), m_currentIndex(-1),
m_useAinim(true),
m_addNoteAnim(true),
m_selectReadOnly(false), m_isDisabled(false)
{
setObjectName(QStringLiteral("m_mainScore"));
setStyleSheet(QStringLiteral("TsimpleScore#m_mainScore { background: transparent }"));
setContentsMargins(2, 2, 2, 2);
if (!TscoreNote::touchEnabled())
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); // it is off by default
staff()->setZValue(11); // to be above next staves - TnoteControl requires it
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setMaximumWidth(QWIDGETSIZE_MAX); // revert what TsimpleScore 'broke'
setAlignment(Qt::AlignCenter);
if (qApp->applicationName() == QLatin1String("Scorek")) {
addStaff(staff()); // TODO: main score does that - but TmultiScore is dependent on it then - try to move it here
setNote(0, Tnote()); // To display fake empty note properly
}
}
开发者ID:SeeLook,项目名称:nootka,代码行数:27,代码来源:tmultiscore.cpp
示例2: QDialog
ColorMapDialog::ColorMapDialog(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl), applyBtn(nullptr), closeBtn(nullptr),
editor(nullptr), d_matrix(nullptr) {
setObjectName("ColorMapDialog");
setWindowTitle(tr("MantidPlot") + " - " + tr("Custom Color Map"));
editor = new ColorMapEditor();
applyBtn = new QPushButton(tr("&Apply"));
connect(applyBtn, SIGNAL(clicked()), this, SLOT(apply()));
closeBtn = new QPushButton(tr("&Close"));
connect(closeBtn, SIGNAL(clicked()), this, SLOT(reject()));
QHBoxLayout *hb = new QHBoxLayout();
hb->setSpacing(5);
hb->addStretch();
hb->addWidget(applyBtn);
hb->addWidget(closeBtn);
hb->addStretch();
QVBoxLayout *vl = new QVBoxLayout(this);
vl->setSpacing(0);
vl->addWidget(editor);
vl->addLayout(hb);
setMaximumWidth(editor->width() + 20);
}
开发者ID:mantidproject,项目名称:mantid,代码行数:27,代码来源:ColorMapDialog.cpp
示例3: QPushButton
MyPushButton::MyPushButton(int index) : QPushButton(0)
{
_index = index;
setCheckable(true);
setMaximumWidth(30);
connect(this, SIGNAL(toggled(bool)), this, SLOT(handleClick()));
}
开发者ID:ustinski,项目名称:3dModeler,代码行数:7,代码来源:mypushbutton.cpp
示例4: QWidget
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent)
: QWidget(parent)
, p_QupZilla(mainClass)
, m_bookmarksModel(mApp->bookmarksModel())
, m_historyModel(mApp->history())
, m_toolButtonStyle(Qt::ToolButtonTextBesideIcon)
{
setObjectName("bookmarksbar");
m_layout = new QHBoxLayout();
m_layout->setMargin(3);
m_layout->setSpacing(0);
setLayout(m_layout);
setAcceptDrops(true);
setContextMenuPolicy(Qt::CustomContextMenu);
connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
connect(m_bookmarksModel, SIGNAL(bookmarkAdded(BookmarksModel::Bookmark)), this, SLOT(addBookmark(BookmarksModel::Bookmark)));
connect(m_bookmarksModel, SIGNAL(bookmarkDeleted(BookmarksModel::Bookmark)), this, SLOT(removeBookmark(BookmarksModel::Bookmark)));
connect(m_bookmarksModel, SIGNAL(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)), this, SLOT(bookmarkEdited(BookmarksModel::Bookmark,BookmarksModel::Bookmark)));
connect(m_bookmarksModel, SIGNAL(subfolderAdded(QString)), this, SLOT(subfolderAdded(QString)));
connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(folderDeleted(QString)));
connect(m_bookmarksModel, SIGNAL(folderRenamed(QString,QString)), this, SLOT(folderRenamed(QString,QString)));
connect(m_bookmarksModel, SIGNAL(folderParentChanged(QString,bool)), this, SLOT(changeFolderParent(QString,bool)));
connect(m_bookmarksModel, SIGNAL(bookmarkParentChanged(QString,QByteArray,int,QUrl,QString,QString)), this, SLOT(changeBookmarkParent(QString,QByteArray,int,QUrl,QString,QString)));
setMaximumWidth(p_QupZilla->width());
refreshBookmarks();
showOnlyIconsChanged();
}
开发者ID:Klaudit,项目名称:qupzilla,代码行数:32,代码来源:bookmarkstoolbar.cpp
示例5: setWrapping
void ImageThumbnailBar::setFlow(QListView::Flow flow)
{
setWrapping(false);
ImageCategorizedView::setFlow(flow);
ImageThumbnailDelegate* const del = static_cast<ImageThumbnailDelegate*>(delegate());
del->setFlow(flow);
// Reset the minimum and maximum sizes.
setMinimumSize(QSize(0, 0));
setMaximumSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
// Adjust minimum and maximum width to thumbnail sizes.
if (flow == TopToBottom)
{
int viewportFullWidgetOffset = size().width() - viewport()->size().width();
setMinimumWidth(del->minimumSize() + viewportFullWidgetOffset);
setMaximumWidth(del->maximumSize() + viewportFullWidgetOffset);
}
else
{
int viewportFullWidgetOffset = size().height() - viewport()->size().height();
setMinimumHeight(del->minimumSize() + viewportFullWidgetOffset);
setMaximumHeight(del->maximumSize() + viewportFullWidgetOffset);
}
setScrollBarPolicy(d->scrollPolicy);
}
开发者ID:KDE,项目名称:digikam,代码行数:29,代码来源:imagethumbnailbar.cpp
示例6: HbScrollArea
/*!
\brief Constructor
Configures scroll area settings and resets internal stares of widget.
Gets the width of device.
\param parent The parent of scroll area widget
*/
CalenDayContentScrollArea::CalenDayContentScrollArea(QGraphicsItem *parent) :
HbScrollArea(parent), mPanDayDirection(ECalenPanNotSet), mIsMoving(false),
mMoveDirection(ECalenScrollNoDayChange), mDisallowedDirection(ECalenScrollNoDayChange)
{
#ifdef CALENDAYVIEW_PANNING_ENABLED
grabGesture(Qt::PanGesture);
ungrabGesture(Qt::SwipeGesture);
#else
grabGesture(Qt::SwipeGesture);
ungrabGesture(Qt::PanGesture);
#endif
// Get the width of content area and orientation of screen
mContentWidth = CalenDayUtils::instance()->contentWidth();
mOrientation = CalenDayUtils::instance()->orientation();
// Fix the width of scroll area
setMinimumWidth(mContentWidth);
setMaximumWidth(mContentWidth);
// Connect to main window's orientationChanged SIGNAL to handle orientation
// switching
connect(CalenDayUtils::instance()->mainWindow(),
SIGNAL(orientationChanged(Qt::Orientation)), this,
SLOT(orientationChanged(Qt::Orientation)));
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:34,代码来源:calendaycontentscrollarea.cpp
示例7: QWidget
TupRuler::TupRuler(Qt::Orientation rulerType, QWidget *parent) : QWidget(parent), k(new Private)
{
k->currentTransformation = None;
k->rulerType = rulerType;
k->origin = 0.0;
k->oldPos = 0.0;
k->rulerZoom = 1.0;
k->currentZoomFactor = 1;
k->arrow = QPolygonF(3);
if (rulerType == Qt::Horizontal) {
setMaximumHeight(20);
setMinimumHeight(20);
k->arrow << QPointF(0.0, 0.0);
k->arrow << QPointF(5.0, 5.0);
k->arrow << QPointF(10.0, 0.0);
k->arrow.translate(0, 14);
} else {
setMaximumWidth(20);
setMinimumWidth(20);
k->arrow << QPointF(0.0, 0.0);
k->arrow << QPointF(5.0, 5.0);
k->arrow << QPointF(0.0, 10.0);
k->arrow.translate(14, 0);
}
QFont ruleFont(font().family(), 7);
setFont(ruleFont);
}
开发者ID:nanox,项目名称:tupi,代码行数:34,代码来源:tupruler.cpp
示例8: QWidget
RDCardSelector::RDCardSelector(QWidget *parent)
: QWidget(parent)
{
card_id=-1;
yoffset=0;
//
// Fix the Window Size
//
setMinimumWidth(sizeHint().width());
setMaximumWidth(sizeHint().width());
setMinimumHeight(sizeHint().height());
setMaximumHeight(sizeHint().height());
yoffset=0;
//
// Title
//
card_title=new QLabel(this,"card_title");
card_title->setGeometry(0,0,geometry().width(),19);
card_title->setFont(QFont("Helvetica",12,QFont::Bold));
card_title->setAlignment(AlignHCenter);
card_title->hide();
//
// Card
//
card_card_box=new QSpinBox(this,"card_card_box");
card_card_box->setGeometry(60,yoffset,50,19);
card_card_box->setSpecialValueText("None");
card_card_box->setMinValue(-1);
card_card_box->setMaxValue(RD_MAX_CARDS-1);
card_card_box->setValue(-1);
connect(card_card_box,SIGNAL(valueChanged(int)),this,SLOT(cardData(int)));
card_card_label=new QLabel(card_card_box,tr("Card:"),this,
"card_card_label");
card_card_label->setGeometry(0,yoffset+2,55,19);
card_card_label->setAlignment(AlignRight|ShowPrefix);
//
// Port
//
card_port_box=new QSpinBox(this,"card_port_box");
card_port_box->setGeometry(60,yoffset+22,50,19);
card_port_box->setSpecialValueText("None");
card_port_box->setMinValue(-1);
card_port_box->setMaxValue(RD_MAX_PORTS-1);
card_port_box->setValue(-1);
connect(card_port_box,SIGNAL(valueChanged(int)),this,SLOT(portData(int)));
card_port_label=new QLabel(card_port_box,tr("Port:"),this,
"card_port_label");
card_port_label->setGeometry(0,yoffset+24,55,19);
card_port_label->setAlignment(AlignRight|ShowPrefix);
for(int i=0;i<RD_MAX_CARDS;i++) {
card_max_ports[i] = 0;
cardData(i);
}
card_port_box->setDisabled(true);
}
开发者ID:radio-helsinki-graz,项目名称:rivendell,代码行数:60,代码来源:rdcardselector.cpp
示例9: setMinimumHeight
void Wormsign::hideHW(){
if(showHideHW->isChecked()){
int height = 1000;
int width = 1000;
setMinimumHeight(height); setMaximumHeight(height);
setMinimumWidth(width); setMaximumWidth(width);
showHideHW->setText(QString("<< Hide Config"));
}else{
int height = 1000;
int width = 645;
setMinimumHeight(height); setMaximumHeight(height);
setMinimumWidth(width); setMaximumWidth(width);
showHideHW->setText(QString(">> Show Config"));
}
};
开发者ID:LabLouis,项目名称:eLife_2015,代码行数:16,代码来源:wormsign.cpp
示例10: QWidget
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
tCZoneSwitchWidget::tCZoneSwitchWidget( const int index, QWidget* pParent, bool enableZoomIcons )
: QWidget( pParent )
,m_Index(index)
,m_EnableZoomIcons(enableZoomIcons)
{
setMaximumWidth(WIDTH);
}
开发者ID:dulton,项目名称:53_hero,代码行数:10,代码来源:tCZoneSwitchWidget.cpp
示例11: QPushButton
LayerButton::LayerButton(const QString &text, QWidget *parent)
: QPushButton(text, parent) {
setToggleButton(true);
setOn(true);
setMaximumWidth(LayerButton::btnSize());
setMaximumHeight(LayerButton::btnSize());
}
开发者ID:narunlifescience,项目名称:AlphaPlot,代码行数:7,代码来源:MultiLayer.cpp
示例12: QWidget
ProjectTree::ProjectTree(QWidget *parent) :
QWidget(parent)
{
setMaximumWidth(250);
m_mainLayout = new QHBoxLayout(this);
setLayout(m_mainLayout);
m_treeWidget = new QTreeWidget(this);
m_treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
m_treeWidget->setColumnCount(1);
m_treeWidget->setHeaderLabel(tr("Название проекта"));
m_sourcesLabel = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString(tr("Исходные файлы"))));
m_sourcesLabel->setIcon(0, QIcon(":/icons/actions/edit-find.png"));
m_treeWidget->insertTopLevelItem(0, m_sourcesLabel);
m_headersLabel = new QTreeWidgetItem((QTreeWidget*)0, QStringList(QString(tr("Заголовочные файлы"))));
m_headersLabel->setIcon(0, QIcon(":/icons/actions/document-new.png"));
m_treeWidget->insertTopLevelItem(0, m_headersLabel);
m_mainLayout->addWidget(m_treeWidget);
m_deleteAction = new QAction(QIcon(":/icons/actions/edit-undo.png"), tr("Удалить из проекта"), this);
QObject::connect(m_deleteAction, SIGNAL(triggered(bool)), this, SLOT(deleteItem()));
QObject::connect(m_treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(onItemClicked(QTreeWidgetItem*,int)));
QObject::connect(m_treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenu(QPoint)));
}
开发者ID:gitter-badger,项目名称:mur-ide,代码行数:29,代码来源:projecttree.cpp
示例13: QDockWidget
RackWidget::RackWidget(Context& ctx, QWidget *parent) :
QDockWidget(parent), ui(new Ui::RackWidget), ctx(ctx) {
ui->setupUi(this);
// sizing
setMinimumWidth(760+20);
setMaximumWidth(760+20);
// QVBoxLayout* lay0 = new QVBoxLayout();
// lay0->setSpacing(1);
// lay0->setMargin(0);
// ui->scrollArea->setLayout(lay0);
QWidget* w = new QWidget(nullptr);
lay = new QVBoxLayout(ui->scrollArea);
lay->setSpacing(1);
lay->setMargin(0);
w->setLayout(lay);
ui->scrollArea->setWidget(w);
//QVBoxLayout* layScroll = new QVBoxLayout(ui->scrollArea);
//layScroll->addWidget(w);
ui->scrollArea->setStyleSheet("QScrollArea > QWidget {background-color: black;}");
}
开发者ID:seijikun,项目名称:KSynth,代码行数:26,代码来源:RackWidget.cpp
示例14: display_filter
void CChkResultDialog::update_scrollArea()
{
scrollArea->hide();
m_pMultipleChkResult->update_result();
if(m_pMultipleChkResult->width() > QApplication::desktop()->width()*2/3)
{
scrollArea->setMinimumWidth(QApplication::desktop()->width()*2/3);
}
else
{
scrollArea->setMinimumWidth(m_pMultipleChkResult->width() + 50);
}
scrollArea->setMinimumHeight(scrollArea->height());
if(comboBox->currentIndex() == 1)
{
display_filter(1);
}
scrollArea->show();
adjustSize();
setMaximumWidth(width());
setMaximumHeight(height());
}
开发者ID:muz0xd,项目名称:GostHashValidator,代码行数:28,代码来源:ChkResultDialog.cpp
示例15: setMaximumWidth
void DownloadItem::parentResized(const QSize &size)
{
if (size.width() < 200) {
return;
}
setMaximumWidth(size.width());
}
开发者ID:593in,项目名称:qupzilla,代码行数:7,代码来源:downloaditem.cpp
示例16: EdLevelSoundThumbnail
EdLevelResourceSound::EdLevelResourceSound (const FilePath &path)
{
EdLevelSoundThumbnail *item = new EdLevelSoundThumbnail(this);
item->setSound(path);
item->setMaximumWidth(128);
item->setMinimumWidth(128);
item->setMaximumHeight(128);
item->setMinimumHeight(128);
QLabel *title = new QLabel(this);
title->setMaximumWidth(200);
title->setMinimumWidth(200);
title->setText(path.file_name().c_str());
QGridLayout *layout = new QGridLayout;
layout->setContentsMargins(2,2,2,2);
layout->setHorizontalSpacing(0);
layout->setVerticalSpacing(0);
layout->setColumnStretch(1,1);
layout->addWidget(item,1,0);
layout->addWidget(title,0,0);
setLayout(layout);
setMinimumHeight(15+2+128);
setMinimumWidth(200);
setMaximumWidth(200);
}
开发者ID:9heart,项目名称:DT3,代码行数:29,代码来源:EdLevelResourceSound.cpp
示例17: KLineEdit
dmsBox::dmsBox(QWidget *parent, bool dg)
: KLineEdit(parent), EmptyFlag(true) {
setMaxLength(14);
setMaximumWidth(160);
setDegType( dg );
connect( this, SIGNAL( textChanged( const QString & ) ), this, SLOT( slotTextChanged( const QString & ) ) );
}
开发者ID:spacetime,项目名称:kstars-hackfest,代码行数:8,代码来源:dmsbox.cpp
示例18: QString
void MainWindow::slotVCardReceived( QString jid, QString name )
{
roster.value( jid )->name = name;
QString temp = name + QString( "\n" ) + roster[ jid ]->statusMsg;
roster.value( jid )->contactEntry->setText( temp );
setMaximumWidth( contactsList->width() + mainToolBar->width() + 15 );
repaint();
}
开发者ID:engleek,项目名称:wisp,代码行数:8,代码来源:mainwindow.cpp
示例19: setPreferredWidth
void TimelineGraphicsLayout::setWidth(int width)
{
m_rulerItem->setSizeHints(width);
m_placeholder1->setMinimumWidth(width);
m_placeholder2->setMinimumWidth(width);
setPreferredWidth(width);
setMaximumWidth(width);
}
开发者ID:kai66673,项目名称:qt-creator,代码行数:8,代码来源:timelinegraphicslayout.cpp
示例20: QLineEdit
ZLQtApplicationWindow::LineEditParameter::LineEditParameter(QToolBar *toolbar, ZLQtApplicationWindow &window, const ZLToolbar::TextFieldItem &textFieldItem) : QLineEdit(toolbar), myWindow(window), myActionId(textFieldItem.actionId()) {
setAlignment(Qt::AlignHCenter);
setFocusPolicy(ClickFocus);
setMaxLength(textFieldItem.maxWidth());
setMaximumWidth(textFieldItem.maxWidth() * 12 + 12);
QToolTip::add(this, QString::fromUtf8(textFieldItem.tooltip().c_str()));
myWindow.addVisualParameter(textFieldItem.parameterId(), this);
}
开发者ID:TodorGrin,项目名称:boox-opensource,代码行数:8,代码来源:ZLQtApplicationWindow.cpp
注:本文中的setMaximumWidth函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论