diff --git a/src/KMultiFormListBox/ccp.h b/src/KMultiFormListBox/ccp.h index a0c3704..3d8b866 100644 --- a/src/KMultiFormListBox/ccp.h +++ b/src/KMultiFormListBox/ccp.h @@ -1,65 +1,65 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __ccp #define __ccp #include class KMultiFormListBoxMultiVisible; class KMultiFormListBoxEntry; /** Helper class for @ref KMultiFormListBoxMultiVisible which is used to install EventFilters. When the user presses CTRL + right mouse button then a menu should appear which offers him cut and paste capabilities for the entries in the KMultiFormListBoxMultiVisible. To obtain this an event filter must be install for each subwidget of the KMultiFormListBoxMultiVisible. This event filter must catch the right mouse press event and post the menu. This requires a widget which has the method @ref eventFilter defined. We have this helper class exactly for this purpose. For each @ref KMultiFormListBoxEntry in the @ref KMultiFormListBoxMultiVisible widget an instance of this class is associated. CCP stand for Cut Copy and Paste @internal **/ class CCP : public QObject { Q_OBJECT private: friend class KMultiFormListBoxMultiVisible; /** * Constructor is private so only the class @ref KMultiFormListBoxMultiVisible may create an * instance of this widget. **/ CCP(KMultiFormListBoxMultiVisible *, KMultiFormListBoxEntry *); void install(QObject *); bool eventFilter(QObject *, QEvent *) override; // Instance variables. - KMultiFormListBoxMultiVisible *ee; - KMultiFormListBoxEntry *eee; + KMultiFormListBoxMultiVisible *ee = nullptr; + KMultiFormListBoxEntry *eee = nullptr; }; #endif /* ccp */ diff --git a/src/KMultiFormListBox/indexWindow.h b/src/KMultiFormListBox/indexWindow.h index aedfab3..f399615 100644 --- a/src/KMultiFormListBox/indexWindow.h +++ b/src/KMultiFormListBox/indexWindow.h @@ -1,84 +1,84 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __indexWindow #define __indexWindow #include class QListWidget; /** Post a toplevel listbox synchronously. When the user presses the Idx button in the @ref KMultiFormListBox, then a listbox with the elements from the KMultiFormListBox must be shown. From this listbox the user should chose the element he wants to scroll to. This widget takes care of posting this listbox, and ensuring that the user can not do anything else before he has chosen an element. This widget resembles the behavior of @ref QPopupMenu, the difference is, however, that the QPopupMenu can not handle that the elements in the menu exceed the size of the screen. This widget can. In the future this widget may be replaced with the QPopupMenu if the QPopupMenu can handle this situation. But for now - it works! @internal **/ class indexWindow : public QWidget { Q_OBJECT public: indexWindow(); /** This method inserts an element into the listbox which is shown when the @ref exec method is invoked. **/ void insertItem(const QString &txt); /** This function shows the index window with the elements inserted using the @ref insertItem function. The function will not return before the user has chosen an element in the listbox, or have pressed the right mouse button outside the window. As a result of returning from this function, the listbox is hidden. @param start The upper left corner of the pop-up window. @param width The width of the window @return The index of the element chosen, or -1 if no element has been chosen. **/ int exec(const QPoint &start, int width); protected: void finish(int retVal); void hideEvent(QHideEvent *h) override; protected Q_SLOTS: void lbSelected(int); private: - QListWidget *lb; + QListWidget *lb = nullptr; bool lbFinish; int itemSelected; }; #endif /* indexWindow */ diff --git a/src/KMultiFormListBox/kmultiformlistbox-windowed.h b/src/KMultiFormListBox/kmultiformlistbox-windowed.h index 851cddb..24e3d40 100644 --- a/src/KMultiFormListBox/kmultiformlistbox-windowed.h +++ b/src/KMultiFormListBox/kmultiformlistbox-windowed.h @@ -1,81 +1,81 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __kmultiformlistboxwindowed #define __kmultiformlistboxwindowed #include #include "kmultiformlistbox-shower.h" class QVBoxLayout; class QListWidgetItem; class QListWidget; class WindowListboxItem; class KMultiFormListBoxFactory; class QPushButton; /** This class implements the windowed look for a @ref KMultiFormListBox @internal */ class KMultiFormListBoxWindowed : public QWidget, KMultiFormListBoxShower { Q_OBJECT friend class KMultiFormListBox; private: KMultiFormListBoxWindowed(KMultiFormListBoxFactory *factory, QWidget *parent, bool showUpDownButtons, bool showHelpButton, const QString &addButtonText); KMultiFormListBoxEntryList elements() override; const KMultiFormListBoxEntryList elements() const; void append(KMultiFormListBoxEntry *) override; WindowListboxItem *selected(); QWidget *qWidget() override { return this; } - QVBoxLayout *_layout; - KMultiFormListBoxFactory *_factory; + QVBoxLayout *_layout = nullptr; + KMultiFormListBoxFactory *_factory = nullptr; QList _buttonList; - QListWidget *_listbox; + QListWidget *_listbox = nullptr; void delElement(QWidget *) override; // Deletes the given element void delAnElement() override; void addElement() override; public Q_SLOTS: void addNewElement(); Q_SIGNALS: void showHelp(); private Q_SLOTS: void slotEditSelected(); void slotEditSelected(QListWidgetItem *item); void slotCopySelected(); void slotMoveItemUp(); void slotMoveItemDown(); void slotDeleteEntry(); void slotUpdateButtonState(); }; #endif /* kmultiformlistboxwindowed */ diff --git a/src/KMultiFormListBox/kmultiformlistbox.h b/src/KMultiFormListBox/kmultiformlistbox.h index 196632f..82a388d 100644 --- a/src/KMultiFormListBox/kmultiformlistbox.h +++ b/src/KMultiFormListBox/kmultiformlistbox.h @@ -1,113 +1,113 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __kmultiformlistbox #define __kmultiformlistbox #include "kmultiformlistboxentry.h" #include class QDataStream; class KMultiFormListBoxFactory; class KMultiFormListBoxShower; typedef QList KMultiFormListBoxEntryList; typedef QList WidgetList; /** The main class used to get an KMultiFormListBox widget. The KMultiFormListBox widget consist of a sub-widget which is repeated a number of times, it is up to the end user to determine the number of times the sub widget is repeated, and he may require an additional copy simply by pressing a ``Add'' or ``More Entries'' button. The KMultiFormListBox widget has two different faces (i.e. two different end user interfaces). One (Windowed) will show a listbox from which the end user can access each subwidget containing data by pressing the LMB on a name for the element. The other face (MultiVisible) shows all the subwidgets in one huge ``Listbox''. To use the KMultiFormListBox widget you must create a class which is inherited from the @ref KMultiFormListBoxFactory class. This new class must override the function `create'. This function must return a freshly made instance of the class @ref KMultiFormListBoxEntry (or a subclass of this). The KMultiFormListBoxEntry instance is the one inserted into the KMultiFormListBox widget (one instance for each sub widget in the KMultiFormListBox widget). @author Jesper Kjær Pedersen **/ class KMultiFormListBox : public QWidget { Q_OBJECT public: enum KMultiFormListBoxType { MultiVisible, Windowed }; /** @param factory A factory used to generate the instances of KMultiFormListBoxEntry class which is repeated in the KMultiFormListBox @param parent A pointer to the parent widget **/ explicit KMultiFormListBox(KMultiFormListBoxFactory *factory, KMultiFormListBoxType tp = Windowed, QWidget *parent = nullptr, bool showUpDownButtons = true, bool showHelpButton = true, QString addButtonText = i18n("Add")); /** @return The elements in the KMultiFormListBox. **/ KMultiFormListBoxEntryList elements(); const KMultiFormListBoxEntryList elements() const; /** TODO. **/ void append(KMultiFormListBoxEntry *); /** write data out to stream */ void toStream(QDataStream &stream) const; /** reads data in from stream */ void fromStream(QDataStream &stream); public Q_SLOTS: /** Adds an empty element to the KMultiFormListBox. This slot is only required for the @ref MultiVisible face. It should be connected to a button which lets the user know that he may get more elements in this KMultiFormListBox by pressing it. The button should be labeled ``More Entries'' or something similar. **/ void addElement(); // Adds an empty element to the KMultiFormListBox /** Changes the face of the KMultiFormListBox. @param face The new face of the KMultiFormListBox **/ void slotChangeFace(KMultiFormListBoxType newFace); private: - KMultiFormListBoxShower *theWidget; - KMultiFormListBoxFactory *_factory; + KMultiFormListBoxShower *theWidget = nullptr; + KMultiFormListBoxFactory *_factory = nullptr; }; #endif /* kmultiformlistbox */ diff --git a/src/KMultiFormListBox/widgetwindow.h b/src/KMultiFormListBox/widgetwindow.h index 438ef5b..3cb96ba 100644 --- a/src/KMultiFormListBox/widgetwindow.h +++ b/src/KMultiFormListBox/widgetwindow.h @@ -1,57 +1,57 @@ #ifndef WIDGETWINDOW_H #define WIDGETWINDOW_H /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #include class QListWidget; class KMultiFormListBoxFactory; class KMultiFormListBoxEntry; class WindowListboxItem; /** @internal */ class WidgetWindow : public QDialog { friend class KMultiFormListBoxWindowed; friend class WindowListboxItem; WidgetWindow(KMultiFormListBoxFactory *, QListWidget *); WidgetWindow(KMultiFormListBoxFactory *, KMultiFormListBoxEntry *widget, QListWidget *); void init(KMultiFormListBoxFactory *, QListWidget *, KMultiFormListBoxEntry *widget = nullptr); void display(); KMultiFormListBoxEntry *entry(); WidgetWindow *clone(); ~WidgetWindow(); protected Q_SLOTS: void slotOk(); void slotCancel(); private: - KMultiFormListBoxFactory *myFact; - KMultiFormListBoxEntry *myWidget; + KMultiFormListBoxFactory *myFact = nullptr; + KMultiFormListBoxEntry *myWidget = nullptr; QByteArray _backup; - QListWidget *listbox; - WindowListboxItem *myListboxItem; + QListWidget *listbox = nullptr; + WindowListboxItem *myListboxItem = nullptr; bool initialShow; }; #endif // WIDGETWINDOW_H diff --git a/src/KMultiFormListBox/windowlistboxitem.h b/src/KMultiFormListBox/windowlistboxitem.h index dc367af..8b5a3fc 100644 --- a/src/KMultiFormListBox/windowlistboxitem.h +++ b/src/KMultiFormListBox/windowlistboxitem.h @@ -1,46 +1,46 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __windowlistboxitem #define __windowlistboxitem #include class WidgetWindow; class KMultiFormListBoxWindowed; class KMultiFormListBoxEntry; /** @internal */ class WindowListboxItem : public QListWidgetItem { friend class WidgetWindow; friend class KMultiFormListBoxWindowed; public: WindowListboxItem(QListWidget *, const QString &, WidgetWindow *); ~WindowListboxItem(); void cloneItem(); void displayWidget(); KMultiFormListBoxEntry *entry(); private: - WidgetWindow *myItem; + WidgetWindow *myItem = nullptr; }; #endif // __windowlistboxitem diff --git a/src/characterswidget.h b/src/characterswidget.h index 6ce0097..1465edd 100644 --- a/src/characterswidget.h +++ b/src/characterswidget.h @@ -1,156 +1,163 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef characterswidget #define characterswidget #include #include "kmultiformlistbox.h" #include "kmultiformlistboxfactory.h" #include "regexpwidget.h" class CharacterEdits; class TextRangeRegExp; class CharSelector; class QCheckBox; /** RegExp widget for charcter ranges. @internal */ class CharactersWidget : public RegExpWidget { public: CharactersWidget(RegExpEditorWindow *editorWindow, QWidget *parent); CharactersWidget(TextRangeRegExp *regexp, RegExpEditorWindow *editorWindow, QWidget *parent); ~CharactersWidget() override; QSize sizeHint() const override; RegExp *regExp() const override; RegExpType type() const override { return CHARSET; } RegExpWidget *findWidgetToEdit(QPoint globalPos) override; int edit() override; protected: void paintEvent(QPaintEvent *event) override; QString text() const; QString title() const; private: TextRangeRegExp *_regexp = nullptr; static CharacterEdits *_configWindow; mutable QSize _textSize; mutable QSize _contentSize; }; /** @internal */ class SingleEntry : public KMultiFormListBoxEntry { public: explicit SingleEntry(QWidget *parent); QString text() const; void setText(const QString &text); bool isEmpty() const; private: - CharSelector *_selector; + CharSelector *_selector = nullptr; }; /** @internal */ class RangeEntry : public KMultiFormListBoxEntry { public: explicit RangeEntry(QWidget *parent); QString fromText() const; QString toText() const; void setFrom(const QString &text); void setTo(const QString &text); bool isEmpty() const; private: CharSelector *_from = nullptr; CharSelector *_to = nullptr; }; /** @internal */ class SingleFactory : public KMultiFormListBoxFactory { public: KMultiFormListBoxEntry *create(QWidget *parent) override { return new SingleEntry(parent); } QWidget *separator(QWidget *) override { return nullptr; } }; /** @internal */ class RangeFactory : public KMultiFormListBoxFactory { public: KMultiFormListBoxEntry *create(QWidget *parent) override { return new RangeEntry(parent); } QWidget *separator(QWidget *) override { return nullptr; } }; /** @internal */ class CharacterEdits : public QDialog { Q_OBJECT public: explicit CharacterEdits(QWidget *parent = nullptr); public Q_SLOTS: void setRegexp(TextRangeRegExp *regexp); protected Q_SLOTS: void slotOK(); private: - QCheckBox *negate, *wordChar, *_nonWordChar, *digit, *_nonDigit, *space, *_nonSpace; - KMultiFormListBox *_single, *_range; + QCheckBox *negate = nullptr; + QCheckBox *wordChar = nullptr; + QCheckBox *_nonWordChar = nullptr; + QCheckBox *digit = nullptr; + QCheckBox *_nonDigit = nullptr; + QCheckBox *space = nullptr; + QCheckBox *_nonSpace = nullptr; + KMultiFormListBox *_single = nullptr; + KMultiFormListBox *_range = nullptr; void addCharacter(const QString &txt); void addRange(const QString &from, const QString &to); - TextRangeRegExp *_regexp; + TextRangeRegExp *_regexp = nullptr; }; #endif // characterswidget diff --git a/src/compoundregexp.h b/src/compoundregexp.h index 1036a9d..ceae1ad 100644 --- a/src/compoundregexp.h +++ b/src/compoundregexp.h @@ -1,81 +1,81 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef COMPOUNDREGEXP_H #define COMPOUNDREGEXP_H #include "regexp.h" /** Abstract syntax node for `compound content' regular expression @internal */ class CompoundRegExp : public RegExp { public: explicit CompoundRegExp(bool selected, const QString &title = QString(), const QString &description = QString(), bool hidden = false, bool allowReplace = false, RegExp *child = nullptr); bool check(ErrorMap &, bool first, bool last) override; int precedence() const override { return _child->precedence(); } QDomNode toXml(QDomDocument *doc) const override; bool load(const QDomElement &, const QString &version) override; QString title() const { return _title; } QString description() const { return _description; } RegExp *child() const { return _child; } bool hidden() const { return _hidden; } bool allowReplace() const { return _allowReplace; } RegExpType type() const override { return COMPOUND; } bool operator==(const RegExp &other) const override; private: QString _title; QString _description; bool _hidden; bool _allowReplace; - RegExp *_child; + RegExp *_child = nullptr; }; #endif // COMPOUNDREGEXP_H diff --git a/src/regexp.h b/src/regexp.h index c178e6f..d9d3648 100644 --- a/src/regexp.h +++ b/src/regexp.h @@ -1,93 +1,93 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef REGEXP_H #define REGEXP_H #include #include #include #include class CompoundRegExp; class ErrorMap; /** Abstract syntax tree for regular expressions. @internal */ class RegExp { public: RegExp(bool selected); virtual ~RegExp(); virtual int precedence() const = 0; virtual QDomNode toXml(QDomDocument *doc) const = 0; virtual bool load(const QDomElement &, const QString &version) = 0; QString toXmlString() const; void check(ErrorMap &); virtual bool check(ErrorMap &, bool first, bool last) = 0; void addChild(RegExp *child); void removeChild(RegExp *child); void setParent(RegExp *parent); RegExp *clone() const; virtual bool operator==(const RegExp &other) const { return type() == other.type(); } enum RegExpType { CONC, TEXT, DOT, POSITION, REPEAT, ALTN, COMPOUND, LOOKAHEAD, TEXTRANGE }; virtual RegExpType type() const = 0; virtual void replacePart(CompoundRegExp * /* replacement */) { } bool isSelected() const { return _selected; } void setSelected(bool b) { _selected = b; } protected: RegExp *readRegExp(const QDomElement &top, const QString &version); private: RegExp() { } // disable QList _children; - RegExp *_parent; + RegExp *_parent = nullptr; bool _destructing; bool _selected; }; typedef QList RegExpList; typedef QListIterator RegExpListIt; typedef QList::iterator RegExpListStlIt; #endif // REGEXP_H diff --git a/src/regexpeditorwindow.h b/src/regexpeditorwindow.h index d0475a9..4c909f5 100644 --- a/src/regexpeditorwindow.h +++ b/src/regexpeditorwindow.h @@ -1,290 +1,290 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef regexpeditorwindow_h #define regexpeditorwindow_h #include #include "widgetfactory.h" class ConcWidget; class QMenu; class QHBoxLayout; /** Widget representing the editor window of a regular expression editor. @internal This widget represent the editor part (That is the location where the regexp widgets are located). Furthermore, it also responsible for: @li Widget traversal operations (see e.g. @ref hasSelection, @ref clearSelection, and @ref applyRegExpToSelection ). @li Containing global information for regexp editing. (See @ref _pasteData and @ref _insertInAction ) All subclasses of @ref RegExpWidget contains a pointer to the @ref RegExpEditorWindow which the widget is a child of. They use this pointer to start operations like rubber band selection, cut/paste etc. */ class RegExpEditorWindow : public QWidget { Q_OBJECT public: explicit RegExpEditorWindow(QWidget *parent); ~RegExpEditorWindow() override; /** Returns an object which represent the regular expression "drawn" in the editor window. This object is capable of generating a textual representation of the regexp (see @ref RegExp::emacs, and @ref RegExp::perl etc) */ RegExp *regExp() const; /** This method returns true if the rectangle starting at `globalPos' with size `size' overlaps the rubber-band rectangle. Note this method is only valid while doing rubber-band selection. Afterwards, use @ref pointSelected instead. */ bool selectionOverlap(QPoint globalPos, QSize size) const; /** returns true if `pos' lays on top of a widget that is selected. */ bool pointSelected(QPoint pos) const; /** returns true if the editor has a selection. */ bool hasSelection() const; /** clears the selection, and if `update', invokes update on all the widgets */ void clearSelection(bool update); /** invoked update on the top widget, and ensures that `focusChild' is visible. It's valid for `focusChild' to be 0. */ void updateContent(QWidget *focusChild); RegExp *pasteData() { return _pasteData; } bool isPasteing() const { return _pasteInAction; } bool isInserting() const { return _insertInAction; } /** Returns the type currently being inserted. This is the type, which was given to @ref slotInsertRegExp */ RegExpType insertType() const { return _insertTp; } /** Create a regexp widget, so that it wraps around the current selected regexp. */ void applyRegExpToSelection(RegExpType tp); /** Pops up the RMB menu, which contains cut, copy, past, ... */ void showRMBMenu(bool enableCutCopy); QSize sizeHint() const override; public Q_SLOTS: /** Set the editor window to the regular expression given as argument */ void slotSetRegExp(RegExp *regexp); /** Change editing mode to insertion. This means that the cursor will change to a cross (where ever inserting of the `type' is allowed), and the next mouse press in allowed places will result in that a regular expression of type `type' will be inserted there. Note this method do not do the actual insertion. This method is used when the user presses one of the buttons to the right of the editor window. */ void slotInsertRegExp(RegExpType type); /** Change editing state to selection. */ void slotDoSelect(); /** Like @ref slotInsertRegExp above. This time, however, data will be submitted in as a RegExp pointer. Note this method do not do the actual insertion. This method is called when the user pastes data (using the RPM menu), or when a regular expression is loaded from file. */ void slotInsertRegExp(RegExp *regexp); /** see @ref RegExpWidget::deleteSelection */ void slotDeleteSelection(); /** This method is invoked when the user selects paste in the RMB menu. It will change the mouse cursor etc. as described in @ref slotInsertRegExp */ void slotStartPasteAction(); /** Ends an insert or paste action. This involves changing cursor back to normal cursor. */ void slotEndActions(); void emitChange() { Q_EMIT change(); } void updateCursorUnderPoint(); void slotCut(); void slotCopy(); void slotSave(); Q_SIGNALS: /** This signal is emitted whenever the content of the editor window is changed. If focusPoint is non-null then this point should be made visible */ void contentChanged(QPoint focusPoint); /** This signal is emitted whenever mouse is being dragged in the editor window. `focusPoint' is the mouse' current position. */ void scrolling(QPoint focusPoint); /** see @ref RegExpScrolledEditorWindow::doneEditing */ void doneEditing(); /** see @ref RegExpScrolledEditorWindow::change */ void change(); /** see @ref RegExpScrolledEditorWindow::savedRegexp */ void savedRegexp(); /** see @ref RegExpScrolledEditorWindow::verifyRegExp */ void verifyRegExp(); void anythingSelected(bool); void anythingOnClipboard(bool); void canSave(bool); protected: void mousePressEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void paintEvent(QPaintEvent *event) override; protected Q_SLOTS: virtual void emitVerifyRegExp(); void editWidget(); private: void cutCopyAux(QPoint pos); void copy(QPoint pos); void cut(QPoint pos); private: /** This points to the top @ref RegExpWidget in the editor window. */ ConcWidget *_top; /** This points to the layout manager for the editor window */ QHBoxLayout *_layout; /** This points to the edit widget */ QPoint _PosEdit; /** Start point and last point draw. Used when doing rubber band selection */ QPoint _start, _lastPoint; /** The area which the rubber band selection is over */ QRect _selection; /** true when a paste action is in action (see @ref isPasteing ). */ bool _pasteInAction; /** true when an insert action is in action (see @ref isInserting ). */ bool _insertInAction; /** The type being inserted (see @ref insertType ) */ RegExpType _insertTp; /** The data being inserted (see @ref pasteData ) */ - RegExp *_pasteData; + RegExp *_pasteData = nullptr; /** Popup menu used for RMB */ - QMenu *_menu; + QMenu *_menu = nullptr; - QAction *_cutAction; - QAction *_copyAction; - QAction *_pasteAction; - QAction *_editAction; - QAction *_saveAction; + QAction *_cutAction = nullptr; + QAction *_copyAction = nullptr; + QAction *_pasteAction = nullptr; + QAction *_editAction = nullptr; + QAction *_saveAction = nullptr; QIcon getIcon(const QString &name); bool _isDndOperation; }; #endif // regexpeditorwindow_h diff --git a/src/repeatregexp.h b/src/repeatregexp.h index 4c61460..f617982 100644 --- a/src/repeatregexp.h +++ b/src/repeatregexp.h @@ -1,73 +1,73 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __REPEATREGEXP_H #define __REPEATREGEXP_H #include "regexp.h" /** Abstract syntax node for `repeated content' regular expression @internal */ class RepeatRegExp : public RegExp { public: explicit RepeatRegExp(bool selected, int lower = 0, int upper = 0, RegExp *child = nullptr); bool check(ErrorMap &, bool first, bool last) override; int precedence() const override { return 3; } QDomNode toXml(QDomDocument *doc) const override; bool load(const QDomElement &, const QString &version) override; int min() const { return _lower; } int max() const { return _upper; } RegExp *child() const { return _child; } RegExpType type() const override { return REPEAT; } bool operator==(const RegExp &other) const override; void replacePart(CompoundRegExp *replacement) override { _child->replacePart(replacement); } private: int _lower; int _upper; - RegExp *_child; + RegExp *_child = nullptr; }; #endif // __REPEATREGEXP_H diff --git a/src/repeatwidget.h b/src/repeatwidget.h index bd0944e..7891939 100644 --- a/src/repeatwidget.h +++ b/src/repeatwidget.h @@ -1,104 +1,104 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __repeatwidget #define __repeatwidget #include "singlecontainerwidget.h" class QGroupBox; class QButtonGroup; class QDialog; class QSpinBox; class RepeatRegExp; class QGridLayout; /** Widget containging the configuration for a @ref RepeatWidget @internal */ class RepeatRangeWindow : public QWidget { Q_OBJECT public: enum REPEATTYPE { ANY, ATLEAST, ATMOST, EXACTLY, MINMAX }; // krazy:exclude=spelling RepeatRangeWindow(QWidget *parent); QString text(); int min(); int max(); void set(REPEATTYPE tp, int min, int max); protected Q_SLOTS: void slotItemChange(int which); void slotUpdateMinVal(int minVal); void slotUpdateMaxVal(int minVal); private: void createLine(QGridLayout *layout, const QString &text, QSpinBox **spin, REPEATTYPE tp); - QSpinBox *_leastTimes; - QSpinBox *_mostTimes; - QSpinBox *_exactlyTimes; - QSpinBox *_rangeFrom; - QSpinBox *_rangeTo; - QGroupBox *_groupWidget; - QButtonGroup *_group; + QSpinBox *_leastTimes = nullptr; + QSpinBox *_mostTimes = nullptr; + QSpinBox *_exactlyTimes = nullptr; + QSpinBox *_rangeFrom = nullptr; + QSpinBox *_rangeTo = nullptr; + QGroupBox *_groupWidget = nullptr; + QButtonGroup *_group = nullptr; }; /** RegExp widget for `repeated content' @internal */ class RepeatWidget : public SingleContainerWidget { Q_OBJECT public: RepeatWidget(RegExpEditorWindow *editorWindow, QWidget *parent); RepeatWidget(RepeatRegExp *regexp, RegExpEditorWindow *editorWindow, QWidget *parent); void init(); QSize sizeHint() const override; RegExp *regExp() const override; RegExpType type() const override { return REPEAT; } int edit() override; protected: void paintEvent(QPaintEvent *e) override; protected Q_SLOTS: void slotConfigCanceled(); void slotConfigWindowClosed(); private: - QDialog *_configWindow; - RepeatRangeWindow *_content; + QDialog *_configWindow = nullptr; + RepeatRangeWindow *_content = nullptr; mutable QSize _textSize; mutable QSize _childSize; QByteArray _backup; }; #endif // __repeatwidget diff --git a/src/scrollededitorwindow.h b/src/scrollededitorwindow.h index d6886da..910a182 100644 --- a/src/scrollededitorwindow.h +++ b/src/scrollededitorwindow.h @@ -1,94 +1,94 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __scrolledEditorWindow #define __scrolledEditorWindow #include class QScrollArea; class RegExpEditorWindow; class RegExp; /** Regular Expression editor window. */ class RegExpScrolledEditorWindow : public QWidget { Q_OBJECT public: RegExpScrolledEditorWindow(QWidget *parent); RegExp *regExp(); private: RegExpScrolledEditorWindow() { } // Do not use! protected: void resizeEvent(QResizeEvent *) override; public Q_SLOTS: void slotSetRegExp(RegExp *); void slotInsertRegExp(int); void slotInsertRegExp(RegExp *); void slotDeleteSelection(); void slotDoSelect(); void slotCut(); void slotCopy(); void slotSave(); void slotPaste(); protected Q_SLOTS: void slotUpdateContentSize(QPoint focusPoint); void slotScroll(QPoint focusPoint); Q_SIGNALS: /** This signal is emitted when the user has completed an editing action. The application may chose to call @ref slotDoSelect as a consequence to reset to selection mode. */ void doneEditing(); /** This signal is emitted whenever a change has taken place in the editor widget */ void change(); /** This signal is emitted when the user saves a regular expression. */ void savedRegexp(); void anythingSelected(bool); void anythingOnClipboard(bool); void canSave(bool); /** This signal is emitted when the regular expression has changed, or when the selection has changed. */ void verifyRegExp(); private: - RegExpEditorWindow *_editorWindow; - QScrollArea *_scrollArea; + RegExpEditorWindow *_editorWindow = nullptr; + QScrollArea *_scrollArea = nullptr; }; #endif // __scrolledEditorWindow diff --git a/src/selectablelineedit.h b/src/selectablelineedit.h index 91b0984..e3bd9e8 100644 --- a/src/selectablelineedit.h +++ b/src/selectablelineedit.h @@ -1,55 +1,55 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __selectablelineedit #define __selectablelineedit #include class RegExpWidget; /** A specialized QLineEdit for use in @ref TextWidget. This widget has two main features: @li when the @ref TextWidget which contains it is selected, then the line edit is grayed like the rest of the widgets. @li When the widget does not have the focus, it is resized to only be large enough to contain the text written in it. @internal */ class SelectableLineEdit : public QLineEdit { Q_OBJECT public: explicit SelectableLineEdit(RegExpWidget *owner, QWidget *parent = nullptr, const QString &name = QString()); void setSelected(bool selected); QSize sizeHint() const override; protected Q_SLOTS: void slotKeyPressed(); Q_SIGNALS: void parentPleaseUpdate(); private: - RegExpWidget *_owner; + RegExpWidget *_owner = nullptr; }; #endif diff --git a/src/singlecontainerwidget.h b/src/singlecontainerwidget.h index 46a742e..e66f786 100644 --- a/src/singlecontainerwidget.h +++ b/src/singlecontainerwidget.h @@ -1,53 +1,53 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __singlecontainer #define __singlecontainer #include "regexpwidget.h" /** Abstract class representing RegExp widgets having a single child. */ class SingleContainerWidget : public RegExpWidget { Q_OBJECT public: - SingleContainerWidget(RegExpEditorWindow *editorWindow, QWidget *parent); + explicit SingleContainerWidget(RegExpEditorWindow *editorWindow, QWidget *parent); bool updateSelection(bool parentSelected) override; bool hasSelection() const override; void clearSelection() override; void deleteSelection() override; void applyRegExpToSelection(RegExpType type) override; RegExp *selection() const override; bool validateSelection() const override; QRect selectionRect() const override; RegExpWidget *widgetUnderPoint(QPoint globalPos, bool justVisibleWidgets) override; RegExpWidget *findWidgetToEdit(QPoint globalPos) override; void setConcChild(ConcWidget *child) override; void selectWidget(bool sel) override; void updateAll() override; void updateCursorRecursively() override; protected: - ConcWidget *_child; + ConcWidget *_child = nullptr; }; #endif // __singlecontainer diff --git a/src/textrangeregexp.h b/src/textrangeregexp.h index 1e6b62f..9ae3b6f 100644 --- a/src/textrangeregexp.h +++ b/src/textrangeregexp.h @@ -1,154 +1,154 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __TEXTRANGEREGEXP_H #define __TEXTRANGEREGEXP_H #include "regexp.h" #include #include #include typedef QPair StringPair; /** Abstract syntax node for `text range' regular expression @internal */ class TextRangeRegExp : public RegExp { public: TextRangeRegExp(bool selected); - virtual ~TextRangeRegExp(); + ~TextRangeRegExp() override; void addCharacter(const QString &ch); QStringList chars() const { return _chars; } void clearChars() { _chars.clear(); } void addRange(const QString &from, const QString &to); QList range() const { return _ranges; } void clearRange() { _ranges.clear(); } void setNegate(bool set) { _negate = set; } void setDigit(bool set) { _digit = set; } void setNonDigit(bool set) { _nonDigit = set; } void setSpace(bool set) { _space = set; } void setNonSpace(bool set) { _nonSpace = set; } void setWordChar(bool set) { _wordChar = set; } void setNonWordChar(bool set) { _nonWordChar = set; } bool negate() const { return _negate; } bool digit() const { return _digit; } bool nonDigit() const { return _nonDigit; } bool space() const { return _space; } bool nonSpace() const { return _nonSpace; } bool wordChar() const { return _wordChar; } bool nonWordChar() const { return _nonWordChar; } bool check(ErrorMap &, bool first, bool last) override; int precedence() const override { return 4; } QDomNode toXml(QDomDocument *doc) const override; bool load(const QDomElement &, const QString &version) override; RegExpType type() const override { return TEXTRANGE; } bool operator==(const RegExp &other) const override; private: bool _negate, _digit, _nonDigit, _space, _nonSpace, _wordChar, _nonWordChar; QStringList _chars; QList _ranges; }; #endif // __TEXTRANGEREGEXP_H diff --git a/src/textwidget.h b/src/textwidget.h index 777aa35..642fd51 100644 --- a/src/textwidget.h +++ b/src/textwidget.h @@ -1,64 +1,64 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __textwidget #define __textwidget #include "regexpwidget.h" class SelectableLineEdit; class TextRegExp; /** RegExp widget representing text. @internal */ class TextWidget : public RegExpWidget { Q_OBJECT public: TextWidget(RegExpEditorWindow *editorWindow, QWidget *parent); TextWidget(TextRegExp *regexp, RegExpEditorWindow *editorWindow, QWidget *parent); RegExp *regExp() const override; RegExpType type() const override { return TEXT; } void updateAll() override; void selectWidget(bool) override; protected: void init(const QString &text); void paintEvent(QPaintEvent *e) override; bool updateSelection(bool parentSelected) override; void clearSelection() override; bool eventFilter(QObject *, QEvent *) override; protected Q_SLOTS: void slotUpdate(); private: QString text; - SelectableLineEdit *_edit; + SelectableLineEdit *_edit = nullptr; QSize textSize, boxSize, editSize; }; #endif // __textwidget diff --git a/src/userdefinedregexps.h b/src/userdefinedregexps.h index efe26f6..b52af49 100644 --- a/src/userdefinedregexps.h +++ b/src/userdefinedregexps.h @@ -1,82 +1,82 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef __USERDEFINEDREGEXPS_H #define __USERDEFINEDREGEXPS_H #include #include #include class CompoundRegExp; class QPoint; class RegExp; class UserDefinedRegExps : public QDockWidget { Q_OBJECT public: explicit UserDefinedRegExps(QWidget *parent, const QString &title); const QList regExps() const; public Q_SLOTS: void slotSelectNewAction(); protected Q_SLOTS: void slotLoad(QTreeWidgetItem *item); void slotContextMenuTriggered(const QPoint &pos); void slotPopulateUserRegexps(); void slotUnSelect(); void slotRenameUserRegexp(); void slotDeleteUserRegexp(); protected: void createItems(const QString &title, const QString &dir, bool usersRegExp); Q_SIGNALS: void load(RegExp *); private: - QTreeWidget *_userDefined; + QTreeWidget *_userDefined = nullptr; QList _regExps; }; class WidgetWinItem : public QTreeWidgetItem { public: WidgetWinItem(const QString &name, RegExp *regexp, bool users, QTreeWidgetItem *parent); ~WidgetWinItem(); static QString path(); QString fileName() const; RegExp *regExp() const; QString name() const; void setName(const QString &); bool isUsersRegExp() const { return _usersRegExp; } private: QString _name; - RegExp *_regexp; + RegExp *_regexp = nullptr; bool _usersRegExp; }; #endif // __USERDEFINEDREGEXPS_H diff --git a/src/verifier.h b/src/verifier.h index 5e01261..6967345 100644 --- a/src/verifier.h +++ b/src/verifier.h @@ -1,60 +1,60 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef VERIFIER_H #define VERIFIER_H #include class RegexpHighlighter; class Verifier : public KTextEdit { Q_OBJECT public: explicit Verifier(QWidget *parent); void setHighlighter(RegexpHighlighter *); public Q_SLOTS: void verify(const QString ®exp); void clearRegexp(); void setCaseSensitive(bool); void setMinimal(bool); // I have no way of telling the current paragrahp when highlighting - thefore scrolling to next/prev match // do not work. Enable this when they work. // void gotoFirst(); // void gotoPrev(); // void gotoNext(); // void gotoLast(); //Q_SIGNALS: // void countChanged( int ); // void currentChanged( int ); // void goBackwardPossible( bool ); // void goForwardPossible( bool ); // protected: // void gotoNum( int ); private: int _count; // int _current; - RegexpHighlighter *_highlighter; + RegexpHighlighter *_highlighter = nullptr; }; #endif // VERIFIER_H diff --git a/src/verifybuttons.h b/src/verifybuttons.h index 64fc53d..474a5ee 100644 --- a/src/verifybuttons.h +++ b/src/verifybuttons.h @@ -1,81 +1,81 @@ /* * Copyright (c) 2002-2003 Jesper K. Pedersen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. **/ #ifndef VERIFYBUTTONS_H #define VERIFYBUTTONS_H #include #include class QToolButton; class QLabel; class QAction; class QMenu; class RegExpConverter; class VerifyButtons : public QToolBar { Q_OBJECT public: explicit VerifyButtons(QWidget *parent, const QString &name = QString()); RegExpConverter *setSyntax(const QString &); void setAllowNonQtSyntax(bool); Q_SIGNALS: void verify(); void autoVerify(bool); void loadVerifyText(const QString &); void matchGreedy(bool); // Qt anchors do not work for
...
, thefore scrolling to next/prev match // do not work. Enable this when they work. // void gotoFirst(); // void gotoPrev(); // void gotoNext(); // void gotoLast(); void changeSyntax(const QString &); public Q_SLOTS: // void enableForwardButtons( bool ); // void enableBackwardButtons( bool ); void setMatchCount(int); protected Q_SLOTS: void updateVerifyButton(bool); void loadText(); void slotChangeSyntax(QAction *action); private: - QToolButton *_verify; - QLabel *_matches; - QMenu *_configMenu; - QMenu *_languages; + QToolButton *_verify = nullptr; + QLabel *_matches = nullptr; + QMenu *_configMenu = nullptr; + QMenu *_languages = nullptr; // Qt anchors do not work for
...
, thefore scrolling to next/prev match // do not work. Enable this when they work. // QToolButton* _first; // QToolButton* _prev; // QToolButton* _next; // QToolButton* _last; QLinkedList< QPair > _converters; }; #endif // VERIFYBUTTONS_H