|
1 | NO CONTENT: modified file |
@@ -95,16 +95,12 QSizeF ChartValueAxisX::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c | |||
|
95 | 95 | qreal width = 0; |
|
96 | 96 | qreal height = 0; |
|
97 | 97 | |
|
98 | int count = 1; | |
|
99 | ||
|
100 | if(!ticksList.empty()) { | |
|
101 | count = qMax(ticksList.last().count(),ticksList.first().count()); | |
|
102 | } | |
|
103 | 98 | |
|
104 | 99 | switch (which) { |
|
105 | 100 | case Qt::MinimumSize:{ |
|
106 | count = qMin(count,5); | |
|
107 | width = fn.averageCharWidth() * count; | |
|
101 | if(!ticksList.empty()) { | |
|
102 | width = qMax(fn.boundingRect(ticksList.last()).width(),fn.boundingRect(ticksList.first()).width()); | |
|
103 | } | |
|
108 | 104 | height = fn.height() + labelPadding(); |
|
109 | 105 | width = qMax(width,base.width()); |
|
110 | 106 | height += base.height(); |
@@ -112,7 +108,11 QSizeF ChartValueAxisX::sizeHint(Qt::SizeHint which, const QSizeF &constraint) c | |||
|
112 | 108 | break; |
|
113 | 109 | } |
|
114 | 110 | case Qt::PreferredSize:{ |
|
115 | width=fn.averageCharWidth() * count; | |
|
111 | if(!ticksList.empty()) { | |
|
112 | foreach(QString label,ticksList) { | |
|
113 | width+=fn.boundingRect(label).width(); | |
|
114 | } | |
|
115 | } | |
|
116 | 116 | height=fn.height()+labelPadding(); |
|
117 | 117 | width=qMax(width,base.width()); |
|
118 | 118 | height+=base.height(); |
General Comments 0
You need to be logged in to leave comments.
Login now