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

3:35 PM
@nwp are you around?
 
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
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
inside the designer (that shows the forms) at the bottom there is a "Signals & Slots Editor" tab
which has the preset connections
 
3:42 PM
yup I see them
 
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
same two what?
 
nwp
is the button you care about called ButtonBox?
 
3:44 PM
here yes
I am just looking at one of the forms
 
nwp
that doesn't make sense, buttons have no signal accepted or rejected
 
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
there should be a slot/function FirstStart::accept somewhere that gets called when you click the Ok button
 
3:49 PM
I see
let me search
 
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
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
don't think so, different projects use different naming conventions
but the screenshot says the receiver is called FirstStart
 
3:58 PM
the file is called FirstStartDialog.ui
I found a function called FirstStart() and it has ShowDialog in it, then it creates a widget
 
nwp
that is probably it
 
something like this.dialog = WidgetFactory.createWidget(this.path, "FirstStartDialog.ui", null);
 
nwp
functions can be receivers too
 
so i think that is it
trying to hit it now
app starts with no hits :/
 
nwp
by hits you mean breakpoint?
 
4:01 PM
yes
 
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
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
4:23 PM
Hi, I'm the grumpy old ape, and I do have a C++ question to ask.
 
hello @sbi
go for it
 
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
inside bar you are not zero-initializing some_foo
so all its members are uninitialized
(not 100% sure, need to check)
 
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
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
4:34 PM
@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
but old compiler probably doesn't like that
 
Aggregate initialization is C-old
 
sbi
@sehe C++03 here... :(
@sehe Sigh. Mea culpa, then. I knew it...
 
nwp
@sehe clang at least rejects bar() : some_foo{} in c++03, but maybe you meant something else
 
4:43 PM
@nwp It's likely due to std::string
 
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
your code is somewhat different in that some_foo is not a member of bar
 
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
4:56 PM
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
@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…
10:01 PM
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
11:44 PM
@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 (2815 days later) »