commit
9fd81dde48
4 muutettua tiedostoa jossa 63 lisäystä ja 0 poistoa
@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required (VERSION 3.6) |
||||
project ("hexfm") |
||||
file (GLOB_RECURSE SOURCES "src/*.cpp") |
||||
include_directories("./include") |
||||
|
||||
set(CMAKE_CXX_STANDARD 14) |
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS on) |
||||
set(CMAKE_AUTOMOC on) |
||||
add_executable(hexfm ${SOURCES}) |
||||
|
||||
set(CMAKE_THREAD_PREFER_PTHREAD TRUE) |
||||
find_package(Threads REQUIRED) |
||||
find_package(Qt5Widgets) |
||||
target_link_libraries(hexfm Qt5::Widgets ${CMAKE_THREAD_LIBS_INIT}) |
||||
|
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
#pragma once |
||||
|
||||
#include <QWidget> |
||||
|
||||
class QPushButton; |
||||
class QListView; |
||||
class QStandardItemModel; |
||||
|
||||
class Window : public QWidget { |
||||
public: |
||||
explicit Window(QWidget *parent = 0); |
||||
|
||||
private: |
||||
QPushButton *mButton; |
||||
QListView *mListView; |
||||
QStandardItemModel *mModel; |
||||
}; |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
#include <QApplication> |
||||
#include "window.h" |
||||
int main(int argc, char **argv) |
||||
{ |
||||
QApplication app (argc, argv); |
||||
|
||||
Window window; |
||||
window.show(); |
||||
|
||||
return app.exec(); |
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
#include "window.h" |
||||
|
||||
#include <QPushButton> |
||||
#include <QListView> |
||||
#include <QStandardItemModel> |
||||
#include <QString> |
||||
|
||||
Window::Window(QWidget *parent) : |
||||
QWidget(parent) |
||||
{ |
||||
mListView = new QListView(this); |
||||
mButton = new QPushButton("add", this); |
||||
|
||||
mModel = new QStandardItemModel(); |
||||
mListView->setModel(mModel); |
||||
|
||||
for (int i = 1; i <= 10; ++i) { |
||||
mModel->appendRow(new QStandardItem(QString(i))); |
||||
} |
||||
} |
Ladataan…
Reference in new issue