Commit 1e497d03 authored by L. E. Segovia's avatar L. E. Segovia

Use Qt keywords for signals/slots

parent c01ffed7
......@@ -22,6 +22,15 @@ endif()
find_package(OpenGL)
if (Qt5_FOUND OR QT4_FOUND)
# Adding Krita's definitions to make headers automatically compatible. -amyspark
add_definitions(
-DQT_USE_QSTRINGBUILDER
-DQT_STRICT_ITERATORS
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_NO_URL_CAST_FROM_STRING
-DQT_USE_FAST_CONCATENATION
-DQT_USE_FAST_OPERATOR_PLUS
)
BuildParserScanner(ExprSpecParserLex ExprSpecParser ExprSpec
editor_parser_cpp)
......
......@@ -70,7 +70,7 @@ class ExprBrowser : public QWidget {
void expandToDepth(int depth);
void setApplyOnSelect(bool on) { _applyOnSelect = on; }
public
slots:
Q_SLOTS:
void handleSelection(const QModelIndex& current, const QModelIndex& previous);
void update();
void clear();
......@@ -79,7 +79,7 @@ slots:
void saveLocalExpressionAs();
void saveExpressionAs();
private
slots:
Q_SLOTS:
void clearFilter();
void filterChanged(const QString& str);
};
......
......@@ -71,13 +71,13 @@ class CCurveScene : public QGraphicsScene {
friend class ExprColorCurve;
public slots:
public Q_SLOTS:
void interpChanged(const int interp);
void selPosChanged(double pos);
void selValChanged(const SeExpr2::Vec3d &val);
void resize(const int width, const int height);
signals:
Q_SIGNALS:
void cvSelected(double x, const SeExpr2::Vec3d y, const T_INTERP interp);
void curveChanged();
......@@ -125,7 +125,7 @@ class ExprCSwatchFrame : public QFrame {
virtual void paintEvent(QPaintEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
signals:
Q_SIGNALS:
void selValChangedSignal(SeExpr2::Vec3d value);
void swatchChanged(QColor color);
......@@ -155,17 +155,17 @@ class ExprColorCurve : public QWidget {
CCurveScene *_scene;
public slots:
public Q_SLOTS:
void cvSelectedSlot(const double pos, const SeExpr2::Vec3d val, const T_INTERP interp);
void selPosChanged();
void openDetail();
signals:
Q_SIGNALS:
void selPosChangedSignal(double pos);
void selValChangedSignal(SeExpr2::Vec3d val);
void swatchChanged(QColor color);
private slots:
private Q_SLOTS:
void internalSwatchChanged(QColor color);
private:
......
......@@ -26,10 +26,10 @@ class ExprColorFrame : public QFrame {
virtual void mouseReleaseEvent(QMouseEvent *event);
private
slots:
Q_SLOTS:
void deleteSwatchMenu(const QPoint &pos);
signals:
Q_SIGNALS:
void selValChangedSignal(SeExpr2::Vec3d value);
void swatchChanged(QColor color);
void deleteSwatch(ExprColorFrame *swatch);
......@@ -64,12 +64,12 @@ class ExprColorSwatchWidget : public QWidget {
QColor getSwatchColor(int index);
private
slots:
Q_SLOTS:
void addNewColor();
void removeSwatch(ExprColorFrame *);
void internalSwatchChanged(QColor color);
signals:
Q_SIGNALS:
void selValChangedSignal(SeExpr2::Vec3d val);
void swatchChanged(int index, SeExpr2::Vec3d val);
void swatchAdded(int index, SeExpr2::Vec3d val);
......
......@@ -72,7 +72,7 @@ class ExprControl : public QWidget {
/// Interface for setting the color (used for linked color picking)
virtual void setColor(QColor color) {Q_UNUSED(color)};
signals:
Q_SIGNALS:
// sends that the control has been changed to the control collection
void controlChanged(int id);
// sends the new color to the control collection
......@@ -80,7 +80,7 @@ signals:
// sends that a color link is desired to the control collection
void linkColorLink(int id);
public
slots:
Q_SLOTS:
// receives that the link should be changed to the given state (0=off,1=on)
void linkStateChange(int state);
......@@ -110,11 +110,11 @@ class ExprLineEdit : public QLineEdit {
QLineEdit::setText(t);
}
signals:
Q_SIGNALS:
void textChanged(int id, const QString& text);
private
slots:
Q_SLOTS:
void textChangedCB(const QString& text);
private:
......@@ -155,10 +155,10 @@ class ExprChannelSlider : public QWidget {
void setDisplayColor(QColor c) { _col = c; }
public
slots:
Q_SLOTS:
void setValue(float value);
signals:
Q_SIGNALS:
void valueChanged(int id, float value);
private:
......@@ -187,7 +187,7 @@ class NumberControl : public ExprControl {
/// Update values in slider and textbox given what the model contains
void updateControl();
private
slots:
Q_SLOTS:
void sliderChanged(int val);
void editChanged(int id, const QString& text);
};
......@@ -217,7 +217,7 @@ class VectorControl : public ExprControl {
/// update the individual slider and eidt box controls
void updateControl();
private
slots:
Q_SLOTS:
void sliderChanged(int id, float val);
void editChanged(int id, const QString& text);
void swatchChanged(QColor color);
......@@ -238,7 +238,7 @@ class StringControl : public ExprControl {
private:
void updateControl();
private
slots:
Q_SLOTS:
void textChanged(const QString& newText);
void fileBrowse();
void directoryBrowse();
......@@ -256,7 +256,7 @@ class CurveControl : public ExprControl {
public:
CurveControl(int id, CurveEditable* stringEditable);
private
slots:
Q_SLOTS:
void curveChanged();
};
......@@ -274,7 +274,7 @@ class CCurveControl : public ExprControl {
QColor getColor();
void setColor(QColor color);
private
slots:
Q_SLOTS:
void curveChanged();
};
......@@ -292,11 +292,11 @@ class AnimCurveControl : public ExprControl {
static void setAnimCurveCallback(AnimCurveCallback callback);
public
slots:
Q_SLOTS:
void editGraphClicked();
private
slots:
Q_SLOTS:
void refreshClicked();
private:
......@@ -315,7 +315,7 @@ class ColorSwatchControl : public ExprControl {
public:
ColorSwatchControl(int id, ColorSwatchEditable* swatchEditable);
private
slots:
Q_SLOTS:
void buildSwatchWidget();
void colorChanged(int index, SeExpr2::Vec3d value);
void colorAdded(int index, SeExpr2::Vec3d value);
......@@ -337,7 +337,7 @@ class DeepWaterControl : public ExprControl {
public:
DeepWaterControl(int id, DeepWaterEditable* stringEditable);
private
slots:
Q_SLOTS:
void deepWaterChanged();
};
......
......@@ -71,7 +71,7 @@ class ExprAddDialog : public QDialog {
ExprAddDialog(int &count, QWidget *parent = 0);
const char *initSwatch();
private
slots:
Q_SLOTS:
void colorChooseClicked();
};
......@@ -114,7 +114,7 @@ class ExprControlCollection : public QWidget {
}
private
slots:
Q_SLOTS:
/// When a user clicks "Add Widget" button
void addControlDialog();
/// Notification when by a control whenever it is edited
......@@ -123,7 +123,7 @@ slots:
void linkColorLink(int id);
/// Notification by a control that a color is edited (when it is linked)
void linkColorEdited(int id, QColor color);
signals:
Q_SIGNALS:
/// Notification that a specific control was changed
void controlChanged(int id);
/// Gives information about when a link color was changed
......@@ -132,7 +132,7 @@ signals:
/// i.e. after "Add Widget" was used
void insertString(const std::string &controlString);
public
slots:
Q_SLOTS:
/// Notification from outside that a linked color widget was changed
/// and should be forwarded to any linked controls
void linkColorInput(QColor color);
......
......@@ -46,7 +46,7 @@ class CurveGraphicsView : public QGraphicsView {
virtual void resizeEvent(QResizeEvent *event);
signals:
Q_SIGNALS:
void resizeSignal(int width, int height);
};
......@@ -92,13 +92,13 @@ class CurveScene : public QGraphicsScene {
private:
T_CURVE *_curve;
public
slots:
Q_SLOTS:
void interpChanged(const int interp);
void selPosChanged(double pos);
void selValChanged(double val);
void resize(const int width, const int height);
signals:
Q_SIGNALS:
void cvSelected(double x, double y, T_INTERP interp);
void curveChanged();
......@@ -133,13 +133,13 @@ class ExprCurve : public QWidget {
CurveScene *_scene;
public
slots:
Q_SLOTS:
void cvSelectedSlot(double pos, double val, T_INTERP interp);
void selPosChanged();
void selValChanged();
void openDetail();
signals:
Q_SIGNALS:
void selPosChangedSignal(double pos);
void selValChangedSignal(double val);
......
......@@ -169,7 +169,7 @@ class DeepWaterGraphicsView : public QGraphicsView {
virtual void resizeEvent(QResizeEvent *event);
signals:
Q_SIGNALS:
void resizeSignal(int width, int height);
};
......@@ -180,7 +180,7 @@ class DeepWaterLineEdit : public QLineEdit {
DeepWaterLineEdit(QWidget *parent = 0) {}
~DeepWaterLineEdit() {}
signals:
Q_SIGNALS:
void focusOut();
protected:
......@@ -221,7 +221,7 @@ class DeepWaterScene : public QGraphicsScene {
T_CURVE *_curve;
public
slots:
Q_SLOTS:
void resolutionChanged(int val);
void tileSizeChanged(double val);
void lengthCutoffChanged(double val);
......@@ -234,7 +234,7 @@ slots:
void sharpenChanged(double val);
void resize(const int width, const int height);
signals:
Q_SIGNALS:
void deepWaterChanged();
private:
......@@ -255,7 +255,7 @@ class ExprDeepWater : public QWidget {
DeepWaterScene *_scene;
public
slots:
Q_SLOTS:
void resolutionChanged();
void tileSizeChanged();
void lengthCutoffChanged();
......@@ -267,7 +267,7 @@ slots:
void directionalReflectionDampingChanged();
void sharpenChanged();
signals:
Q_SIGNALS:
void resolutionChangedSignal(int val);
void tileSizeChangedSignal(double val);
void lengthCutoffChangedSignal(double val);
......
......@@ -223,7 +223,7 @@ void ExprDialog::setupHelp(QTabWidget* tab) {
QString sheet =
"body {background-color: #eeeeee; color: #000000;} \na {color: #3333ff; text-decoration: none;}\n";
helpBrowser->document()->setDefaultStyleSheet(sheet);
helpBrowser->setSource(helpDoc->fileName());
helpBrowser->setSource(QUrl::fromLocalFile(helpDoc->fileName()));
}
QPushButton* backPb = new QPushButton("Back");
......
......@@ -88,12 +88,12 @@ class ExprDialog : public QDialog {
void findHelper(QTextDocument::FindFlags flags);
void closeEvent(QCloseEvent* event);
signals:
Q_SIGNALS:
void preview();
void expressionApplied();
void dialogClosed();
private
slots:
Q_SLOTS:
void previewExpression();
void verifiedApply();
void verifiedAccept();
......@@ -101,7 +101,7 @@ slots:
void findPrevInHelp();
void _showEditor();
public
slots:
Q_SLOTS:
void applyExpression();
......
......@@ -84,9 +84,9 @@ class ExprTextEdit : public QTextEdit {
void contextMenuEvent(QContextMenuEvent* event);
private
slots:
Q_SLOTS:
void insertCompletion(const QString& completion);
signals:
Q_SIGNALS:
void applyShortcut();
void nextError();
};
......@@ -99,7 +99,7 @@ class ExprEditor : public QWidget {
virtual ~ExprEditor();
public
slots:
Q_SLOTS:
void exprChanged();
void rebuildControls();
void controlChanged(int id);
......@@ -108,7 +108,7 @@ slots:
void sendApply();
void sendPreview();
// void handlePreviewTimer();
signals:
Q_SIGNALS:
void apply();
void preview();
......@@ -120,7 +120,7 @@ signals:
// Append string
void appendStr(const std::string& str);
public
slots:
Q_SLOTS:
// Insert string
void insertStr(const std::string& str);
......
......@@ -76,7 +76,7 @@ class ExprFileDialog : public QFileDialog {
void addSidebarShortcut(const QString& s);
private
slots:
Q_SLOTS:
void handleOk();
void editReturnPress();
void gotoFavorites();
......
......@@ -51,7 +51,7 @@ class ExprGrapherView : public QGLWidget {
void mouseMoveEvent(QMouseEvent* event);
int event_oldx, event_oldy;
signals:
Q_SIGNALS:
void scaleValueManipulated();
void clicked();
......@@ -77,10 +77,10 @@ class ExprGrapherWidget : public QWidget {
ExprGrapherWidget(QWidget* parent, int width, int height);
void update();
signals:
Q_SIGNALS:
void preview();
private
slots:
Q_SLOTS:
void scaleValueEdited();
void scaleValueManipulated();
void forwardPreview();
......
......@@ -103,7 +103,7 @@ class ExprShortEdit : public QWidget {
void checkErrors();
protected
slots:
Q_SLOTS:
virtual void detailPressed();
virtual void expandPressed();
virtual void textFinished();
......@@ -113,7 +113,7 @@ slots:
virtual void expressionApplied();
virtual void dialogClosed();
signals:
Q_SIGNALS:
void exprChanged();
};
......@@ -147,10 +147,10 @@ class ExprShortTextEdit : public QTextEdit {
void setColor(bool editing);
void finishEdit();
signals:
Q_SIGNALS:
void editingFinished();
private
slots:
Q_SLOTS:
void insertCompletion(const QString& completion);
};
......
......@@ -81,11 +81,11 @@ public:
void setExpressionString(const std::string&);
void show();
signals:
Q_SIGNALS:
void preview();
void expressionApplied();
public slots:
public Q_SLOTS:
void applyExpression();
void clearExpression();
......@@ -107,12 +107,12 @@ class ExprEditor:QWidget{
public:
ExprEditor(QWidget* parent /TransferThis/,ExprControlCollection* collection);
signals:
Q_SIGNALS:
void applyExpression(); // This is when text or controls are manipulated
//void needNewPreview();
void clearExpression();
public slots:
public Q_SLOTS:
void exprChanged();
void rebuildControls();
void controlChanged(int id);
......@@ -159,7 +159,7 @@ public:
void selectPath(const char * path);
void setSearchPath(const QString& context, const QString& path);
public slots:
public Q_SLOTS:
void update();
void clear();
......@@ -178,7 +178,7 @@ class ExprShortTextEdit:QTextEdit
public:
ExprShortTextEdit(QWidget* parent);
signals:
Q_SIGNALS:
void textChanged();
};
......@@ -207,7 +207,7 @@ public:
QToolButton* expandButton;
ExprShortTextEdit* edit;
protected slots:
protected Q_SLOTS:
virtual void detailPressed();
virtual void expandPressed();
virtual void textFinished();
......@@ -217,7 +217,7 @@ protected slots:
virtual void expressionApplied();
virtual void dialogClosed();
signals:
Q_SIGNALS:
void exprChanged();
};
......
......@@ -35,6 +35,6 @@ class ImageEditorDialog : public QDialog {
ExprEditor *_editor;
ImageSynthesizer *_imageSynthesizer;
private
slots:
Q_SLOTS:
void applyExpression();
};
......@@ -112,7 +112,7 @@ class Graph : public QWidget {
//! Solve max problem using golden
void solveMax(const int function, double xmin, double xmax);
public
slots:
Q_SLOTS:
//! Redraw graph and clear all given roots
void redraw();
};
......
......@@ -46,7 +46,7 @@ class GraphWindow : public QFrame {
GraphWindow(QWidget* parent = 0);
~GraphWindow();
private
slots:
Q_SLOTS:
//! Add new function when it is entered into the add box
void addNewFunction();
//! Start finding a numeric quantity after button clicked
......
......@@ -368,7 +368,7 @@ Now we're ready to create an apply button and add it to the bottom of the layout
bottomLayout->addWidget(buttonWidget);
</pre>
We will need to write the applyExpression() function to call the ImageSynthesizer object to evaluate the expression inside the editor. First, we need to include the <a href="http://qt-project.org/doc/qt-4.8/moc.html#moc">Q_OBJECT</a> macro in the ImageEditorDialog class definition, since we're going to be connecting signals and slots:
We will need to write the applyExpression() function to call the ImageSynthesizer object to evaluate the expression inside the editor. First, we need to include the <a href="http://qt-project.org/doc/qt-4.8/moc.html#moc">Q_OBJECT</a> macro in the ImageEditorDialog class definition, since we're going to be connecting signals and Q_SLOTS:
<pre style="padding-left: 5em;">
class ImageEditorDialog: public QDialog
......@@ -382,7 +382,7 @@ Next, we'll add a new data member for the ImageSynthesizer instance as well as t
<pre style="padding-left: 5em;">
private:
ImageSynthesizer *_imageSynthesizer;
private slots:
private Q_SLOTS:
void applyExpression();
</pre>
......@@ -440,7 +440,7 @@ private:
QLabel *_imageLabel;
ExprEditor *_editor;
ImageSynthesizer *_imageSynthesizer;
private slots:
private Q_SLOTS:
void applyExpression();
};
</pre>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment