last patch:
QAbstractTableModel explicitly initialized in copy constructor
warning: base class ‘class QAbstractTableModel’
should be explicitly initialized in the copy constructor [-Wextra]
You are not logged in. Please login or register.
QElectroTech → Posts by De-Backer
last patch:
QAbstractTableModel explicitly initialized in copy constructor
warning: base class ‘class QAbstractTableModel’
should be explicitly initialized in the copy constructor [-Wextra]
warning: ‘QSet<T> QList<T>::toSet() const [with T = IndependentTextItem*]’ is deprecated:
Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]-5 issues for QT 5.14
don't forget
I tried "0001-fix-deprecated-Wdeprecated-copy.patch" is reduce warnings 50 to 6, but I don't know if I can push it?
First patch in attached patch reduce warnings 50 -> ~20.
i think this is the answer, use default default constructor (does only shallow copy).
* fix_deprecated_QModelIndex
warning: ‘QModelIndex QModelIndex::child(int, int) const’ is deprecated: Use QAbstractItemModel::index [-Wdeprecated-declarations]
-11 issues
attempt 2 for deprecated warning QList::swap(int i, int j)
I had to revert it
https://git.tuxfamily.org/qet/qet.git/c … e91882a445Edit : ok I understood, I use Qt version 5.12.5 and this function was introduced in Qt 5.13.
*fix deprecated warning QList::swap(int i, int j)
warning: ‘typename Container::const_iterator qUpperBound(const Container&, const T&) [with Container = QList<double>; T = double; typename Container::const_iterator = QList<double>::const_iterator]’ is deprecated: Use std::upper_bound [-Wdeprecated-declarations]
-3 issues Qt -> C++ (should be ok, no version differences)
warning: ‘QSet<T> QList<T>::toSet() const [with T = IndependentTextItem*]’ is deprecated:
Use QSet<T>(list.begin(), list.end()) instead. [-Wdeprecated-declarations]
-5 issues for QT 5.14
warning: base class ‘class QAbstractTableModel’ should be explicitly initialized in the copy constructor [-Wextra]
sources/qetgraphicsitem/ViewItem/nomenclaturemodel.cpp:46:1:
-NomenclatureModel::NomenclatureModel(const NomenclatureModel &other_model)
+NomenclatureModel::NomenclatureModel(const NomenclatureModel &other_model) :
+ QAbstractTableModel(this),
+ m_project(project())
is ok?
info of https://stackoverflow.com/questions/211 … onstructor
fix_deprecated_drawRoundRect
warning: ‘void QPainter::drawRoundRect(const QRectF&, int, int)’ is deprecated: Use drawRoundedRect(..., Qt::RelativeSize) instead [-Wdeprecated-declarations]
void QPainter::drawRoundRect(const QRectF &r, int xRnd = 25, int yRnd = 25)
This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.
void QPainter::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode = Qt::AbsoluteSize)
Draws the given rectangle rect with rounded corners.
The xRadius and yRadius arguments specify the radii of the ellipses defining the corners of the rounded rectangle. When mode is Qt::RelativeSize, xRadius and yRadius are specified in percentage of half the rectangle's width and height respectively, and should be in the range 0.0 to 100.0.
A filled rectangle has a size of rect.size(). A stroked rectangle has a size of rect.size() plus the pen width.
QRectF rectangle(10.0, 20.0, 80.0, 60.0);
QPainter painter(this);
painter.drawRoundedRect(rectangle, 20.0, 15.0);
This function was introduced in Qt 4.4.
linksingleelementwidget.cpp:482:28: warning: 'setBackgroundColor' is deprecated: Use QTreeWidgetItem::setBackground() instead
qtreewidget.h:141:5: note: 'setBackgroundColor' has been explicitly marked deprecated here
qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
qcompilerdetection.h:675:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
"linksingleelementwidget.cpp"
@@ -478,11 +478,11 @@ void LinkSingleElementWidget::linkTriggered()
- m_qtwi_at_context_menu->setBackgroundColor(i, Qt::green);
+ m_qtwi_at_context_menu->setBackground(i, QBrush(Qt::green,Qt::SolidPattern));
void QTreeWidgetItem::setBackgroundColor(int column, const QColor &color)
This function is deprecated. Use setBackground() instead.
See also backgroundColor().
void QTreeWidgetItem::setBackground(int column, const QBrush &brush)
Sets the background brush of the label in the given column to the specified brush. Setting a default-constructed brush will let the view use the default color from the style.
Note: If Qt Style Sheets are used on the same widget as setBackground(), style sheets will take precedence if the settings conflict.
This function was introduced in Qt 4.2.
fix deprecated warning QDrag::start
Use
QDrag::exec
instead.
This function was introduced in Qt 4.3.
and for "fix deprecated -Wdeprecated-copy (C++11)"
I can't get my head around it, I will probably need some help.
No it is not according to the + c11 rules.
https://en.cppreference.com/w/cpp/langu … e_of_three
this is an example of a wrong patch:
fix deprecated -Wdeprecated-copy (C++11)
warning: implicitly-declared ‘NamesList& NamesList::operator=(const NamesList&)’ is deprecated [-Wdeprecated-copy]
Use copy and swap idiom to implement assignment.
I will have to do more checks before releasing the patch files
*fix deprecated warning QList::swap(int i, int j)
*fix deprecated warning QDir& QDir::operator=(const QString&)
*fix -Wswitch warning Qt::MarkdownText: //This enum value was added in Qt 5.14.
Qt save XML
then I will use an external program for the dif's of my project.
I am currently working on fix preprocessor Issue error: 'foo.h' file not found
this provides the in QT editor linking.
I try to fix the compile warnings first, afterwards i try to understand the code. (french is difficult for me)
My goal is to understand why the content of the .qet file always changes when saving, because this makes it difficult for git.
(everything is always different)
(i am using git to track the changes in my project 'cv.qet')
For MS Windows I will need more time.
I always want to help but my knowledge is still too limited.
*fix deprecated warning QWidget::getContentsMargins
This function is obsolete.
Use contentsMargins().
instead.
This function was introduced in Qt 4.6.
-1 Issue
please check before you merge see:
void IntegrationMoveTitleBlockTemplatesHandler::radioButtonleftMargin(QRadioButton *button) {
- int a, b, c, d;
- button -> getContentsMargins(&a, &b, &c, &d);
- button -> setContentsMargins(a + 15, b, c, d);
+ button->contentsMargins().setLeft(button->contentsMargins().left()+15);
}
*fix Wmisleading-indentation warning
there were spaces used to indent the conditional line
-3 Issue
*fix deprecated warning qVariantFromValue
-14 Issues
*fix deprecated warning QTime::start()
This function was introduced in Qt 5.4.
-2 Issues
*fix deprecated warning QFontMetrics::width(QChar ch)
This function was introduced in Qt 5.11.
! "#if QT_VERSION < QT_VERSION_CHECK" used
-16 Issues
*fix deprecated warning QLineF::intersect
This function was introduced in Qt 5.14.
! "#if QT_VERSION < QT_VERSION_CHECK" used
-1 Issue
please check before you merge (! "#if QT_VERSION < QT_VERSION_CHECK" used !)
Hmm since Qt 5.14.... but I build QET packages for Debian Buster (Qt 5.11.x), Debian Sid (Qt 5.12.5) Ubuntu Bionic( Qt 5.9.).., etc... Only AppImage, macOS packages use Qt 5.14.2..maybe Flatpak and Snap.
For Qt 5.15 LTS it's still too early, I have a lot of problems with it.
this is the feedback i needed.
QT 5.9 --- 5.14.2 max.
thanks.
ok, i look in to it if this is feasible for me.
https://doc.qt.io/qt-5/containers.html
QList<T>
This is by far the most commonly used container class. It stores a list of values of a given type (T) that can be accessed by index. Internally, the QList is implemented using an array, ensuring that index-based access is very fast.
Items can be added at either end of the list using QList::append() and QList::prepend(), or they can be inserted in the middle using QList::insert(). More than any other container class, QList is highly optimized to expand to as little code as possible in the executable. QStringList inherits from QList<QString>
can this be tested for correct operation? (qt5.xx)
works on Qt5.15.0
Issues count from 124 to 109
note: a guideline for adding code could be handy, if it already exists please teach me.
I would like a guideline to add future elements, so that this can be avoided.
as well as a proposal to develop the program code separately from the elements, such as with "kicad" advantage: the elements are brought into production faster.
img
QElectroTech → Posts by De-Backer
Powered by PunBB, supported by Informer Technologies, Inc.
Generated in 0.025 seconds (34% PHP - 66% DB) with 5 queries