I would like to add 3 items to statusbar. Shouldn't each be in its own label?
Is that possible? When I tried to add a second label, it gave me an error.
File mainwindow.h
,
QLabel *m_statusLabel;
QLabel *m_pointLabel;
File mainwindow.cpp
,
statusBar()->addWidget(m_statusLabel);
statusBar()->addWidget(m_pointLabel);
It works perfectly with one label, but when I add a second, then I get the following.
Starting C:\Users\Jansu\Desktop\cpp-praktikum05-alus\Joonistamine-build- desktop\src\bin\Joonistamine.exe...
ASSERT: "d" in file ..\..\include/QtCore/../../src/corelib/tools/qscopedpointer.h, line 112
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.
C:\Users\Jansu\Desktop\cpp-praktikum05-alus\Joonistamine-build- desktop\src\bin\Joonistamine.exe exited with code -1073741819
I found the problem. I forgot to create QLabels, so I added this:
m_statusLabel = new QLabel(this);
m_pointLabel = new QLabel(this);
精彩评论