Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Taking this section as an example, it can be greatly simplified:</p> <pre><code> Block(const QPixmap &amp;img = Pixmap(), QObject *parent = 0); Block(const QPoint &amp;pos, const QPixmap &amp;img = Pixmap(), QObject *parent = 0); Block(int x, int y, const QPixmap &amp;img = Pixmap(), QObject *parent = 0); </code></pre> <p>Remove these two:</p> <pre><code> Block(const QPixmap &amp;img = Pixmap(), QObject *parent = 0); Block(int x, int y, const QPixmap &amp;img = Pixmap(), QObject *parent = 0); </code></pre> <p>If you want it at "no position", you just give it an empty <code>QPoint</code>:</p> <pre><code> Block(QPoint(), img); </code></pre> <p>And if you want it at <code>x, y</code>, then make a <code>QPoint(x, y)</code></p> <pre><code> Block(QPoint(x, y), img, parent); </code></pre> <p>(You could of course make it <code>QPoint pos = QPoint()</code>, so that if you want an empty one you can use <code>Block()</code>. </p> <p>The same principle can be applied to <code>Rect</code>, you have several variants that are "nearly the same". Replace all the variations with one that takes a QRect as the first argument. If you don't happen to "have" a QRect, surely one can be created as a temporary (and in most cases, that will just "disappear"). </p> <p>Hopefully, this ALSO makes the set actual constructor simpler, since you can just do </p> <pre><code>m_rect = rect; </code></pre> <p>rather than having to write 6 different forms of "I have some different items, that need to be made into a rect". </p> <p>Unless there is a VERY good reason to add another constructor, don't. Just because the code you are working on right now happens to have <code>x</code>, <code>y</code>, <code>h</code>, and <code>w</code>, doesn't mean you can't make it into a <code>QRect</code> pretty easily. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload