*** empty log message ***
This commit is contained in:
@@ -0,0 +1,245 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>Form1</class>
|
||||
<widget class="QMainWindow">
|
||||
<property name="name">
|
||||
<cstring>Form1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>774</width>
|
||||
<height>619</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>Form1</string>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout7</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>11</y>
|
||||
<width>752</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>queryText</cstring>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>LineEditPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>Search</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>pushButton1</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer1</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QSplitter">
|
||||
<property name="name">
|
||||
<cstring>splitter9</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>11</x>
|
||||
<y>58</y>
|
||||
<width>752</width>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QTextEdit">
|
||||
<property name="name">
|
||||
<cstring>resTextEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSplitter">
|
||||
<property name="name">
|
||||
<cstring>splitter8</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<widget class="QTextEdit">
|
||||
<property name="name">
|
||||
<cstring>textEdit12</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit">
|
||||
<property name="name">
|
||||
<cstring>textEdit13</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<menubar>
|
||||
<property name="name">
|
||||
<cstring>MenuBar</cstring>
|
||||
</property>
|
||||
<item text="&File" name="fileMenu">
|
||||
<separator/>
|
||||
<separator/>
|
||||
<action name="fileExitAction"/>
|
||||
</item>
|
||||
<item text="&Help" name="helpMenu">
|
||||
<action name="helpContentsAction"/>
|
||||
<action name="helpIndexAction"/>
|
||||
<separator/>
|
||||
<action name="helpAboutAction"/>
|
||||
</item>
|
||||
</menubar>
|
||||
<toolbars>
|
||||
</toolbars>
|
||||
<actions>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>fileExitAction</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exit</string>
|
||||
</property>
|
||||
<property name="menuText">
|
||||
<string>E&xit</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>helpContentsAction</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Contents</string>
|
||||
</property>
|
||||
<property name="menuText">
|
||||
<string>&Contents...</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>helpIndexAction</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Index</string>
|
||||
</property>
|
||||
<property name="menuText">
|
||||
<string>&Index...</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</action>
|
||||
<action>
|
||||
<property name="name">
|
||||
<cstring>helpAboutAction</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>About</string>
|
||||
</property>
|
||||
<property name="menuText">
|
||||
<string>&About</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
</action>
|
||||
</actions>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>fileExitAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>fileExit()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>helpIndexAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>helpIndex()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>helpContentsAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>helpContents()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>helpAboutAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>helpAbout()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resTextEdit</sender>
|
||||
<signal>clicked(int,int)</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>resTextEdit_clicked(int,int)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>resTextEdit</sender>
|
||||
<signal>returnPressed()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>resTextEdit_returnPressed()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fileExitAction</sender>
|
||||
<signal>activated()</signal>
|
||||
<receiver>Form1</receiver>
|
||||
<slot>fileExit()</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<includes>
|
||||
<include location="local" impldecl="in implementation">form1.ui.h</include>
|
||||
</includes>
|
||||
<slots>
|
||||
<slot>fileExit()</slot>
|
||||
<slot>helpIndex()</slot>
|
||||
<slot>helpContents()</slot>
|
||||
<slot>helpAbout()</slot>
|
||||
<slot>resTextEdit_clicked( int par, int car )</slot>
|
||||
<slot>resTextEdit_returnPressed()</slot>
|
||||
</slots>
|
||||
<pixmapinproject/>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
@@ -0,0 +1,60 @@
|
||||
/****************************************************************************
|
||||
** ui.h extension file, included from the uic-generated form implementation.
|
||||
**
|
||||
** If you want to add, delete, or rename functions or slots, use
|
||||
** Qt Designer to update this file, preserving your code.
|
||||
**
|
||||
** You should not define a constructor or destructor in this file.
|
||||
** Instead, write your code in functions called init() and destroy().
|
||||
** These will automatically be called by the form's constructor and
|
||||
** destructor.
|
||||
*****************************************************************************/
|
||||
|
||||
void Form1::fileExit()
|
||||
{
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
void Form1::helpIndex()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Form1::helpContents()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Form1::helpAbout()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void Form1::resTextEdit_clicked( int par, int car )
|
||||
{
|
||||
fprintf(stderr, "Clicked at paragraph %d, char %d\n", par, car);
|
||||
}
|
||||
#include "qfontdialog.h"
|
||||
|
||||
#define BS 200000
|
||||
void Form1::resTextEdit_returnPressed()
|
||||
{
|
||||
fprintf(stderr, "ReturnPressed()\n");
|
||||
resTextEdit->setFont( QFontDialog::getFont( 0, resTextEdit->font() ) );
|
||||
const char *fname = "utf8.txt";
|
||||
FILE *fp = fopen(fname, "r");
|
||||
if (fp) {
|
||||
char buf[BS];
|
||||
memset(buf,0, sizeof(buf));
|
||||
int n = fread(buf, 1, BS-1, fp);
|
||||
fclose(fp);
|
||||
QString str = QString::fromUtf8(buf, n);
|
||||
resTextEdit->setTextFormat(RichText);
|
||||
resTextEdit->setText(str);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include <qapplication.h>
|
||||
#include "form1.h"
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
QApplication a( argc, argv );
|
||||
Form1 w;
|
||||
w.show();
|
||||
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
|
||||
return a.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user