本文整理汇总了C++中QScrollArea::setFocusProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollArea::setFocusProxy方法的具体用法?C++ QScrollArea::setFocusProxy怎么用?C++ QScrollArea::setFocusProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QScrollArea
的用法示例。
在下文中一共展示了QScrollArea::setFocusProxy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCommDeviceController
BTSettingsMainWindow::BTSettingsMainWindow(QWidget *parent, Qt::WFlags fl)
: QMainWindow(parent, fl), m_localDevice(new QBluetoothLocalDevice(this)),
m_controller(0)
{
if (!m_localDevice->isValid()) {
QLabel *label = new QLabel(tr("(Bluetooth not available.)"));
label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
label->setWordWrap(true);
label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setCentralWidget(label);
return;
}
QScrollArea* scroll = new QScrollArea();
scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
scroll->setWidgetResizable(true);
scroll->setFrameStyle(QFrame::NoFrame);
m_menu = QSoftMenuBar::menuFor(this);
m_tabs = new QTabWidget();
m_controller =
new QCommDeviceController(m_localDevice->deviceName().toLatin1(), this);
SettingsDisplay *settings = new SettingsDisplay(m_localDevice, m_controller);
scroll->setWidget(settings);
scroll->setFocusProxy(settings);
m_tabs->addTab(scroll, tr("Settings"));
// Delay initialization of tabs other than the first
m_tabs->addTab(new QWidget, tr("Paired Devices"));
m_tabs->setTabEnabled(1, false);
m_tabs->setCurrentIndex(0);
// change the context menu when the tab changes
connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(tabChanged(int)));
// set the current context menu
tabChanged(m_tabs->currentIndex());
setCentralWidget(m_tabs);
setWindowTitle(tr("Bluetooth"));
QTimer::singleShot(0, this, SLOT(init()));
}