Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editable ascii #51

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions example/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ void MainWindow::readSettings()
hexEdit->setFont(settings.value("WidgetFont").value<QFont>());

hexEdit->setAddressWidth(settings.value("AddressAreaWidth").toInt());

hexEdit->setBytesPerLine(settings.value("BytesPerLine").toInt());
}

bool MainWindow::saveFile(const QString &fileName)
Expand Down
6 changes: 5 additions & 1 deletion example/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ void OptionsDialog::readSettings()
#endif

ui->sbAddressAreaWidth->setValue(settings.value("AddressAreaWidth", 4).toInt());

ui->sbBytesPerLine->setValue(settings.value("BytesPerLine", 16).toInt());
}

void OptionsDialog::writeSettings()
Expand All @@ -69,6 +71,8 @@ void OptionsDialog::writeSettings()
settings.setValue("WidgetFont",ui->leWidgetFont->font());

settings.setValue("AddressAreaWidth", ui->sbAddressAreaWidth->value());

settings.setValue("BytesPerLine", ui->sbBytesPerLine->value());
}

void OptionsDialog::setColor(QWidget *widget, QColor color)
Expand Down Expand Up @@ -105,5 +109,5 @@ void OptionsDialog::on_pbWidgetFont_clicked()
bool ok;
QFont font = QFontDialog::getFont(&ok, ui->leWidgetFont->font(), this);
if (ok)
ui->leWidgetFont->setFont(font);
ui->leWidgetFont->setFont(font);
}
84 changes: 61 additions & 23 deletions example/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>395</width>
<height>362</height>
<height>472</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -64,10 +64,10 @@
<string>Colors and Fonts</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="pbHighlightingColor">
<item row="4" column="0">
<widget class="QPushButton" name="pbWidgetFont">
<property name="text">
<string>Highlighting Color</string>
<string>Widget Font</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -103,8 +103,15 @@
</property>
</widget>
</item>
<item row="1" column="1" rowspan="2">
<widget class="QLabel" name="lbAddressAreaColor">
<item row="0" column="0">
<widget class="QPushButton" name="pbHighlightingColor">
<property name="text">
<string>Highlighting Color</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="lbSelectionColor">
<property name="minimumSize">
<size>
<width>100</width>
Expand All @@ -128,8 +135,8 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="lbSelectionColor">
<item row="1" column="1" rowspan="2">
<widget class="QLabel" name="lbAddressAreaColor">
<property name="minimumSize">
<size>
<width>100</width>
Expand Down Expand Up @@ -160,13 +167,6 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pbWidgetFont">
<property name="text">
<string>Widget Font</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="leWidgetFont">
<property name="sizePolicy">
Expand Down Expand Up @@ -195,13 +195,6 @@
<string>Address Area</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="lbAddressAreaWidth">
<property name="text">
<string>Address Area Width</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="sbAddressAreaWidth">
<property name="minimum">
Expand All @@ -215,6 +208,13 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lbAddressAreaWidth">
<property name="text">
<string>Address Area Width</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand All @@ -231,6 +231,37 @@
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Data Area</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lbBytesPerLine">
<property name="text">
<string>Bytes per line</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="sbBytesPerLine">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>1024</number>
</property>
<property name="value">
<number>16</number>
</property>
</widget>
</item>
</layout>
<zorder>sbBytesPerLine</zorder>
<zorder>lbBytesPerLine</zorder>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
Expand All @@ -244,9 +275,16 @@
</layout>
</widget>
<tabstops>
<tabstop>cbOverwriteMode</tabstop>
<tabstop>cbHighlighting</tabstop>
<tabstop>cbReadOnly</tabstop>
<tabstop>pbHighlightingColor</tabstop>
<tabstop>pbAddressAreaColor</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>pbSelectionColor</tabstop>
<tabstop>pbWidgetFont</tabstop>
<tabstop>leWidgetFont</tabstop>
<tabstop>sbAddressAreaWidth</tabstop>
<tabstop>sbBytesPerLine</tabstop>
</tabstops>
<resources/>
<connections>
Expand Down
Loading