X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftitlewidget.h;h=4c6a351e5ef90016d18b4a228f76da60461c93c2;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=655f5625ea6ae1184b043244534b2798701640d5;hpb=793bdb01c8776ee93cc981e4f5da7d5f95df4ee6;p=kdenlive diff --git a/src/titlewidget.h b/src/titlewidget.h index 655f5625..4c6a351e 100644 --- a/src/titlewidget.h +++ b/src/titlewidget.h @@ -63,10 +63,10 @@ public: * @param projectPath default path to save to or load from title documents * @param render project renderer * @param parent (optional) parent widget */ - TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render *render, QWidget *parent = 0); + explicit TitleWidget(const KUrl &url, const Timecode &tc, const QString &projectTitlePath, Render *render, QWidget *parent = 0); virtual ~TitleWidget(); QDomDocument xml(); - void setXml(QDomDocument doc); + void setXml(const QDomDocument& doc); /** @brief Finds the first available file name for a title document. * @deprecated With the titler module there's no need to save titles as images. @@ -80,12 +80,12 @@ public: /** @brief Checks for the images referenced by a title clip. * @param xml XML data representing the title * @return list of the image files */ - static QStringList extractImageList(QString xml); + static QStringList extractImageList(const QString &xml); /** @brief Checks for the fonts referenced by a title clip. * @param xml XML data representing the title * @return list of the fonts */ - static QStringList extractFontList(QString xml); + static QStringList extractFontList(const QString &xml); /** @brief Builds a file name for a title document. * @deprecated With the titler module there's no need to save titles as images. @@ -97,14 +97,16 @@ public: * get the file name. There is no check for the existence of the file. */ static QString getTitleResourceFromName(const KUrl &projectUrl, const QString &titleName); - /** @brief Returns clip out position. */ - int outPoint() const; + /** @brief Returns clip duration. */ + int duration() const; /** @brief Retrieves a list of all available title templates. */ static void refreshTitleTemplates(); protected: - virtual void resizeEvent(QResizeEvent * event); + void resizeEvent(QResizeEvent * event); + void keyPressEvent(QKeyEvent *e); + QSize sizeHint() const; private: @@ -156,7 +158,7 @@ private: // See http://doc.trolltech.com/4.5/signalsandslots.html#advanced-signals-and-slots-usage. QSignalMapper *m_signalMapper; - enum ValueType { ValueWidth = 0, ValueHeight = 1 }; + enum ValueType { ValueWidth = 1, ValueHeight = 2, ValueX = 4, ValueY = 8 }; /** @brief Sets the font weight value in the combo box. (#909) */ void setFontBoxWeight(int weight); @@ -170,14 +172,16 @@ private: /** @brief Updates the displayed X/Y coordinates. */ void updateCoordinates(QGraphicsItem *i); - /** @brief Updates the displayed width/height values. */ + /** @brief Updates the displayed width/height/zindex values. */ void updateDimension(QGraphicsItem *i); - /** @brief Updates the displayed rotation/zoom values. */ + /** @brief Updates the displayed rotation/zoom values. Changes values of rotation/zoom GUI elements. */ void updateRotZoom(QGraphicsItem *i); - /** @brief Updates the item position. */ + /** @brief Updates the item position (position read directly from the GUI). Does not change GUI elements. */ void updatePosition(QGraphicsItem *i); + /** @brief Updates the item position. Does not change GUI elements. */ + void updatePosition(QGraphicsItem *i, int x, int y); void textChanged(QGraphicsTextItem *i); void updateAxisButtons(QGraphicsItem *i); @@ -190,6 +194,9 @@ private: /** @brief Shows the toolbars suiting to toolType. */ void showToolbars(TITLETOOL toolType); + + /** @brief Set up the tools suiting referenceItem */ + void prepareTools(QGraphicsItem *referenceItem); /** @brief Checks a tool button. */ void checkButton(TITLETOOL toolType); @@ -219,7 +226,7 @@ private: void selectItems(int itemType); /** @brief Appends the shortcut of a QAction to a tooltip text */ - QString getTooltipWithShortcut(const QString text, QAction *button); + QString getTooltipWithShortcut(const QString& text, QAction *button); public slots: void slotNewText(QGraphicsTextItem *tt); @@ -242,9 +249,6 @@ public slots: private slots: - /** @brief Updates position/size of the selected item when a value changes. */ - void slotAdjustSelectedItem(); - /** @brief Switches the origin of the X axis between left and right border. * * It's called when the origin of the X coordinate has been changed. The X @@ -286,7 +290,11 @@ private slots: * It's called when something changes in the QGraphicsScene. */ void slotChanged(); - /** @param valueType of type ValueType */ + /** + * Reacts to changes of widht/height/x/y QSpinBox values. + * @brief Updates width, height, and position of the selected items. + * @param valueType of type ValueType + */ void slotValueChanged(int valueType); void slotZoom(bool up); @@ -304,7 +312,7 @@ private slots: /** Called whenever text properties change (font e.g.) */ void slotUpdateText(); void slotInsertUnicode(); - void slotInsertUnicodeString(QString); + void slotInsertUnicodeString(const QString&); void displayBackgroundFrame();