Replace HexdumpWidget::resizeHexdump() with sizePolicy

This commit is contained in:
Florian Märkl 2017-11-20 11:29:59 +01:00
parent 2775b4bb0a
commit 3a4e87ca41
3 changed files with 2 additions and 27 deletions

View File

@ -290,7 +290,6 @@ void HexdumpWidget::refresh(RVA addr)
ui->hexOffsetText->setPlainText(hexdump[0]);
ui->hexHexText->setPlainText(hexdump[1]);
ui->hexASCIIText->setPlainText(hexdump[2]);
resizeHexdump();
int seekLine = static_cast<int>((addr - topOffset) / cols);
@ -516,14 +515,6 @@ std::array<QString, 3> HexdumpWidget::fetchHexdump(RVA offset, RVA bytes)
return { offsets, hex, ascii };
}
void HexdumpWidget::resizeHexdump()
{
ui->hexOffsetText->setMinimumWidth(static_cast<int>(ui->hexOffsetText->document()->size().width()));
ui->hexHexText->setMinimumWidth(static_cast<int>(ui->hexHexText->document()->size().width()));
//this->hexASCIIText->setMinimumWidth(this->hexASCIIText->document()->size().width());
}
void HexdumpWidget::adjustHexdumpLines()
{
QScrollBar *sb = ui->hexASCIIText->verticalScrollBar();
@ -722,7 +713,6 @@ void HexdumpWidget::setupFonts()
void HexdumpWidget::fontsUpdated()
{
setupFonts();
resizeHexdump();
adjustHexdumpLines();
}
@ -966,7 +956,6 @@ void HexdumpWidget::zoomIn(int range)
ui->hexOffsetText->zoomIn(range);
ui->hexASCIIText->zoomIn(range);
ui->hexHexText->zoomIn(range);
resizeHexdump();
}
void HexdumpWidget::zoomOut(int range)
@ -974,5 +963,4 @@ void HexdumpWidget::zoomOut(int range)
ui->hexOffsetText->zoomOut(range);
ui->hexASCIIText->zoomOut(range);
ui->hexHexText->zoomOut(range);
resizeHexdump();
}

View File

@ -103,7 +103,6 @@ private slots:
void on_action32columns_triggered();
void on_action64columns_triggered();
void resizeHexdump();
void adjustHexdumpLines();
void fontsUpdated();

View File

@ -155,17 +155,11 @@ QToolTip {
<item row="1" column="0">
<widget class="QPlainTextEdit" name="hexOffsetText">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Anonymous Pro</family>
<pointsize>13</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
@ -195,7 +189,7 @@ QToolTip {
<item row="1" column="1">
<widget class="QPlainTextEdit" name="hexHexText">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -212,12 +206,6 @@ QToolTip {
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Anonymous Pro</family>
<pointsize>13</pointsize>
</font>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>