command.h
来自「qt-x11-free-3.0.3.tar.gz minigui图形界面工具」· C头文件 代码 · 共 893 行 · 第 1/2 页
H
893 行
int index; bool show; QWidget *page; QString pageLabel;};class RenameWizardPageCommand : public Command{public: RenameWizardPageCommand( const QString &n, FormWindow *fw, QWizard *w, int index, const QString& name ); void execute(); void unexecute(); Type type() const { return RenameWizardPage; }private: QWizard *wizard; int index; QWidget *page; QString label;};class SwapWizardPagesCommand : public Command{public: SwapWizardPagesCommand( const QString &n, FormWindow *fw, QWizard *w, int index1, int index2 ); void execute(); void unexecute(); Type type() const { return SwapWizardPages; }private: QWizard *wizard; int index1, index2;};class AddConnectionCommand : public Command{public: AddConnectionCommand( const QString &name, FormWindow *fw, MetaDataBase::Connection c ); void execute(); void unexecute(); Type type() const { return AddConnection; }private: MetaDataBase::Connection connection;};class RemoveConnectionCommand : public Command{public: RemoveConnectionCommand( const QString &name, FormWindow *fw, MetaDataBase::Connection c ); void execute(); void unexecute(); Type type() const { return RemoveConnection; }private: MetaDataBase::Connection connection;};class AddSlotCommand : public Command{public: AddSlotCommand( const QString &name, FormWindow *fw, const QCString &s, const QString& spec, const QString &a, const QString &l, const QString &rt ); void execute(); void unexecute(); Type type() const { return AddSlot; }private: QCString slot; QString specifier; QString access; QString language; QString returnType;};class RemoveSlotCommand : public Command{public: RemoveSlotCommand( const QString &name, FormWindow *fw, const QCString &s, const QString& spec, const QString &a, const QString &l, const QString &rt ); void execute(); void unexecute(); Type type() const { return RemoveSlot; }private: QCString slot; QString specifier; QString access; QString language; QString returnType;};class LowerCommand : public Command{public: LowerCommand( const QString &name, FormWindow *fw, const QWidgetList &w ); void execute(); void unexecute(); Type type() const { return Lower; }private: QWidgetList widgets;};class RaiseCommand : public Command{public: RaiseCommand( const QString &name, FormWindow *fw, const QWidgetList &w ); void execute(); void unexecute(); Type type() const { return Raise; }private: QWidgetList widgets;};class PasteCommand : public Command{public: PasteCommand( const QString &n, FormWindow *fw, const QWidgetList &w ); void execute(); void unexecute(); Type type() const { return Paste; }private: QWidgetList widgets;};class TabOrderCommand : public Command{public: TabOrderCommand( const QString &n, FormWindow *fw, const QWidgetList &ol, const QWidgetList &nl ); void execute(); void unexecute(); Type type() const { return TabOrder; } void merge( Command *c ); bool canMerge( Command *c );private: QWidgetList oldOrder, newOrder;};class PopulateListBoxCommand : public Command{public: struct Item { QString text; QPixmap pix;#if defined(Q_FULL_TEMPLATE_INSTANTIATION) bool operator==( const Item & ) const { return FALSE; }#endif }; PopulateListBoxCommand( const QString &n, FormWindow *fw, QListBox *lb, const QValueList<Item> &items ); void execute(); void unexecute(); Type type() const { return PopulateListBox; } bool operator==( const PopulateListBoxCommand & ) const;private: QValueList<Item> oldItems, newItems; QListBox *listbox;};class PopulateIconViewCommand : public Command{public: struct Item { QString text; QPixmap pix;#if defined(Q_FULL_TEMPLATE_INSTANTIATION) bool operator==( const Item & ) const { return FALSE; }#endif }; PopulateIconViewCommand( const QString &n, FormWindow *fw, QIconView *iv, const QValueList<Item> &items ); void execute(); void unexecute(); Type type() const { return PopulateIconView; } bool operator==( const PopulateIconViewCommand & ) const;private: QValueList<Item> oldItems, newItems; QIconView *iconview;};class PopulateListViewCommand : public Command{public: PopulateListViewCommand( const QString &n, FormWindow *fw, QListView *lv, QListView *from ); void execute(); void unexecute(); Type type() const { return PopulateListView; } static void transferItems( QListView *from, QListView *to ); bool operator==( const PopulateListViewCommand & ) const;private: QListView *oldItems, *newItems; QListView *listview;};class PopulateMultiLineEditCommand : public Command{public: PopulateMultiLineEditCommand( const QString &n, FormWindow *fw, QMultiLineEdit *mle, const QString &txt ); void execute(); void unexecute(); Type type() const { return PopulateMultiLineEdit; }private: QString newText, oldText; QMultiLineEdit *mlined; bool wasChanged;};class PopulateTableCommand : public Command{public: struct Row { QString text; QPixmap pix;#if defined(Q_FULL_TEMPLATE_INSTANTIATION) bool operator==( const Row& ) const { return FALSE; }#endif }; struct Column { QString text; QPixmap pix; QString field;#if defined(Q_FULL_TEMPLATE_INSTANTIATION) bool operator==( const Column& ) const { return FALSE; }#endif }; PopulateTableCommand( const QString &n, FormWindow *fw, QTable *t, const QValueList<Row> &rows, const QValueList<Column> &columns ); void execute(); void unexecute(); Type type() const { return PopulateTable; }private: QValueList<Row> oldRows, newRows; QValueList<Column> oldColumns, newColumns; QTable *table;};class AddActionToToolBarCommand : public Command{public: AddActionToToolBarCommand( const QString &n, FormWindow *fw, QAction *a, QDesignerToolBar *tb, int idx ); void execute(); void unexecute(); Type type() const { return AddActionToToolBar; }private: QAction *action; QDesignerToolBar *toolBar; int index;};class RemoveActionFromToolBarCommand : public AddActionToToolBarCommand{public: RemoveActionFromToolBarCommand( const QString &n, FormWindow *fw, QAction *a, QDesignerToolBar *tb, int idx ) : AddActionToToolBarCommand( n, fw, a, tb, idx ) {} void execute() { AddActionToToolBarCommand::unexecute(); } void unexecute() { AddActionToToolBarCommand::execute(); } Type type() const { return RemoveActionFromToolBar; }};class AddActionToPopupCommand : public Command{public: AddActionToPopupCommand( const QString &n, FormWindow *fw, QAction *a, QDesignerPopupMenu *p, int idx ); void execute(); void unexecute(); Type type() const { return AddActionToPopup; }private: QAction *action; QDesignerPopupMenu *popup; int index;};class RemoveActionFromPopupCommand : public AddActionToPopupCommand{public: RemoveActionFromPopupCommand( const QString &n, FormWindow *fw, QAction *a, QDesignerPopupMenu *p, int idx ) : AddActionToPopupCommand( n, fw, a, p, idx ) {} void execute() { AddActionToPopupCommand::unexecute(); } void unexecute() { AddActionToPopupCommand::execute(); } Type type() const { return RemoveActionFromPopup; }};class AddMenuCommand : public Command{public: AddMenuCommand( const QString &n, FormWindow *fw, QMainWindow *mw ); void execute(); void unexecute(); Type type() const { return AddMenu; }protected: QDesignerMenuBar *menuBar; QDesignerPopupMenu *popup; QMainWindow *mainWindow; int id; int index; QString name;};class RemoveMenuCommand : public AddMenuCommand{public: RemoveMenuCommand( const QString &n, FormWindow *fw, QMainWindow *mw, QDesignerMenuBar *mb, QDesignerPopupMenu *p, int i, int idx, const QString &mn ) : AddMenuCommand( n, fw, mw ) { menuBar = mb; popup = p; id = i; index = idx, name = mn; } void execute() { AddMenuCommand::unexecute(); } void unexecute() { AddMenuCommand::execute(); } Type type() const { return RemoveMenu; }};class RenameMenuCommand : public Command{public: RenameMenuCommand( const QString &n, FormWindow *fw, QDesignerMenuBar *mb, int i, const QString &on, const QString &nn ); void execute(); void unexecute(); Type type() const { return RenameMenu; }private: QDesignerMenuBar *menuBar; int id; QString oldName, newName;};class MoveMenuCommand : public Command{public: MoveMenuCommand( const QString &n, FormWindow *fw, QDesignerMenuBar *mb, QDesignerPopupMenu *p, int fidx, int tidx, const QString &txt ); void execute(); void unexecute(); Type type() const { return MoveMenu; }private: QDesignerMenuBar *menuBar; QDesignerPopupMenu *popup; int fromIdx, toIdx; QString text;};class AddToolBarCommand : public Command{public: AddToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw ); void execute(); void unexecute(); Type type() const { return AddToolBar; }protected: QDesignerToolBar *toolBar; QMainWindow *mainWindow;};class RemoveToolBarCommand : public AddToolBarCommand{public: RemoveToolBarCommand( const QString &n, FormWindow *fw, QMainWindow *mw, QDesignerToolBar *tb ) : AddToolBarCommand( n, fw, mw ) { toolBar = tb; } void execute() { AddToolBarCommand::unexecute(); } void unexecute() { AddToolBarCommand::execute(); } Type type() const { return RemoveToolBar; }};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?