More const detach fixes
This commit is contained in:
@@ -278,7 +278,8 @@ void FancyTabWidget::CurrentTabChangedSlot(const int idx) {
|
||||
int FancyTabWidget::IndexOfTab(QWidget *widget) {
|
||||
|
||||
if (!tabs_.contains(widget)) return -1;
|
||||
return QTabWidget::indexOf(tabs_[widget]->page());
|
||||
QWidget *page = tabs_.value(widget)->page();
|
||||
return QTabWidget::indexOf(page);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ void LoginStateWidget::SetLoggedIn(const State state, const QString &account_nam
|
||||
void LoginStateWidget::FocusLastCredentialField() {
|
||||
|
||||
if (!credential_fields_.isEmpty()) {
|
||||
QObject *object = credential_fields_.last();
|
||||
QObject *object = credential_fields_.constLast();
|
||||
QWidget *widget = qobject_cast<QWidget*>(object);
|
||||
QLineEdit *line_edit = qobject_cast<QLineEdit*>(object);
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ void StretchHeaderView::NormaliseWidths(const QList<int> §ions) {
|
||||
selected_sum = 0.0;
|
||||
for (int i = 0; i < count(); ++i) {
|
||||
if (sections.contains(i)) {
|
||||
selected_sum += column_widths_[i];
|
||||
selected_sum += column_widths_.value(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ void StretchHeaderView::ResizeSections(const QList<int> §ions) {
|
||||
if (isSectionHidden(i) || (!sections.isEmpty() && !sections.contains(i))) {
|
||||
continue;
|
||||
}
|
||||
const int pixels = static_cast<int>(column_widths_[i] * width());
|
||||
const int pixels = static_cast<int>(column_widths_.value(i) * width());
|
||||
if (pixels != 0) {
|
||||
resizeSection(i, pixels);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ void VolumeSlider::paintEvent(QPaintEvent*) {
|
||||
|
||||
p.drawPixmap(0, 0, pixmap_gradient_, 0, 0, offset + padding, 0);
|
||||
p.drawPixmap(0, 0, pixmap_inset_);
|
||||
p.drawPixmap(offset - handle_pixmaps_[0].width() / 2 + padding, 0, handle_pixmaps_[anim_count_]);
|
||||
p.drawPixmap(offset - handle_pixmaps_.value(0).width() / 2 + padding, 0, handle_pixmaps_[anim_count_]);
|
||||
|
||||
// Draw percentage number
|
||||
QStyleOptionViewItem opt;
|
||||
|
||||
Reference in New Issue
Block a user