📄 qt_widget_toolbar2.c
字号:
// ============================================================================//// Copyright (c) 1997-2000 The CGAL Consortium//// This software and related documentation is part of an INTERNAL release// of the Computational Geometry Algorithms Library (CGAL). It is not// intended for general use.//// ----------------------------------------------------------------------------//// file : demo/Qt_widget/Max_k-gon/Qt_widget_toolbar.C// package : Qt_widget// author(s) : Radu Ursu// release : // release_date : //// coordinator : Laurent Rineau <rineau@clipper.ens.fr>//// ============================================================================#ifdef CGAL_USE_QT#include <CGAL/IO/Qt_widget.h>#include "Qt_widget_toolbar2.h"// icons#include <CGAL/IO/pixmaps/movepoint.xpm>#include <CGAL/IO/pixmaps/polygon.xpm>#include <CGAL/IO/pixmaps/arrow.xpm>#include <qiconset.h>Tools_toolbar::Tools_toolbar(CGAL::Qt_widget *w, QMainWindow *mw, std::list<Cgal_Polygon> *l1) : QToolBar(mw, "NT") {// w->attach(&move_deletebut); w->attach(&polygonbut);// move_deletebut.deactivate(); polygonbut.deactivate();// move_deletebut.pass_the_structure(l1); //set the widget widget = w; QIconSet set0(QPixmap( (const char**)arrow_small_xpm ), QPixmap( (const char**)arrow_xpm ));// QIconSet set2(QPixmap( (const char**)movepoint_small_xpm ),// QPixmap( (const char**)movepoint_xpm )); QIconSet set1(QPixmap( (const char**)polygon_small_xpm ), QPixmap( (const char**)polygon_xpm )); but[0] = new QToolButton(this, "deactivate layer"); but[0]->setIconSet(set0); but[0]->setTextLabel("Deactivate Layer");// but[2] = new QToolButton(this, "move/delete layer");// but[2]->setIconSet(set2);// but[2]->setTextLabel("Move/Delete Point"); but[1] = new QToolButton(this, "polygon layer"); but[1]->setIconSet(set1); but[1]->setTextLabel("Polygon layer"); nr_of_buttons = 2; button_group = new QButtonGroup(0, "My_group"); for(int i = 0; i<nr_of_buttons; i++) { button_group->insert(but[i]); but[i]->setToggleButton(true); } button_group->setExclusive(true); // connect(but[2], SIGNAL(stateChanged(int)),// &move_deletebut, SLOT(stateChanged(int))); connect(but[1], SIGNAL(stateChanged(int)), &polygonbut, SLOT(stateChanged(int)));};#include "Qt_widget_toolbar2.moc"#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -