-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Open file button added when no file opened #1818
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition!
Please see my inline comments, and also please try to clean up the commits on your branch (look into rebasing and rebase your branch to my latest master
branch).
src/tiled/noeditorwidget.cpp
Outdated
@@ -31,9 +32,9 @@ NoEditorWidget::NoEditorWidget(QWidget *parent) : | |||
ui(new Ui::NoEditorWidget) | |||
{ | |||
ui->setupUi(this); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave the empty line there. :-)
src/tiled/noeditorwidget.cpp
Outdated
connect(ui->newMapButton, &QPushButton::clicked, this, &NoEditorWidget::newMap); | ||
connect(ui->newTilesetButton, &QPushButton::clicked, this, &NoEditorWidget::newTileset); | ||
connect(ui->openFileButton, &QPushButton::clicked, this, &NoEditorWidget::openFile); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can connect to this slot directly without needing NoEditorWidget::openFile
:
connect(ui->openFileButton, &QPushButton::clicked, DocumentManager::instance(), &DocumentManager::openFile);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew about that one, but I wanted to keep the style of it. I'll follow that way then.
Whoops! I didn't notice the failing autobuilds and the change was looking good to me, but actually it didn't compile. Fixed now with change 6fe30ec. :-/ |
Okay, will update again |
Actually one of the lines I added doesn't work for some reason, specifically the one you told me to add. It's weird, I swear it used to work before moving to Qt 5.9... |
No, it can't have worked. I wrote that line on GitHub so I hadn't tried to compile it either, but it couldn't work because there are two overloads of |
I see now, thank you for the enlightenment. It's the first time I see such construction, it seems I still have a lot to learn on C++. |
It's casting to a certain member function signature (a member function of |
I created the missing "Open File..." button in the view when no file is opened.
Result in QtCreator:
Result in Tiled: