Sketch Plugin #86
@@ -1,14 +1,26 @@
|
||||
#include "sketchmainwindow.h"
|
||||
#include "ui_sketchmainwindow.h"
|
||||
|
||||
#include <QFileDialog>
|
||||
|
||||
SketchMainWindow::SketchMainWindow(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::SketchMainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->actionOpen->setShortcut(QKeySequence::Open);
|
||||
ui->actionQuit->setShortcut(QKeySequence::Quit);
|
||||
|
||||
connect(ui->actionOpen, &QAction::triggered, this, &SketchMainWindow::openPressed);
|
||||
}
|
||||
|
||||
SketchMainWindow::~SketchMainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SketchMainWindow::openPressed()
|
||||
{
|
||||
QFileDialog::getOpenFileName(this, tr("Select a sketch file"), QString(), QStringLiteral("%0 (*.sketch)").arg(tr("Sketch file")));
|
||||
}
|
||||
|
@@ -15,6 +15,9 @@ public:
|
||||
explicit SketchMainWindow(QWidget *parent = 0);
|
||||
~SketchMainWindow();
|
||||
|
||||
private Q_SLOTS:
|
||||
void openPressed();
|
||||
|
||||
private:
|
||||
Ui::SketchMainWindow *ui;
|
||||
};
|
||||
|
@@ -1,9 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<author/>
|
||||
<comment/>
|
||||
<exportmacro/>
|
||||
<class>SketchMainWindow</class>
|
||||
<widget name="SketchMainWindow" class="QMainWindow">
|
||||
<widget class="QMainWindow" name="SketchMainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@@ -13,12 +11,63 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
<string>Sketch Viewer</string>
|
||||
</property>
|
||||
<widget name="menubar" class="QMenuBar"/>
|
||||
<widget name="centralwidget" class="QWidget"/>
|
||||
<widget name="statusbar" class="QStatusBar"/>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
<property name="title">
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<action name="actionOpen">
|
||||
<property name="text">
|
||||
<string>&Open</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
<property name="text">
|
||||
<string>&Quit</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<pixmapfunction/>
|
||||
<connections/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>actionQuit</sender>
|
||||
<signal>triggered()</signal>
|
||||
<receiver>SketchMainWindow</receiver>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>399</x>
|
||||
<y>299</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
Reference in New Issue
Block a user