• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

okteta

  • sources
  • kde-4.12
  • kdesdk
  • okteta
  • designer
  • examples
designer/examples/main.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the Okteta project, made within the KDE community.
3 
4  Copyright 2009,2011 Friedrich W. H. Kossebau <kossebau@kde.org>
5 
6  Public domain.
7 */
8 
10 // ui
11 #include "ui_example_widget.h"
13 // Okteta core
14 #include <okteta1/piecetablebytearraymodel.h>
16 #include <Okteta1/PieceTableByteArrayModel>
17 
19 // KDE
20 #include <KApplication>
21 #include <KCmdLineArgs>
22 #include <KAboutData>
23 
24 
27 static const char exampleInitialData[] =
28  "This is some data for the Okteta byte array widgets:"
29  "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
30  "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
31  "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"
32  "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"
33  "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F"
34  "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F"
35  "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F"
36  "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F"
37  "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F"
38  "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"
39  "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF"
40  "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF"
41  "\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF"
42  "\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF"
43  "\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF"
44  "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
45 
46 static const int exampleInitialDataSize = sizeof(exampleInitialData) / sizeof(exampleInitialData[0]);
47 
48 
49 class Widget : public QWidget
50 {
51  public:
52  explicit Widget( QWidget* parent = 0 );
53  virtual ~Widget();
54 
55  private:
56  Ui::Example_Widget ui;
57 
61  Okteta::PieceTableByteArrayModel* mByteArrayModel;
62 };
63 
64 
65 Widget::Widget( QWidget* parent )
66  : QWidget(parent)
67 {
69  ui.setupUi( this );
70 
72  mByteArrayModel =
73  new Okteta::PieceTableByteArrayModel( QByteArray::fromRawData(exampleInitialData,exampleInitialDataSize), this );
74 
78  ui.mByteArrayColumnView->setByteArrayModel( mByteArrayModel );
79  ui.mByteArrayRowView->setByteArrayModel( mByteArrayModel );
80 }
81 
82 Widget::~Widget() {}
83 
84 
85 int main( int argc, char* argv[] )
86 {
87  KAboutData aboutData( "uitest", "UIT", ki18n(""), "", ki18n("") );
88  KCmdLineArgs::init( argc, argv, &aboutData );
89  KApplication programCore;
90 
91  Widget* widget = new Widget;
92  widget->show();
93 
94  return programCore.exec();
95 }
QWidget
exampleInitialDataSize
static const int exampleInitialDataSize
Definition: designer/examples/main.cpp:46
exampleInitialData
static const char exampleInitialData[]
Definition: designer/examples/main.cpp:27
KAboutData
main
int main(int argc, char *argv[])
Definition: designer/examples/main.cpp:85
Okteta::PieceTableByteArrayModel
Definition: piecetablebytearraymodel.h:44
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:04:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okteta

Skip menu "okteta"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal