本文整理汇总了C++中QTabWidget::setFocusPolicy方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setFocusPolicy方法的具体用法?C++ QTabWidget::setFocusPolicy怎么用?C++ QTabWidget::setFocusPolicy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setFocusPolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: file
EDATool::EDATool() {
this->setWindowTitle(tr("EDATool"));
boardScene = new QGraphicsScene();
boardView = new BoardView(this, boardScene);
if (!QCoreApplication::arguments().contains("-nogl"))
boardView->setViewport(new QGLWidget);
QTabWidget *tabs = new QTabWidget(this);
tabs->setFocusPolicy(Qt::NoFocus); // don't let the tab header itself steal focus
tabs->addTab(boardView, QString("Document"));
tabs->setDocumentMode(true);
this->setCentralWidget(tabs);
QDockWidget *temp = new QDockWidget(this);
QTreeWidget *tree = new QTreeWidget(this);
temp->setWindowTitle("Tool settings");
temp->setWidget(tree);
tree->setColumnCount(1);
tree->setHeaderLabel("Name");
this->addDockWidget(Qt::LeftDockWidgetArea, temp);
this->fileMenu = this->menuBar()->addMenu(tr("File"));
this->editMenu = this->menuBar()->addMenu(tr("Edit"));
this->placeMenu = this->menuBar()->addMenu(tr("&Place"));
QLabel *t = new QLabel("LOL FU");
t->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
this->statusBar()->addPermanentWidget(t);
t = new QLabel("MOAR TESTING");
t->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
this->statusBar()->addPermanentWidget(t);
this->statusBar()->showMessage("showmessage", 2000);
resize(700, 500);
//Board board;
toolBar = addToolBar("Tools");
toolBar->setIconSize(QSize(16, 16));
toolActionGroup = new QActionGroup(this);
SelectTool *selTool = new SelectTool(this);
selTool->install();
RouteTool *tool = new RouteTool(this);
tool->install();
cache = new QHash<QString, QGraphicsItemGroup*>();
QFile file("C:\\Users\\andreas\\workspace\\edatool\\test.brd");
EagleFormat *eagleFormat = new EagleFormat();
eagleFormat->read(&file,cache);
QHashIterator<QString, QGraphicsItemGroup*> i(*cache);
while (i.hasNext()) {
i.next();
QTreeWidgetItem *item = new QTreeWidgetItem(tree, QStringList(i.key()));
}
connect(tree,SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),this,SLOT(itemClicked(QTreeWidgetItem*,QTreeWidgetItem*)));
}