我使用qwt图,并且需要增加图的最大高度。当高度大于32000px时,它将在32K px以下绘制黑色区域。地块的实际最大高度是多少?附言我将情节放入滚动区域。
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QScrollArea *scroll = new QScrollArea;
setCentralWidget( scroll );
QwtPlot *d_plot = new QwtPlot( this );
d_plot->setMinimumHeight(50000);
QVBoxLayout *layout = new QVBoxLayout(d_plot);
scroll->setWidget(d_plot);
scroll->setWidgetResizable(true);
QwtPlotCurve *curv1 = new QwtPlotCurve(QString("C"));
curv1->setPen(QPen(Qt::red));
const int N1 = 262144;
double *X1 = (double *)malloc((2*N1)*sizeof(double));
double *Y1 = X1 + N1;
double h = 8./(N1-1);
for (int k = 0; k < N1; k++)
{
X1[k] = k*h;
Y1[k] = cos(M_PI*X1[k]-5*M_PI/12);
}
curv1->setSamples(Y1,X1,N1);
curv1->attach(d_plot);
d_plot->replot();
}
32K px后的黑色区域
答案 0 :(得分:0)
限制应为SHRT_MAX,且为Qt限制(与Qwt无关)。