Skip to content
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

Add panes splitting, auto filter and selection features. #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions examples/xlsx/panes/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#include "xlsxdocument.h"
#include "xlsxworksheet.h"

int main()
{
QXlsx::Document xlsx;

xlsx.write("A1", "PLANET");
xlsx.write("A2", "Mercury");
xlsx.write("A3", "Venus");
xlsx.write("A4", "Earth");
xlsx.write("A5", "Mars");
xlsx.write("A6", "Jupiter");
xlsx.write("A7", "Saturn");
xlsx.write("A8", "Uranus");
xlsx.write("A9", "Neptune");

xlsx.write("B1", "TYPE");
xlsx.write("B2", "terrestrial");
xlsx.write("B3", "terrestrial");
xlsx.write("B4", "terrestrial");
xlsx.write("B5", "terrestrial");
xlsx.write("B6", "gaz giant");
xlsx.write("B7", "gaz giant");
xlsx.write("B8", "ice giant");
xlsx.write("B9", "ice giant");

xlsx.write("C1", "RADIUS");
xlsx.write("C2", 2440);
xlsx.write("C3", 6052);
xlsx.write("C4", 6378);
xlsx.write("C5", 3397);
xlsx.write("C6", 69911);
xlsx.write("C7", 58232);
xlsx.write("C8", 25362);
xlsx.write("C9", 24622);

xlsx.write("D1", "MASS");
xlsx.write("D2", 3.301e23);
xlsx.write("D3", 4.867e24);
xlsx.write("D4", 6.046e24);
xlsx.write("D5", 6.417e23);
xlsx.write("D6", 1.9e27);
xlsx.write("D7", 5.68e26);
xlsx.write("D8", 8.68e25);
xlsx.write("D9", 1.02e26);

xlsx.renameSheet("Sheet1", "FrozenPanes");
xlsx.copySheet("FrozenPanes", "SplitPanes");

xlsx.selectSheet("SplitPanes");
xlsx.currentWorksheet()->splitPane(1350, 600, "B2");
xlsx.currentWorksheet()->setSelection("C4");
xlsx.currentWorksheet()->setAutoFilter("A1:B1");

xlsx.selectSheet("FrozenPanes");
xlsx.currentWorksheet()->freezePane("A1", "B2");
xlsx.currentWorksheet()->setSelection("A4", "A4:D4");
xlsx.currentWorksheet()->setAutoFilter("A1:B1");

xlsx.save();
}
10 changes: 10 additions & 0 deletions examples/xlsx/panes/panes.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include(../../../src/xlsx/qtxlsx.pri)
QT += xlsx

TARGET = panes
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app

SOURCES += main.cpp
3 changes: 2 additions & 1 deletion examples/xlsx/xlsx.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ SUBDIRS = hello \
chart \
chartsheet \
calendar \
demo
demo \
panes

qtHaveModule(widgets): SUBDIRS += xlsxwidget

Loading