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

Show values as floats in watch #8219

Merged
merged 1 commit into from Jun 30, 2019

Conversation

4 participants
@Pokechu22
Copy link
Contributor

commented Jun 28, 2019

This adds another column for the value as a float on the watch widget.

@@ -132,7 +132,8 @@ void WatchWidget::Update()
// i18n: The base 10 numeral system. Not related to non-integer numbers
tr("Decimal"),
// i18n: Data type used in computing
tr("String")});
tr("String"),
tr("Float")});

This comment has been minimized.

Copy link
@BhaaLseN

BhaaLseN Jun 28, 2019

Member

This should probably have an i18n comment about floating point numbers (data type)

This comment has been minimized.

Copy link
@Pokechu22

Pokechu22 Jun 28, 2019

Author Contributor

Added.

}

auto* label = new QTableWidgetItem;
label->setData(Qt::UserRole, -1);

m_table->setItem(size, 0, label);

for (int i = 1; i < 5; i++)
for (int i = 1; i < 6; i++)

This comment has been minimized.

Copy link
@BhaaLseN

BhaaLseN Jun 28, 2019

Member

Can we constexpr this number and also use it up there with setColumnCount?
Or, if we have a better alternative (like an array or whatever) that returns us that exact number; use that instead please.

This comment has been minimized.

Copy link
@Pokechu22

Pokechu22 Jun 28, 2019

Author Contributor

There isn't currently an array, beyond the temporary one used earlier:

for (auto* item : {label, address, hex, decimal, string})

This comment has been minimized.

Copy link
@Pokechu22

Pokechu22 Jun 28, 2019

Author Contributor

I've attempted to do this. I'm not super skilled with C++ so I'm not sure I did it the best way.

@Pokechu22 Pokechu22 force-pushed the Pokechu22:float-watch branch 2 times, most recently from a8c78b0 to 26d9968 Jun 28, 2019

@jordan-woyak

This comment has been minimized.

Copy link
Member

commented Jun 29, 2019

@stenzek
Copy link
Contributor

left a comment

LGTM otherwise


int column = 0;

for (auto* item : {label, address, hex, decimal, string})
for (auto* item : items)

This comment has been minimized.

Copy link
@stenzek

stenzek Jun 29, 2019

Contributor

This could be for (int column = 0; column < NUM_COLUMNS; column++) then m_table->setItem(i, column, items[column];.

This comment has been minimized.

Copy link
@Pokechu22

Pokechu22 Jun 29, 2019

Author Contributor

Done.

@Pokechu22 Pokechu22 force-pushed the Pokechu22:float-watch branch from 26d9968 to ae0843f Jun 29, 2019

@stenzek stenzek merged commit 0d2c3e6 into dolphin-emu:master Jun 30, 2019

10 checks passed

default Very basic checks passed, handed off to Buildbot.
Details
lint Build succeeded on builder lint
Details
pr-android Build succeeded on builder pr-android
Details
pr-deb-dbg-x64 Build succeeded on builder pr-deb-dbg-x64
Details
pr-deb-x64 Build succeeded on builder pr-deb-x64
Details
pr-freebsd-x64 Build succeeded on builder pr-freebsd-x64
Details
pr-osx-x64 Build succeeded on builder pr-osx-x64
Details
pr-ubu-x64 Build succeeded on builder pr-ubu-x64
Details
pr-win-dbg-x64 Build succeeded on builder pr-win-dbg-x64
Details
pr-win-x64 Build succeeded on builder pr-win-x64
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.