本文整理汇总了C++中setMaximumWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ setMaximumWidth函数的具体用法?C++ setMaximumWidth怎么用?C++ setMaximumWidth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setMaximumWidth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
}
}
示例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);
}
示例3: QPushButton
MyPushButton::MyPushButton(int index) : QPushButton(0)
{
_index = index;
setCheckable(true);
setMaximumWidth(30);
connect(this, SIGNAL(toggled(bool)), this, SLOT(handleClick()));
}
示例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();
}
示例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);
}
示例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)));
}
示例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);
}
示例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);
}
示例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"));
}
};
示例10: QWidget
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
tCZoneSwitchWidget::tCZoneSwitchWidget( const int index, QWidget* pParent, bool enableZoomIcons )
: QWidget( pParent )
,m_Index(index)
,m_EnableZoomIcons(enableZoomIcons)
{
setMaximumWidth(WIDTH);
}
示例11: QPushButton
LayerButton::LayerButton(const QString &text, QWidget *parent)
: QPushButton(text, parent) {
setToggleButton(true);
setOn(true);
setMaximumWidth(LayerButton::btnSize());
setMaximumHeight(LayerButton::btnSize());
}
示例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)));
}
示例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;}");
}
示例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());
}
示例15: setMaximumWidth
void DownloadItem::parentResized(const QSize &size)
{
if (size.width() < 200) {
return;
}
setMaximumWidth(size.width());
}