toolfactory.cc

来自「c++的guiQt做的开发」· CC 代码 · 共 41 行

CC
41
字号
/** @file ToolFactory class, factory that will create special toobar items @author Martin Petricek*/#include "toolfactory.h"//The toolbar items to create//in future ...//Other includes needed#include "toolbar.h"#include <util.h>#include <qobject.h>#include <qstring.h>namespace gui {/** Check if given item name is a special item and load it if it is special item @param tb Toolbar for addition of item @param item Item name @param main Main window associated with this special item @return Pointer to button, if special item was loaded and inserted into toolbar, NULL if item is not a special item*/QWidget *ToolFactory::specialItem(ToolBar *,const QString &item,QMainWindow *) { //All special items start with underscore character if (!item.startsWith("_")) return NULL; QString itemName=item.section(' ',0,0); QString itemParam=item.section(' ',1);/* if (itemName=="_zoom_tool") {  //Add ZoomTool to toolbar and return  ZoomTool *tool =new ZoomTool(tb,"zoom");  //init ...  tool->show();  return tool; }*/ return NULL;}} // namespace gui

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?