« first day (42 days earlier)      last day (3035 days later) » 

15:35
@nwp are you around?
nwp
nwp
yup
There is no where in the code I am able to find event handlers of buttons
Is it also possible that eventhandlers (clicked and so) are also dynamic?
nwp
nwp
yes
did you find the buttons in the .ui?
.. I see many .ui but most are just empty. I see some buttons around though. IF I GoToSlot->Clicked() it pops that it is nowhere in the code
nwp
nwp
inside the designer (that shows the forms) at the bottom there is a "Signals & Slots Editor" tab
which has the preset connections
15:42
yup I see them
nwp
nwp
does it have the connections you are looking for?
the whole forms has same two in this sample
if I double click, it does not do anything
nwp
nwp
same two what?
nwp
nwp
is the button you care about called ButtonBox?
15:44
here yes
I am just looking at one of the forms
nwp
nwp
that doesn't make sense, buttons have no signal accepted or rejected
nwp
nwp
ah, ok, QButtonBox, not QButton
makes sense now
the point of a QButtonBox is that it shows you things like "Yes", "No", "Cancel" in the correct order
the correct order depends on the operating system, thats why they made a button combination thing
FirstStart is the form?
one of the forms yeah
there are like 100
and this buttons says Class: QDialogButtonBox
nwp
nwp
there should be a slot/function FirstStart::accept somewhere that gets called when you click the Ok button
15:49
I see
let me search
nwp
nwp
probably something like class FirstStart{ slots: void accept(); };
FirstStartDialog{ slots: void accept(); };
no match found
using Ctrl Shift F
and FirstStartDialog::accept also no results found
nwp
nwp
the receiver is just called FirstStart, not FirstStartDialog
searching for class FirstStart should work
and then check for an accept function inside that class
oh, the form is usually called "ClassName"Dialoge
?
nwp
nwp
don't think so, different projects use different naming conventions
but the screenshot says the receiver is called FirstStart
15:58
the file is called FirstStartDialog.ui
I found a function called FirstStart() and it has ShowDialog in it, then it creates a widget
nwp
nwp
that is probably it
something like this.dialog = WidgetFactory.createWidget(this.path, "FirstStartDialog.ui", null);
nwp
nwp
functions can be receivers too
so i think that is it
trying to hit it now
app starts with no hits :/
nwp
nwp
by hits you mean breakpoint?
16:01
yes
nwp
nwp
are breakpoints in general working? Is it a debug build?
yes
I hit main() fine when I start
oh wait
main did not hit this time
it was hitting
If I start with f10 then it hits main
If I RUN then it does not hit
nwp
nwp
run means starting without the debugger
F5 is run with debugger
and ctrl+R is without
oh..
I see
If I start with f10 and then press f5, it still finishes launching and the main application shows up, yet it does not hit FirstStart()
I think I need to look somewhere else
sbi
sbi
16:23
Hi, I'm the grumpy old ape, and I do have a C++ question to ask.
hello @sbi
go for it
sbi
sbi
Actually, it's more a sanity check, as I cannot believe my compiler gets this wrong.
Anyway, a piece of code similar to the following snippet has just produced the message "Huh?", and I think this is a bug in (the admittedly rather old version of) GCC (we need to use).
struct foo {
  bool        flag;
  std::string str;
  unsigned    uint;
};

class bar {
private:
  foo some_foo;
 public:
  bar()
  : some_foo()
  {
    if(some_foo.flag)
	  std::cerr << "Huh?\n";
  }
};
IIRC, POD members are zero-initialized if the POD is zero initialized. I think this also applies to POD members of non-PODs, BICBW.
nwp
nwp
inside bar you are not zero-initializing some_foo
so all its members are uninitialized
(not 100% sure, need to check)
sbi
sbi
@nwp "POD members are zero-initialized if the POD is zero initialized." (some_foo())
I am sure that, if foo only contained PODs, this would work as I expect it to.
I am just not sure whether this works if foo isn't a POD.
nwp
nwp
this seems relevant, but I haven't completely understood it yet
it seems to say that no initialization is performed in your case because it is not a POD
sbi
sbi
16:34
@nwp Ah, indeed. Too bad!
@sbi I think it's default initialized, which is indeterminate for POD
So, you should probably do some_foo {} to zero initialize it (aggregate initialization)
nwp
nwp
but old compiler probably doesn't like that
Aggregate initialization is C-old
sbi
sbi
@sehe C++03 here... :(
@sehe Sigh. Mea culpa, then. I knew it...
nwp
nwp
@sehe clang at least rejects bar() : some_foo{} in c++03, but maybe you meant something else
16:43
@nwp It's likely due to std::string
sbi
sbi
@sehe What?? Hey, you of all chatters here should be old enough to remember that there was no universal initialization in C++03!
@nwp Looks like the compiler just emits a compatibility diagnostic. Compare coliru.stacked-crooked.com/a/89daff4f433869f6 /cc @sbi
Or, I'm a nitwit and aggregate initialization never was a feature in member initializers (before c++11 and/or NSMI)
It does show it wasn't due to std::string, though, for sure.
nwp
nwp
your code is somewhat different in that some_foo is not a member of bar
sbi
sbi
@sehe *desperately clamps his hands over his mouth*
Thank you
@nwp Gosh. You don't really think I didn't notice that when I purposely edited it to show you the differrence? That's why I used the word "Compare"
sbi
sbi
16:56
Well, I've given the damn thing a dctor now, will run the tests, and then close this stupid bug... Bye and thanks for your help, guys!
Cheers
nwp
nwp
@sehe no clue what you mean by "just emits a compatibility diagnostic" then. The original code with {} gives me a fatal error: expected member name or ';' after declaration specifiers {
also I don't understand how adding a destructor would solve the problem with constructing an object with uninitialized members, but sbi doesn't seem to want to bother anymore
 
5 hours later…
22:01
if (xtr)
y = y - x % 2 + (yt > (this->hexagon_height * 0.5f));
y = y - (x % 2 + (yt > (this->hexagon_height * 0.5f))) * xtr;
woops
well, I wanted to ask what's the difference between

if (xtr) {
y = y - x % 2 + (yt > (this->hexagon_height * 0.5f));
}

and

y = y - (x % 2 + (yt > (this->hexagon_height * 0.5f))) * xtr;

whereas xtr is a boolean. The if statement seems to produce the right result while the second statement does not.
I think the second statement should become
y = y;
when xtr is false.
 
2 hours later…
nwp
nwp
23:44
@Aistis You should use the "fixed font"-button that appears when you have multiple lines or the backticks (`) to format the code.
also add a working example on coliru so we have something to play with

« first day (42 days earlier)      last day (3035 days later) »