Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Added GUI fixes: fixed size for main window Exit button Title bar was removed Move widget from window body functionality was added |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | 38d7e9175ed9136ee1f9d697f63e09aad1d45afa |
User & Date: | azadok 2013-12-25 18:21:42 |
Context
2014-01-25
| ||
21:08 | Layout was inserted for the GUI check-in: 8a99fa98b5 user: azadok tags: trunk | |
2013-12-25
| ||
18:21 | Added GUI fixes: fixed size for main window Exit button Title bar was removed Move widget from window body functionality was added check-in: 38d7e9175e user: azadok tags: trunk | |
2013-12-22
| ||
20:41 | Added support for changing noty types using arrows. GUI support. check-in: 9b95a27cc5 user: azadok tags: trunk | |
Changes
Changes to RapidReporter2/mainwindow.cpp.
4
5
6
7
8
9
10
11
12
13
14
15
16
17
...
287
288
289
290
291
292
293
294
295
296
|
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
sessionStarted=false;
keyEnterReceiver *key = new keyEnterReceiver();
ui->textEdit->installEventFilter(key);
initLables();
................................................................................
{
if (sessionStarted) {
session->CloseSession();
}
event->accept();
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
...
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
#include <QMessageBox> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); Qt::WindowFlags flags = Qt::CustomizeWindowHint; setWindowFlags(flags); this->setFixedSize(870,75); sessionStarted=false; keyEnterReceiver *key = new keyEnterReceiver(); ui->textEdit->installEventFilter(key); initLables(); ................................................................................ { if (sessionStarted) { session->CloseSession(); } event->accept(); } void MainWindow::mousePressEvent(QMouseEvent *event) { mpos = event->pos(); } void MainWindow::mouseMoveEvent(QMouseEvent *event) { if (event->buttons() && Qt::LeftButton) { QPoint diff = event->pos() - mpos; QPoint newpos = this->pos() + diff; this->move(newpos); } } void MainWindow::on_pushButton_3_clicked() { QApplication::sendEvent(this,new QCloseEvent()); QApplication::quit(); } |
Changes to RapidReporter2/mainwindow.h.
1 2 3 4 5 6 7 8 9 10 11 12 13 .. 14 15 16 17 18 19 20 21 22 23 24 25 26 27 .. 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QKeyEvent> #include <QLabel> #include "keyenterreceiver.h" #include "session.h" namespace Ui { class MainWindow; } ................................................................................ class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QString getReporterTmp() const; void setReporterTmp(const QString &value); QStringList getUserTypeTmp() const; ................................................................................ void setLableText(QString lableName, QString Text); void setLableText(QLabel *lableName, QString Text); void initLables(); void updateAllTypeLables(bool increase); void clearContentText(); //void keyPressEvent(QKeyEvent *); private: Ui::MainWindow *ui; QString helpString; bool sessionStarted; Session * session; QString reporterTmp; QStringList userTypeTmp; void closeEvent(QCloseEvent *); }; #endif // MAINWINDOW_H |
> > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 .. 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 .. 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QKeyEvent> #include <QLabel> #include <QtCore> #include "keyenterreceiver.h" #include "session.h" namespace Ui { class MainWindow; } ................................................................................ class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); QString getReporterTmp() const; void setReporterTmp(const QString &value); QStringList getUserTypeTmp() const; ................................................................................ void setLableText(QString lableName, QString Text); void setLableText(QLabel *lableName, QString Text); void initLables(); void updateAllTypeLables(bool increase); void clearContentText(); //void keyPressEvent(QKeyEvent *); private slots: void on_pushButton_3_clicked(); private: Ui::MainWindow *ui; QString helpString; bool sessionStarted; Session * session; QString reporterTmp; QStringList userTypeTmp; void closeEvent(QCloseEvent *); // http://stackoverflow.com/questions/5513060/qt-4-move-window-without-title-bar QPoint mpos; void mousePressEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); }; #endif // MAINWINDOW_H |
Changes to RapidReporter2/mainwindow.ui.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 .. 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 .. 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 ... 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
<ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>847</width> <height>144</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> <widget class="QPushButton" name="pushButton"> <property name="geometry"> <rect> <x>70</x> <y>10</y> <width>91</width> <height>23</height> </rect> </property> <property name="text"> <string>Screenshot</string> </property> </widget> <widget class="QPushButton" name="pushButton_2"> <property name="geometry"> <rect> <x>70</x> <y>40</y> <width>91</width> <height>23</height> </rect> </property> <property name="text"> <string>RTF</string> </property> </widget> <widget class="QTextEdit" name="textEdit"> <property name="geometry"> <rect> <x>430</x> <y>10</y> <width>391</width> <height>51</height> </rect> </property> <property name="readOnly"> <bool>false</bool> ................................................................................ </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string> </property> </widget> <widget class="QLabel" name="label_field"> <property name="geometry"> <rect> <x>250</x> <y>10</y> <width>161</width> <height>51</height> </rect> </property> <property name="text"> <string/> ................................................................................ <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> <widget class="QProgressBar" name="progressBar"> <property name="geometry"> <rect> <x>20</x> <y>10</y> <width>21</width> <height>71</height> </rect> </property> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> ................................................................................ <property name="textDirection"> <enum>QProgressBar::BottomToTop</enum> </property> </widget> <widget class="QLabel" name="Prev_label"> <property name="geometry"> <rect> <x>170</x> <y>40</y> <width>121</width> <height>20</height> </rect> </property> <property name="text"> <string>TextLabel</string> </property> </widget> <widget class="QLabel" name="Next_label"> <property name="geometry"> <rect> <x>170</x> <y>10</y> <width>121</width> <height>16</height> </rect> </property> <property name="text"> <string>TextLabel</string> </property> </widget> </widget> <widget class="QMenuBar" name="menuBar"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>847</width> <height>21</height> </rect> </property> </widget> <widget class="QToolBar" name="mainToolBar"> <attribute name="toolBarArea"> <enum>TopToolBarArea</enum> </attribute> <attribute name="toolBarBreak"> <bool>false</bool> </attribute> </widget> </widget> <layoutdefault spacing="6" margin="11"/> <resources/> <connections/> </ui> |
| | > > > > > > | | | | | | | | > > > > > > > > > > > > > | < < < < < < < < |
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 .. 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 .. 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 ... 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
<ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>869</width> <height>90</height> </rect> </property> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> <widget class="QPushButton" name="pushButton"> <property name="geometry"> <rect> <x>40</x> <y>10</y> <width>91</width> <height>23</height> </rect> </property> <property name="text"> <string>Screenshot</string> </property> </widget> <widget class="QPushButton" name="pushButton_2"> <property name="geometry"> <rect> <x>40</x> <y>40</y> <width>91</width> <height>23</height> </rect> </property> <property name="text"> <string>RTF</string> </property> </widget> <widget class="QTextEdit" name="textEdit"> <property name="geometry"> <rect> <x>440</x> <y>10</y> <width>391</width> <height>51</height> </rect> </property> <property name="readOnly"> <bool>false</bool> ................................................................................ </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><br /></p></body></html></string> </property> </widget> <widget class="QLabel" name="label_field"> <property name="geometry"> <rect> <x>260</x> <y>10</y> <width>161</width> <height>51</height> </rect> </property> <property name="text"> <string/> ................................................................................ <property name="alignment"> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> </property> </widget> <widget class="QProgressBar" name="progressBar"> <property name="geometry"> <rect> <x>10</x> <y>10</y> <width>21</width> <height>51</height> </rect> </property> <property name="sizePolicy"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> ................................................................................ <property name="textDirection"> <enum>QProgressBar::BottomToTop</enum> </property> </widget> <widget class="QLabel" name="Prev_label"> <property name="geometry"> <rect> <x>150</x> <y>40</y> <width>121</width> <height>20</height> </rect> </property> <property name="text"> <string>TextLabel</string> </property> </widget> <widget class="QLabel" name="Next_label"> <property name="geometry"> <rect> <x>150</x> <y>10</y> <width>121</width> <height>16</height> </rect> </property> <property name="text"> <string>TextLabel</string> </property> </widget> <widget class="QPushButton" name="pushButton_3"> <property name="geometry"> <rect> <x>840</x> <y>10</y> <width>21</width> <height>21</height> </rect> </property> <property name="text"> <string>X</string> </property> </widget> </widget> <widget class="QMenuBar" name="menuBar"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>869</width> <height>21</height> </rect> </property> </widget> </widget> <layoutdefault spacing="6" margin="11"/> <resources/> <connections/> </ui> |
Changes to RapidReporter2/ui_mainwindow.h.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 .. 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 ... 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
#include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMenuBar> #include <QtWidgets/QProgressBar> #include <QtWidgets/QPushButton> #include <QtWidgets/QTextEdit> #include <QtWidgets/QToolBar> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_MainWindow { public: ................................................................................ QPushButton *pushButton; QPushButton *pushButton_2; QTextEdit *textEdit; QLabel *label_field; QProgressBar *progressBar; QLabel *Prev_label; QLabel *Next_label; QMenuBar *menuBar; QToolBar *mainToolBar; void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(847, 144); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); pushButton = new QPushButton(centralWidget); pushButton->setObjectName(QStringLiteral("pushButton")); pushButton->setGeometry(QRect(70, 10, 91, 23)); pushButton_2 = new QPushButton(centralWidget); pushButton_2->setObjectName(QStringLiteral("pushButton_2")); pushButton_2->setGeometry(QRect(70, 40, 91, 23)); textEdit = new QTextEdit(centralWidget); textEdit->setObjectName(QStringLiteral("textEdit")); textEdit->setGeometry(QRect(430, 10, 391, 51)); textEdit->setReadOnly(false); label_field = new QLabel(centralWidget); label_field->setObjectName(QStringLiteral("label_field")); label_field->setGeometry(QRect(250, 10, 161, 51)); label_field->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); progressBar = new QProgressBar(centralWidget); progressBar->setObjectName(QStringLiteral("progressBar")); progressBar->setGeometry(QRect(20, 10, 21, 71)); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(progressBar->sizePolicy().hasHeightForWidth()); progressBar->setSizePolicy(sizePolicy); progressBar->setValue(0); progressBar->setAlignment(Qt::AlignCenter); progressBar->setOrientation(Qt::Vertical); progressBar->setTextDirection(QProgressBar::BottomToTop); Prev_label = new QLabel(centralWidget); Prev_label->setObjectName(QStringLiteral("Prev_label")); Prev_label->setGeometry(QRect(170, 40, 121, 20)); Next_label = new QLabel(centralWidget); Next_label->setObjectName(QStringLiteral("Next_label")); Next_label->setGeometry(QRect(170, 10, 121, 16)); MainWindow->setCentralWidget(centralWidget); menuBar = new QMenuBar(MainWindow); menuBar->setObjectName(QStringLiteral("menuBar")); menuBar->setGeometry(QRect(0, 0, 847, 21)); MainWindow->setMenuBar(menuBar); mainToolBar = new QToolBar(MainWindow); mainToolBar->setObjectName(QStringLiteral("mainToolBar")); MainWindow->addToolBar(Qt::TopToolBarArea, mainToolBar); retranslateUi(MainWindow); QMetaObject::connectSlotsByName(MainWindow); } // setupUi void retranslateUi(QMainWindow *MainWindow) ................................................................................ "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"><br /></p></body></html>", 0)); label_field->setText(QString()); Prev_label->setText(QApplication::translate("MainWindow", "TextLabel", 0)); Next_label->setText(QApplication::translate("MainWindow", "TextLabel", 0)); } // retranslateUi }; namespace Ui { class MainWindow: public Ui_MainWindow {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MAINWINDOW_H |
< > < | > > > > > | | | | | | | | | | | | > > > | < < < > |
16 17 18 19 20 21 22 23 24 25 26 27 28 29 .. 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ... 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
#include <QtWidgets/QHeaderView> #include <QtWidgets/QLabel> #include <QtWidgets/QMainWindow> #include <QtWidgets/QMenuBar> #include <QtWidgets/QProgressBar> #include <QtWidgets/QPushButton> #include <QtWidgets/QTextEdit> #include <QtWidgets/QWidget> QT_BEGIN_NAMESPACE class Ui_MainWindow { public: ................................................................................ QPushButton *pushButton; QPushButton *pushButton_2; QTextEdit *textEdit; QLabel *label_field; QProgressBar *progressBar; QLabel *Prev_label; QLabel *Next_label; QPushButton *pushButton_3; QMenuBar *menuBar; void setupUi(QMainWindow *MainWindow) { if (MainWindow->objectName().isEmpty()) MainWindow->setObjectName(QStringLiteral("MainWindow")); MainWindow->resize(869, 90); QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); sizePolicy.setHorizontalStretch(0); sizePolicy.setVerticalStretch(0); sizePolicy.setHeightForWidth(MainWindow->sizePolicy().hasHeightForWidth()); MainWindow->setSizePolicy(sizePolicy); centralWidget = new QWidget(MainWindow); centralWidget->setObjectName(QStringLiteral("centralWidget")); pushButton = new QPushButton(centralWidget); pushButton->setObjectName(QStringLiteral("pushButton")); pushButton->setGeometry(QRect(40, 10, 91, 23)); pushButton_2 = new QPushButton(centralWidget); pushButton_2->setObjectName(QStringLiteral("pushButton_2")); pushButton_2->setGeometry(QRect(40, 40, 91, 23)); textEdit = new QTextEdit(centralWidget); textEdit->setObjectName(QStringLiteral("textEdit")); textEdit->setGeometry(QRect(440, 10, 391, 51)); textEdit->setReadOnly(false); label_field = new QLabel(centralWidget); label_field->setObjectName(QStringLiteral("label_field")); label_field->setGeometry(QRect(260, 10, 161, 51)); label_field->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); progressBar = new QProgressBar(centralWidget); progressBar->setObjectName(QStringLiteral("progressBar")); progressBar->setGeometry(QRect(10, 10, 21, 51)); QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Expanding); sizePolicy1.setHorizontalStretch(0); sizePolicy1.setVerticalStretch(0); sizePolicy1.setHeightForWidth(progressBar->sizePolicy().hasHeightForWidth()); progressBar->setSizePolicy(sizePolicy1); progressBar->setValue(0); progressBar->setAlignment(Qt::AlignCenter); progressBar->setOrientation(Qt::Vertical); progressBar->setTextDirection(QProgressBar::BottomToTop); Prev_label = new QLabel(centralWidget); Prev_label->setObjectName(QStringLiteral("Prev_label")); Prev_label->setGeometry(QRect(150, 40, 121, 20)); Next_label = new QLabel(centralWidget); Next_label->setObjectName(QStringLiteral("Next_label")); Next_label->setGeometry(QRect(150, 10, 121, 16)); pushButton_3 = new QPushButton(centralWidget); pushButton_3->setObjectName(QStringLiteral("pushButton_3")); pushButton_3->setGeometry(QRect(840, 10, 21, 21)); MainWindow->setCentralWidget(centralWidget); menuBar = new QMenuBar(MainWindow); menuBar->setObjectName(QStringLiteral("menuBar")); menuBar->setGeometry(QRect(0, 0, 869, 21)); MainWindow->setMenuBar(menuBar); retranslateUi(MainWindow); QMetaObject::connectSlotsByName(MainWindow); } // setupUi void retranslateUi(QMainWindow *MainWindow) ................................................................................ "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n" "p, li { white-space: pre-wrap; }\n" "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n" "<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"><br /></p></body></html>", 0)); label_field->setText(QString()); Prev_label->setText(QApplication::translate("MainWindow", "TextLabel", 0)); Next_label->setText(QApplication::translate("MainWindow", "TextLabel", 0)); pushButton_3->setText(QApplication::translate("MainWindow", "X", 0)); } // retranslateUi }; namespace Ui { class MainWindow: public Ui_MainWindow {}; } // namespace Ui QT_END_NAMESPACE #endif // UI_MAINWINDOW_H |