本文整理汇总了C++中setResizeMode函数的典型用法代码示例。如果您正苦于以下问题:C++ setResizeMode函数的具体用法?C++ setResizeMode怎么用?C++ setResizeMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setResizeMode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setResizeMode
void QLayout::freeze( int w, int h )
{
if ( w <= 0 || h <= 0 ) {
setResizeMode( Fixed );
} else {
setResizeMode( FreeResize ); // layout will not change min/max size
mainWidget()->setFixedSize( w, h );
}
}
示例2: QDeclarativeView
APMToolBar::APMToolBar(QWidget *parent):
QDeclarativeView(parent), m_uas(0)
{
// Configure our QML object
// Hack to fix QTBUG 34300 on OSX where QDir::currentPath has changed behavior. This causes
// relative paths to inside the .app package to fail.
#ifdef Q_OS_MAC
bool test123;
QString qmlFile = QApplication::applicationDirPath();
qmlFile.append("/qml/ApmToolBar.qml");
setSource(QUrl::fromLocalFile(qmlFile));
#else
setSource(QUrl::fromLocalFile("qml/ApmToolBar.qml"));
#endif
setResizeMode(QDeclarativeView::SizeRootObjectToView);
this->rootContext()->setContextProperty("globalObj", this);
connect(LinkManager::instance(),SIGNAL(newLink(LinkInterface*)),
this, SLOT(updateLinkDisplay(LinkInterface*)));
if (LinkManager::instance()->getLinks().count()>=3) {
updateLinkDisplay(LinkManager::instance()->getLinks().last());
}
setConnection(false);
connect(UASManager::instance(),SIGNAL(activeUASSet(UASInterface*)),this,SLOT(activeUasSet(UASInterface*)));
activeUasSet(UASManager::instance()->getActiveUAS());
}
示例3: setObjectName
void KbLayoutWidget::initUI() {
setObjectName("KeyboardLayoutFrame");
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setSelectionMode(QAbstractItemView::NoSelection);
setResizeMode(Adjust);
for (int i = 0; i < m_buttons.length(); i++) {
LayoutButton* itemButton = new LayoutButton(m_buttons[i]);
m_layoutButtons.append(itemButton);
itemButton->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);
QFrame* borderFrame = new QFrame;
borderFrame->setObjectName("LayoutBorderFrame");
QVBoxLayout* borderLayout = new QVBoxLayout;
borderLayout->setContentsMargins(0, 0, 0, 0);
borderLayout->setSpacing(0);
borderLayout->addWidget(itemButton);
borderFrame->setLayout(borderLayout);
borderFrame->setFixedSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT);
QListWidgetItem* item = new QListWidgetItem(this);
item->sizeHint();
this->addItem(item);
setItemWidget(item, borderFrame);
this->setGridSize(QSize(widget_width, DDESESSIONCC::LAYOUTBUTTON_HEIGHT));
this->setFixedWidth(widget_width);
}
this->setFixedHeight(DDESESSIONCC::LAYOUTBUTTON_HEIGHT*3);
updateStyle(":/skin/keybdlayoutwidget.qss", this);
}
示例4: QQuickView
KDevSplashScreen::KDevSplashScreen()
: QQuickView()
{
setFlags(Qt::FramelessWindowHint | Qt::SplashScreen);
setResizeMode(QQuickView::SizeViewToRootObject);
setSource(QUrl(QStringLiteral("qrc:/kdevelop/splash.qml")));
if (!rootObject()) {
qWarning() << "Could not load KDevelop splash screen";
hide(); // hide instead of showing garbage
return;
}
if (rootObject()) {
rootObject()->setProperty("appIcon",
QUrl::fromLocalFile(KIconLoader().iconPath("kdevelop", -48)));
rootObject()->setProperty("appVersionMajor", VERSION_MAJOR);
rootObject()->setProperty("appVersionMinor", VERSION_MINOR);
rootObject()->setProperty("appVersionPatch", VERSION_PATCH);
}
QRect geo = geometry();
geo.moveCenter(screen()->geometry().center());
setGeometry(geo);
}
示例5: KIconView
TIconView::TIconView( QWidget *parent, const char* name )
: KIconView( parent, name ), _module(0L)
{
setResizeMode( Adjust );
setItemsMovable( false );
setItemTextPos( Right );
setGridX( 200 );
setGridY( 70 );
QFont f = font();
f.setWeight( QFont::Bold );
setFont( f );
setShowToolTips( false );
KConfig *config = KGlobal::config();
config->setGroup("Extra");
showExtras = config->readNumEntry( "Selected" );
toolTip = 0;
connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( slotItemSelected( QIconViewItem* ) ) );
/* comment those signals due to bug#7761
connect( this, SIGNAL( executed( QIconViewItem* ) ), SLOT( removeToolTip()) );
connect( this, SIGNAL( onItem( QIconViewItem* ) ), SLOT( showToolTip( QIconViewItem* ) ) );
connect( this, SIGNAL( onViewport() ), SLOT( removeToolTip() ) );
*/
}
示例6: QHeaderView
ViewHeader::ViewHeader( QAbstractItemView* parent )
: QHeaderView( Qt::Horizontal, parent )
, m_parent( parent )
, m_menu( new QMenu( this ) )
, m_sigmap( new QSignalMapper( this ) )
, m_init( false )
{
m_menu->setFont( TomahawkUtils::systemFont() );
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
setSectionResizeMode( QHeaderView::Interactive );
setSectionsMovable( true );
#else
setResizeMode( QHeaderView::Interactive );
setMovable( true );
#endif
setMinimumSectionSize( 60 );
setDefaultAlignment( Qt::AlignLeft );
setStretchLastSection( true );
// m_menu->addAction( tr( "Resize columns to fit window" ), this, SLOT( onToggleResizeColumns() ) );
// m_menu->addSeparator();
connect( m_sigmap, SIGNAL( mapped( int ) ), SLOT( toggleVisibility( int ) ) );
}
示例7: QDeclarativeView
MainWidget::MainWidget(QWidget *parent)
: QDeclarativeView(parent)
{
// Switch to fullscreen in device
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
setWindowState(Qt::WindowFullScreen);
#endif
setResizeMode(QDeclarativeView::SizeRootObjectToView);
// Register Tile to be available in QML
qmlRegisterType<Tile>("gameCore", 1, 0, "Tile");
// Setup context
m_context = rootContext();
m_context->setContextProperty("mainWidget", this);
m_context->setContextProperty("gameData", &m_gameData);
// Set view optimizations not already done for QDeclarativeView
setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground);
// Make QDeclarativeView use OpenGL backend
QGLWidget *glWidget = new QGLWidget(this);
setViewport(glWidget);
setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
// Open root QML file
setSource(QUrl(filename));
}
示例8: QQuickWidget
StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, StatesEditorModel *statesEditorModel)
: QQuickWidget(),
m_statesEditorView(statesEditorView),
m_imageProvider(0),
m_qmlSourceUpdateShortcut(0)
{
m_imageProvider = new Internal::StatesEditorImageProvider;
m_imageProvider->setNodeInstanceView(statesEditorView->nodeInstanceView());
engine()->addImageProvider(QStringLiteral("qmldesigner_stateseditor"), m_imageProvider);
engine()->addImportPath(qmlSourcesPath());
m_qmlSourceUpdateShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F4), this);
connect(m_qmlSourceUpdateShortcut, SIGNAL(activated()), this, SLOT(reloadQmlSource()));
setResizeMode(QQuickWidget::SizeRootObjectToView);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
rootContext()->setContextProperty(QStringLiteral("statesEditorModel"), statesEditorModel);
rootContext()->setContextProperty(QLatin1String("canAddNewStates"), true);
Theming::insertTheme(&m_themeProperties);
rootContext()->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
Theming::registerIconProvider(engine());
setWindowTitle(tr("States", "Title of Editor widget"));
// init the first load of the QML UI elements
reloadQmlSource();
}
示例9: d_ptr
TListView::TListView(TListViewPrivate &dd): d_ptr(&dd)
{
//Q_D(TListView);
//d->q_ptr = this;
setWrapping(true);
setResizeMode(QListView::Adjust);
}
示例10: QQuickView
PfdQmlGadgetWidget::PfdQmlGadgetWidget(QWindow *parent) :
QQuickView(parent)
{
setResizeMode(SizeRootObjectToView);
objectsToExport << "VelocityActual" <<
"PositionActual" <<
"AltitudeHoldDesired" <<
"AttitudeActual" <<
"AirspeedActual" <<
"Accels" <<
"VelocityDesired" <<
"StabilizationDesired" <<
"PathDesired" <<
"HomeLocation" <<
"Waypoint" <<
"WaypointActive" <<
"GPSPosition" <<
"GCSTelemetryStats" <<
"FlightBatteryState";
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
m_objManager = pm->getObject<UAVObjectManager>();
foreach (const QString &objectName, objectsToExport) {
exportUAVOInstance(objectName, 0);
}
示例11: QDeclarativeView
QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
: QDeclarativeView(parent)
, d(new QtQuick1ApplicationViewerPrivate())
{
connect(engine(), SIGNAL(quit()), SLOT(close()));
setResizeMode(QDeclarativeView::SizeRootObjectToView);
}
示例12: QListView
WidgetBoxCategoryListView::WidgetBoxCategoryListView(QDesignerFormEditorInterface *core, QWidget *parent) :
QListView(parent),
m_proxyModel(new QSortFilterProxyModel(this)),
m_model(new WidgetBoxCategoryModel(core, this))
{
setFocusPolicy(Qt::NoFocus);
setFrameShape(QFrame::NoFrame);
setIconSize(QSize(22, 22));
setSpacing(1);
setTextElideMode(Qt::ElideMiddle);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setResizeMode(QListView::Adjust);
setUniformItemSizes(true);
setItemDelegate(new WidgetBoxCategoryEntryDelegate(this));
connect(this, SIGNAL(pressed(QModelIndex)), this, SLOT(slotPressed(QModelIndex)));
setEditTriggers(QAbstractItemView::AnyKeyPressed);
m_proxyModel->setSourceModel(m_model);
m_proxyModel->setFilterRole(FilterRole);
setModel(m_proxyModel);
connect(m_model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(scratchPadChanged()));
}
示例13: IndirectDataTablePresenter
JumpFitDataTablePresenter::JumpFitDataTablePresenter(JumpFitModel *model,
QTableWidget *dataTable)
: IndirectDataTablePresenter(model, dataTable, jumpFitHeaders()),
m_jumpFitModel(model) {
auto header = dataTable->horizontalHeader();
header->setResizeMode(1, QHeaderView::Stretch);
}
示例14: QListWidget
Smb4KSharesView::Smb4KSharesView(QWidget *parent)
: QListWidget(parent)
{
setMouseTracking(true);
setSelectionMode(ExtendedSelection);
setResizeMode(Adjust);
setSortingEnabled(true);
setWordWrap(true);
setAcceptDrops(true);
setDragEnabled(true);
setDropIndicatorShown(true);
setUniformItemSizes(true);
setWrapping(true);
setContextMenuPolicy(Qt::CustomContextMenu);
m_tooltipItem = 0;
m_mouseInside = false;
// Connections:
connect(this, SIGNAL(itemEntered(QListWidgetItem*)),
this, SLOT(slotItemEntered(QListWidgetItem*)));
connect(this, SIGNAL(viewportEntered()),
this, SLOT(slotViewportEntered()));
}
示例15: QDeclarativeView
RocketBar::MainWidget::MainWidget(
RocketBar::Context *config, QWidget *parent)
: QDeclarativeView(parent), mContext(config),
mLauncherList(QList<QObject*>()),
mAppletList(QList<QObject*> ())
{
/* initialize a borderless panel window */
setFocus(Qt::ActiveWindowFocusReason);
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
setAttribute(Qt::WA_TranslucentBackground);
setAttribute(Qt::WA_X11NetWmWindowTypeDock);
setStyleSheet("border-style: none;background:transparent;");
setResizeMode(QDeclarativeView::SizeRootObjectToView);
engine()->addImageProvider(QLatin1String("xdg"), mContext->mImageProvider);
engine()->addImageProvider(QLatin1String("task"),
mContext->mWindowManager->taskImageProvider());
engine()->addImageProvider(QLatin1String("applet"),
mContext->mAppletImageProvider);
buildMenu();
buildLauncher();
buildApplets();
updateWindow();
connect(mContext->mWindowManager,
SIGNAL(windowsChanged(WindowManager::WindowList&)),
this, SLOT(updateWindows(WindowManager::WindowList&)));
}