本文整理汇总了C++中QDockWidget::setProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ QDockWidget::setProperty方法的具体用法?C++ QDockWidget::setProperty怎么用?C++ QDockWidget::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDockWidget
的用法示例。
在下文中一共展示了QDockWidget::setProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLocked
void KoDockWidgetTitleBar::setLocked(bool locked)
{
QDockWidget *q = qobject_cast<QDockWidget*>(parentWidget());
d->locked = locked;
d->lockButton->blockSignals(true);
d->lockButton->setChecked(locked);
d->lockButton->blockSignals(false);
//qDebug() << "setlocked" << q << d->locked << locked;
if (locked) {
d->features = q->features();
q->setFeatures(QDockWidget::NoDockWidgetFeatures);
}
else {
q->setFeatures(d->features);
}
q->toggleViewAction()->setEnabled(!locked);
d->closeButton->setEnabled(!locked);
d->floatButton->setEnabled(!locked);
d->collapseButton->setEnabled(!locked);
d->updateIcons();
q->setProperty("Locked", locked);
resizeEvent(0);
}
示例2: ViewButtonClicked
void TitleWidget::ViewButtonClicked(void)
{
QDockWidget* Dock = qobject_cast<QDockWidget*>(parent());
if (Dock->isFloating())
{
if (Dock->geometry() == QApplication::desktop()->availableGeometry(Dock))
{
Dock->setGeometry(Dock->property("last-geometry").toRect());
}
else
{
Dock->setProperty("last-geometry", Dock->geometry());
Dock->setGeometry(QApplication::desktop()->availableGeometry(Dock));
}
}
else Dock->setFloating(true);
}
示例3: ui_companion_qt_init
//.........这里部分代码省略.........
browserWidget = new QWidget();
browserWidget->setLayout(new QVBoxLayout());
browserWidget->setObjectName("browserWidget");
browserDownloadsButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY));
browserUpButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP));
browserStartButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES));
QObject::connect(browserDownloadsButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserDownloadsClicked()));
QObject::connect(browserUpButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserUpClicked()));
QObject::connect(browserStartButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserStartClicked()));
browserButtonsHBoxLayout = new QHBoxLayout();
browserButtonsHBoxLayout->addWidget(browserUpButton);
browserButtonsHBoxLayout->addWidget(browserStartButton);
browserButtonsHBoxLayout->addWidget(browserDownloadsButton);
qobject_cast<QVBoxLayout*>(browserWidget->layout())->addLayout(browserButtonsHBoxLayout);
browserWidget->layout()->addWidget(mainwindow->dirTreeView());
browserAndPlaylistTabWidget = mainwindow->browserAndPlaylistTabWidget();
browserAndPlaylistTabWidget->setObjectName("browserAndPlaylistTabWidget");
/* Several functions depend on the same tab title strings here, so if you change these, make sure to change those too
* setCoreActions()
* onTabWidgetIndexChanged()
* onCurrentListItemChanged()
*/
browserAndPlaylistTabWidget->addTab(playlistWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS));
browserAndPlaylistTabWidget->addTab(browserWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER));
browserAndPlaylistTabDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER), mainwindow);
browserAndPlaylistTabDock->setObjectName("browserAndPlaylistTabDock");
browserAndPlaylistTabDock->setProperty("default_area", Qt::LeftDockWidgetArea);
browserAndPlaylistTabDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER));
browserAndPlaylistTabDock->setWidget(browserAndPlaylistTabWidget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(browserAndPlaylistTabDock->property("default_area").toInt()), browserAndPlaylistTabDock);
browserButtonsHBoxLayout->addItem(new QSpacerItem(browserAndPlaylistTabWidget->tabBar()->width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
thumbnailWidget = new ThumbnailWidget();
thumbnail2Widget = new ThumbnailWidget();
thumbnail3Widget = new ThumbnailWidget();
thumbnailWidget->setLayout(new QVBoxLayout());
thumbnail2Widget->setLayout(new QVBoxLayout());
thumbnail3Widget->setLayout(new QVBoxLayout());
thumbnailWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail2Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail3Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail = new ThumbnailLabel();
thumbnail->setObjectName("thumbnail");
thumbnail2 = new ThumbnailLabel();
thumbnail2->setObjectName("thumbnail2");
thumbnail3 = new ThumbnailLabel();
thumbnail3->setObjectName("thumbnail3");
thumbnail->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
示例4: ui_companion_qt_init
//.........这里部分代码省略.........
browserWidget = new QWidget();
browserWidget->setLayout(new QVBoxLayout());
browserWidget->setObjectName("browserWidget");
browserDownloadsButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY));
browserUpButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER_UP));
browserStartButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FAVORITES));
QObject::connect(browserDownloadsButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserDownloadsClicked()));
QObject::connect(browserUpButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserUpClicked()));
QObject::connect(browserStartButton, SIGNAL(clicked()), mainwindow, SLOT(onBrowserStartClicked()));
browserButtonsHBoxLayout = new QHBoxLayout();
browserButtonsHBoxLayout->addWidget(browserUpButton);
browserButtonsHBoxLayout->addWidget(browserStartButton);
browserButtonsHBoxLayout->addWidget(browserDownloadsButton);
qobject_cast<QVBoxLayout*>(browserWidget->layout())->addLayout(browserButtonsHBoxLayout);
browserWidget->layout()->addWidget(mainwindow->dirTreeView());
browserAndPlaylistTabWidget = mainwindow->browserAndPlaylistTabWidget();
browserAndPlaylistTabWidget->setObjectName("browserAndPlaylistTabWidget");
/* Several functions depend on the same tab title strings here, so if you change these, make sure to change those too
* setCoreActions()
* onTabWidgetIndexChanged()
* onCurrentListItemChanged()
*/
browserAndPlaylistTabWidget->addTab(playlistWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_PLAYLISTS));
browserAndPlaylistTabWidget->addTab(browserWidget, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_TAB_FILE_BROWSER));
browserAndPlaylistTabDock = new QDockWidget(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER), mainwindow);
browserAndPlaylistTabDock->setObjectName("browserAndPlaylistTabDock");
browserAndPlaylistTabDock->setProperty("default_area", Qt::LeftDockWidgetArea);
browserAndPlaylistTabDock->setProperty("menu_text", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_DOCK_CONTENT_BROWSER));
browserAndPlaylistTabDock->setWidget(browserAndPlaylistTabWidget);
mainwindow->addDockWidget(static_cast<Qt::DockWidgetArea>(browserAndPlaylistTabDock->property("default_area").toInt()), browserAndPlaylistTabDock);
browserButtonsHBoxLayout->addItem(new QSpacerItem(browserAndPlaylistTabWidget->tabBar()->width(), 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
thumbnailWidget = new ThumbnailWidget();
thumbnail2Widget = new ThumbnailWidget();
thumbnail3Widget = new ThumbnailWidget();
thumbnailWidget->setLayout(new QVBoxLayout());
thumbnail2Widget->setLayout(new QVBoxLayout());
thumbnail3Widget->setLayout(new QVBoxLayout());
thumbnailWidget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail2Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail3Widget->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail = new ThumbnailLabel();
thumbnail->setObjectName("thumbnail");
thumbnail2 = new ThumbnailLabel();
thumbnail2->setObjectName("thumbnail2");
thumbnail3 = new ThumbnailLabel();
thumbnail3->setObjectName("thumbnail3");
thumbnail->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail2->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
thumbnail3->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));