notes#
Module contains the widgets used to add and edit item cards/notes.
Classes:
|
Card widget represents a single note item. |
|
Widget used to store a list of :class:`CardWidget`s. |
|
This is the main cards/notes widget. |
|
Dotted button indicating a draggable item. |
|
Widget responsible for indicating files are being loaded. |
|
Lockfile to prevent another user from modifying the database whilst an edit is in progress. |
|
Widget responsible for indicating files are being loaded. |
|
Button used to remove a note item. |
|
|
|
Functions:
|
Closes the |
|
Shows the |
- class bookmarks.notes.CardWidget(extra_data, read_only=False, parent=None)[source]#
Bases:
QWidget
Card widget represents a single note item.
It has a title and a main note editor. Use
set_card_data()
to set, andget_card_data()
to retrieve the card contents.Methods:
eventFilter
(self, watched, event)Returns the title and note of the card.
set_card_data
([title, body, extra_data])Sets the note contents and extra data.
- class bookmarks.notes.CardsScrollWidget(parent=None)[source]#
Bases:
QScrollArea
Widget used to store a list of :class:`CardWidget`s.
The widget implements user sorting by custom drag and drop mechanisms.
Methods:
add_card
(title, body[, extra_data, read_only])Add a new
CardWidget
to the list.dragEnterEvent
(event)Event handler.
eventFilter
(widget, event)Custom event filter.
- add_card(title, body, extra_data={}, read_only=False)[source]#
Add a new
CardWidget
to the list.- Parameters:
title (str) – Title of the note.
body (str) – Note.
- class bookmarks.notes.CardsWidget(index, parent=None)[source]#
Bases:
QDialog
This is the main cards/notes widget.
Methods:
done
(r)Close the window.
Get all cards data.
Load cards data stored in the database.
save
()Save the note items to the database.
sizeHint
()Returns a size hint.
Attributes:
The QModelIndex of the current item.
- get_cards_data()[source]#
Get all cards data.
- Returns:
A dictionary of each card item’s data.
- Return type:
dict
- property index#
The QModelIndex of the current item.
- class bookmarks.notes.DragIndicatorButton(parent=None)[source]#
Bases:
QLabel
Dotted button indicating a draggable item.
The button is responsible for initiating a QDrag operation and setting the mime data. The data is populated with the TodoEditor’s text and the custom mime type. The latter is needed to accept the drag operation in the target drop widget.
Methods:
mouseMoveEvent
(event)Event handler.
mousePressEvent
(event)Event handler.
- class bookmarks.notes.DragOverlayWidget(parent=None)[source]#
Bases:
OverlayWidget
Widget responsible for indicating files are being loaded.
Methods:
paintEvent
(self, event)
- class bookmarks.notes.Lockfile(index, parent=None)[source]#
Bases:
QSettings
Lockfile to prevent another user from modifying the database whilst an edit is in progress.
Methods:
Creates a lock file.
- class bookmarks.notes.OverlayWidget(parent=None)[source]#
Bases:
QWidget
Widget responsible for indicating files are being loaded.
Methods:
paintEvent
(self, event)
- class bookmarks.notes.RemoveNoteButton(parent=None)[source]#
Bases:
ClickableIconButton
Button used to remove a note item.
Methods:
action
()Remove note item action.
- class bookmarks.notes.SyntaxHighlighter(document, parent=None)[source]#
Bases:
QSyntaxHighlighter
Methods:
highlightBlock
(self, text)
- class bookmarks.notes.TextEditor(parent=None)[source]#
Bases:
QTextBrowser
Methods:
keyPressEvent
(event)Key press event handler.
mouseMoveEvent
(self, ev)mouseReleaseEvent
(self, ev)showEvent
(event)Event handler.
- bookmarks.notes.close()[source]#
Closes the
CardsWidget
editor.
- bookmarks.notes.show(index)[source]#
Shows the
CardsWidget
editor.- Parameters:
index (QModelIndex) – The item’s